« Earlier2 items total Later »

Create a multiline title in a GUI

Use char function:

 txt=char('First line','Second line','etc');
 title(txt);


The char function is used here to consolidate strings of different length into a single array. You might wish to play around with the alignment:

 h=title(txt);
 set(h,'HorizontalAlignment','Right');
 set(h,'VerticalAlignment','Middle');

Change the title of the matlab window

QUO posted this on that matlab newsgroup. If you want to change the title of the Matlab main window here is a function that will do the job.

function changetitle(str)

   %first get all of the Java frames present in the current JVM
   frms = java.awt.Frame.getFrames();

   %now, let's look through those frames for one that seems like it
might be the main frame
   root = [];
   for m = 1:length(frms)
      if strcmpi(get(frms(m),'Type'), ...
             'com.mathworks.mde.desk.MLMainFrame')
           root = frms(m);
         break;
      end
   end
   if isempty(root)
      error('Could not find my main frame')
   end
   set(root,'Title',str)

« Earlier2 items total Later »




Sponsored by

Sole Central

Your one stop shop for Birkenstock and Crocs shoes and sandles.