0

I created a a matlab GUI using default GUIDE property of matlab. I made a single push button which when is pushed starts running a particular script. That script takes some inputs from the user to create a ".mat" file which is used in some other scripts seperately. Now what I want is to display the output of command window into the my GUI. I made a static text box and I want to use it as my command window in other words the command window is duplicated in that static text box. Is that possible ? If yes please explain how I can do it.

clear all;
close all;
clc;

theta=input('theta point ')  ;
phi=input('phi point ')  ;

x=input('enter real value '  );
y=input('enter img value ')  ;
z=x .*exp(1j*(y)*pi/180)
Ahsan
  • 15
  • 4
  • The answer is yes, it is possible. However, since you want to run code from a GUI, it would be cleaner to convert your _script_ into a _function_ called by the GUI (and since you have a gui, the function can collect its input from it instead of having to prompt the user). This way you control the output of the function and you can display only the relevant parts in the textbox. Try to recreate a command windows in a custom gui is like trying to re-invent the wheel. – Hoki Jul 12 '16 at 11:53
  • @Hoki I tried to use your code given in the link but still as I push the button the gui closes and output remains on the command window. just for your consideration I am trying to work with this simple code. clear all; close all; clc; %% theta=input('theta point ') ; phi=input('phi point ') ; x=input('enter real value ' ); y=input('enter img value ') ; z=x .*exp(1j*(y)*pi/180) – Ahsan Jul 12 '16 at 13:22

0 Answers0