Unexpected prompt characters on command line output

2 次查看(过去 30 天)
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?

采纳的回答

Steven Lord
Steven Lord 2024-6-7
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by