Clear Filters
Clear Filters

Unexpected prompt characters on command line output

2 views (last 30 days)
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?

Accepted Answer

Steven Lord
Steven Lord on 7 Jun 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 Comment
Luca
Luca on 7 Jun 2024
Using the -batch option solved the problem and the output showed as expected. Thank you!

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!