Can I change the prompt in MATLAB? -


i never work gui , inside terminal (also full screen, no title bar) set -nodesktop -nodisplay option. have different servers connect to, run matlab , each of have different restrictions on hogging computational resources. since it's hard remember server i'm in,especially if have multiple sessions open, wondering if change prompt display server name. try might, couldn't find resource explains how go (i'm beginning think mathworks doesn't support it). know, workaround write function call system('hostname') , put function in path, it's easy typing pwd find directory. i'd know if there's more elegant.

there submission on mathworks file exchange can you: setprompt yair altman. using in r2010b, noticed getting warning message:

warning: possible deprecated use of set on java callback.  > in setprompt @ 115 

which able suppress using warning function so:

warning('off','matlab:hg:javasethgproperty'); 

and here's how changed prompt host name using system function:

>> [~,systemstring] = system('hostname'); >> setprompt([deblank(systemstring) '>> ']); p11-4504>> 

the function deblank used remove trailing whitespace (in case newline) string.

note: above changes (suppressed warning , modified prompt) don't persist after quit , restart matlab, put above code in startup.m file apply them automatically every time start new session.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -