Matlab system command produces output on matlab command line

Dear community,
I am using Matlab's system() command to call an external Program (Praat) to run a (Praat) script. I didn't want Matlab to do anything but that. But after doing the call to system(), an output is produced in my Matlab command line without any meaning
the input to the system command is
praatcommand = ['Praat.exe --run extractPitch.praat.txt "' source '" praatOutputTemp.txt'];
which runs the specified Script in the background on the input file 'source' and outputs data in the specified text file.
Then this happens on my Matlab command line:
>> retval=system(praatcommand);
R00001122223344445566K>>
the second line appears. I have no idea why. If i run the same call directyl in the cmd, everything is fine also.
Anyways, if I append a ' &' at the end of the system call, it does not happen (so there is no Problem).
Is this a bug or why does it happen? Or is the reason some echo calls inside the script?
I appended the Praat script for completeness.
best regards
Jonas

4 Comments

What happens if you catch the output:
[status, result] = system(praatcommand)
Because the output is produced in Praat, it would be a good question for the authors or the Praat community.
an update now:
if i call the given line again and again, it now switches the output between 'R0011' and 'R001' and 'R0001'.
[retval]=system(praatcommand);
R001>> [retval]=system(praatcommand);
R001>> [retval]=system(praatcommand);
R0011>> [retval]=system(praatcommand);
R001>> [retval]=system(praatcommand);
R0011>> [retval]=system(praatcommand);
R001>> [retval]=system(praatcommand);
R0001>> [retval]=system(praatcommand);
if i call
[retval,msg]=system(praatcommand)
retval =
0
msg =
'R0'
if i call
[retval,msg]=system([praatcommand ' &'])
retval =
0
msg =
0×0 empty char array
if i comment out all echo commands from the Praat script, then
[retval,msg]=system([praatcommand])
retval =
0
msg =
0×0 empty char array
and with one ouput arguemnt only
[retval]=system(praatcommand)
retval =
0
looks like the echo command plants the problem. However, I dont understand, how this script can create values on my matlab commad line. Does it send keypress while evaluating which produces the output on the matlab command line?
@Jonas: I'm loosing the overview. At first it was:
>> retval=system(praatcommand);
R00001122223344445566K>>
Now it is
[retval]=system(praatcommand);
R001>>
And changes between R001 and R0011.
There is a connection to the ECHO commands in the script.
Well, confusing. I still think, that this is a problem of Praat, not of Matlab, so this is off-topic in this forum
i would agree, that it is confusing. The only additional difference may be the source file which was analyzed, I don't know anymore if the described behavior was for the same for the original post and the update.
i also agree that this seems to be a Praat issue and I will close this thread.
thx, have a nice day

Answers (0)

This question is closed.

Products

Release

R2022a

Asked:

on 19 May 2022

Closed:

on 20 May 2022

Community Treasure Hunt

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

Start Hunting!