Page 1 of 1

Output no longer displayed to command window in Matlab

Posted: Mon Jan 22, 2018 8:08 am
by danielfng
Hi,

Recently I've noticed that running the RRA tool in Matlab no longer pipes output to the command window. I think this happened when I upgraded my Matlab release from 2016a to the latest version.

I was wondering if anyone else has run in to this and figured out a way to restore the old behaviour, or alternatively specify a file for the output to be piped to?

By output I meant what is normally displayed in the OpenSim GUI.

Cheers,

Daniel

Re: Output no longer displayed to command window in Matlab

Posted: Mon Jan 22, 2018 4:34 pm
by tkuchida
You should be able to read the output from the out.log file.

Re: Output no longer displayed to command window in Matlab

Posted: Mon Jan 22, 2018 5:15 pm
by chrisdembia
Tom is correct about the workaround.

This is a known issue (https://github.com/opensim-org/opensim-core/issues/1612). The behavior depends on the match between the version of the compiler used for MATLAB and OpenSim.

Re: Output no longer displayed to command window in Matlab

Posted: Mon Apr 02, 2018 8:19 am
by danielfng
Is there a way to specify or recover the path to the log file?

As far as I can tell the out.log and err.log files are created upon first use of an OpenSim analysis within a Matlab session and during that session those files are used. Is there a way to programmatically ask for the full out.log path in the middle of a Matlab session, if you haven't made a note of it at the start?

Re: Output no longer displayed to command window in Matlab

Posted: Mon Apr 02, 2018 9:12 am
by chrisdembia
The files are written to the current working directory.

Re: Output no longer displayed to command window in Matlab

Posted: Tue Oct 09, 2018 10:16 am
by bartvanveen
Would there be a way to do the opposite, i.e. suppress the OpenSim Messages to be displayed in the MATLAB Command Window?

I am using API calls (so not a call to an OpenSim tool) within a parfor loop and the printing of the messages to the Command Window seem to make the workers wait for each other to print their messages. Running the script through the MATLAB 'evalc' function (which captures rather than prints the messages) provides the expected increase in speed when switching from a for to a parfor loop. However, I would rather avoid using eval.

Thanks in advance for any suggestions.

Re: Output no longer displayed to command window in Matlab

Posted: Wed Jun 17, 2020 11:06 am
by russellj
bartvanveen wrote:
Tue Oct 09, 2018 10:16 am
Would there be a way to do the opposite, i.e. suppress the OpenSim Messages to be displayed in the MATLAB Command Window?

I am using API calls (so not a call to an OpenSim tool) within a parfor loop and the printing of the messages to the Command Window seem to make the workers wait for each other to print their messages. Running the script through the MATLAB 'evalc' function (which captures rather than prints the messages) provides the expected increase in speed when switching from a for to a parfor loop. However, I would rather avoid using eval.

Thanks in advance for any suggestions.
I'm interested if anyone found a better solution to suppressing output to the command window. I have a project that needs to run initSystem many, many times and the output to the command window is overwhelming and seems to make the code extremely slow. I am currently using OpenSim 4.1 and Matlab 2019B. I don't seem to have this issue with OpenSim 3.3 and the same version of Matlab.

Thanks in advance!

Re: Output no longer displayed to command window in Matlab

Posted: Mon Sep 28, 2020 1:58 pm
by danielfng
Hi Russell,

I now have the same problem as you (amusingly the opposite problem to when I originally created this post).

Did you find a nice way of suppressing the output to the command window?

Cheers,

Daniel

Re: Output no longer displayed to command window in Matlab

Posted: Wed Nov 11, 2020 6:43 pm
by russellj
Hi Daniel,

I have not been able to find a way to suppress the output in 4.1. After not hearing any solutions here, I decided to just commit to using OpenSim 3.3 which does not give me the same issues with the output to the screen. I haven't really tried since this summer though, so I'm not sure if recent updates to the 4.1 code would be any different now.

Russell