Unexpected prompt characters on command line output

I am running MATLAB from command line using the following command on a linux system
$ matlab -nojvm -nodisplay < main.m
The command line ouput contains unexpected prompt characters (">>") at the beginning of the ouptut. The expected output, which is obtianed when running the code in the MATLAB command window is
>> main
Dimension 1: Range = [-9.93,9.93]
Dimension 2: Range = [-9.93,9.93]
Dimension 3: Range = [-9.93,9.93]
Size of a: 15180
Size of b: 32509
However, when run from the command line, the output looks like
$ matlab -nodisplay -nojvm < Collocate.m
< M A T L A B (R) >
Copyright 1984-2023 The MathWorks, Inc.
R2023b Update 5 (23.2.0.2459199) 64-bit (glnxa64)
November 28, 2023
For online documentation, see https://www.mathworks.com/support
For product information, visit www.mathworks.com.
>> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>>>>>>>Dimension 1: Range = [-9.93,9.93]
Dimension 2: Range = [-9.93,9.93]
Dimension 3: Range = [-9.93,9.93]
>> >> >> >> >> >> Size of a: 15180
>> Size of b: 32509
And keeps going on for a few more lines. I can't understand where the prompt symbols ">>" come from. Is there any way of getting rid of these?

 Respuesta aceptada

Steven Lord
Steven Lord el 7 de Jun. de 2024
Rather than piping the contents of the file to MATLAB, do you see this same behavior if you use the -batch startup option listed on this documentation page? I think that is more in-model for the operation you're trying to perform.

1 comentario

Luca
Luca el 7 de Jun. de 2024
Using the -batch option solved the problem and the output showed as expected. Thank you!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.

Productos

Versión

R2023b

Etiquetas

Preguntada:

el 7 de Jun. de 2024

Comentada:

el 7 de Jun. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by