Command for Matlab standard output

조회 수: 25 (최근 30일)
Adwait
Adwait 2015년 5월 15일
편집: Adwait 2015년 5월 15일
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
Jan
Jan 2015년 5월 15일
편집: Jan 2015년 5월 15일
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 2015년 5월 15일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Adwait
Adwait 2015년 5월 15일
편집: Adwait 2015년 5월 15일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by