Command for Matlab standard output

19 views (last 30 days)
Adwait
Adwait on 15 May 2015
Edited: Adwait on 15 May 2015
I am calling Matlab from the Windows command line through another program (LS-OPT). LS-OPT looks for the string 'N o r m a l' as the standard output from Matlab. Does anyone know what command produces a 'standard output' in Matlab? I have tried fprintf, sprintf, disp and none of these work. In perl, the command for a standard output is print. So what would the equivalent command be in Matlab?
More detail provided here .
  2 Comments
Jan
Jan on 15 May 2015
Edited: Jan on 15 May 2015
You must be member of the LS-OPT list to obtain more information by following the link:
You must be signed in and a member of this group to view and participate in it.
Please show us, how you call Matlab from the Windows command line.
Adwait
Adwait on 15 May 2015
This is what is executed on the Windows command line:
matlab -nodesktop -wait -r f_calc_new
The script f_calc_new is:
function f_calc_new
x= 1.5;
y= 1.1;
f = sin(4*x)-2*x + x^2 + sin(4*x)-2*x + x^2;
fid = fopen('f','w+');
fprintf(fid,'%f',f);
fprintf('N o r m a l');
exit;
These discussions make me think that the standard output is different from command window output:
But I'm not familiar with .bat files so I'm not sure what I need to do to move the command window output to the standard output.
Thanks.

Sign in to comment.

Accepted Answer

Adwait
Adwait on 15 May 2015
Edited: Adwait on 15 May 2015
I haven't found any Matlab command that outputs to the Windows command line. One workaround is to use the system command:
system('echo N o r m a l');
This won't open a command line prompt so it would just execute in the background.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!