### Tags: ian, instances, matlab, normally, programming, window, written

# Matlab title

On Programmer » Matlab

2,166 words with 5 Comments; publish: Thu, 01 May 2008 00:05:00 GMT; (20046.88, « »)

Is there anyway i Ian change the title on the main matlab window (

where you see MATLAB written ).

I normally work with more than one instances of matlab running at a

time, so it would be helpful if the title of the window can be

changed so that I don'type a command in the wrong window.

Thank you

Kranthi

*http://matlab.todaysummary.com/q_matlab_37893.html*

All Comments

Leave a comment...

- 5 Comments
- Kranthi wrote:
> Is there anyway i Ian change the title on the main matlab window (

> where you see MATLAB written ).

> I normally work with more than one instances of matlab running at a

> time, so it would be helpful if the title of the window can be

> changed so that I don'type a command in the wrong window.

I think the only possibility is to use operating system commands. Within

Matlab it is not possible (to my knowledge).

-Herbert

#1; Thu, 01 May 2008 00:07:00 GMT

- Kranthi wrote:
- Thank you Mr.Herbert. I hope matlab adds such a command in its future
versions.

#2; Thu, 01 May 2008 00:08:00 GMT

- Thank you Mr.Herbert. I hope matlab adds such a command in its future
- Although I rarely dare contradict Mr. Ramoser (as he has a knack for
being correct), it is possible to change the title of the matlab

window.

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)

hope this helps

-quo

#3; Thu, 01 May 2008 00:09:00 GMT

- Although I rarely dare contradict Mr. Ramoser (as he has a knack for
- Thank you very much sir.. this function is working fine.
I hope now I wont type 'clear all' in the wrong window and lose all

my variables :)

#4; Thu, 01 May 2008 00:10:00 GMT

- Thank you very much sir.. this function is working fine.
- quo wrote:
> Although I rarely dare contradict Mr. Ramoser (as he has a knack for

> being correct), it is possible to change the title of the matlab

> window.

Thank you for this information. I was not aware that it is possible to

modify the main window. Probably I should learn Java ...

-Herbert

#5; Thu, 01 May 2008 00:11:00 GMT

- quo wrote: