Embed Command Window in GUI

  • Follow


Does anyone know, is there a way in which one can embed a MATLAB command window into a GUI easily? 

I want to use the GUI to graphically allow a user to build up a long list of commands and then execute them in an embedded window with a "process" button click. It'd be nice to not have to manually try to recreate the functionality of the command window.

thanks,

Val
0
Reply Val 11/8/2010 6:18:03 PM

On 10-11-08 12:18 PM, Val Schmidt wrote:
> Does anyone know, is there a way in which one can embed a MATLAB command
> window into a GUI easily?
> I want to use the GUI to graphically allow a user to build up a long
> list of commands and then execute them in an embedded window with a
> "process" button click. It'd be nice to not have to manually try to
> recreate the functionality of the command window.

If the created code throws an error that the created code does not catch, then 
should that error be reflected on the embedded Matlab command window or on the 
original Matlab command window? I suspect you would prefer it to be displayed 
on the embedded Window, but if the error is "out of memory" then you probably 
don't have enough memory to put the results up on the embedded window, and 
thus probably need to crash back to the original command line.


I would tend to suggest that you do not need functionality of the command 
window such as searching to previous commands according to the command prefix 
you have entered so far. You probably only need to display results -- which is 
something you can do by using evalc() .

There is, though, a notable difference between the command window and evalc() 
or eval (beyond whether input() is supported or not), which is that eval / 
evalc do not support multi-line statements. If you have those then you 
probably need to write the statements to a file and execute the file.

Also, evalc() does not return output until all the statements are evaluated; 
you probably want output "as it goes along". It might perhaps make sense in 
your situation to evalc() one line at a time of the input.


Another consideration is that the command line starts in the 'base' workspace, 
but eval / evalc operate in the workspace they are invoked from. There would, 
I think, be semantic difficulties in having two different command windows both 
accessing the base workspace, if you were able to somehow start up a second 
command window.
0
Reply Walter 11/8/2010 8:31:22 PM


1 Replies
577 Views

(page loaded in 0.018 seconds)

Similiar Articles:













7/25/2012 12:39:11 AM


Reply: