Command for Matlab standard output

22 visualizaciones (últimos 30 días)
Adwait
Adwait el 15 de Mayo de 2015
Editada: Adwait el 15 de Mayo de 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 comentarios
Jan
Jan el 15 de Mayo de 2015
Editada: Jan el 15 de Mayo de 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 el 15 de Mayo de 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.

Iniciar sesión para comentar.

Respuesta aceptada

Adwait
Adwait el 15 de Mayo de 2015
Editada: Adwait el 15 de Mayo de 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.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by