Output no longer displayed to command window in Matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Daniel Gordon
Posts: 34
Joined: Fri May 06, 2016 7:57 am

Output no longer displayed to command window in Matlab

Post by Daniel Gordon » Mon Jan 22, 2018 8:08 am

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

User avatar
Thomas Uchida
Posts: 1793
Joined: Wed May 16, 2012 11:40 am

Re: Output no longer displayed to command window in Matlab

Post by Thomas Uchida » Mon Jan 22, 2018 4:34 pm

You should be able to read the output from the out.log file.

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Output no longer displayed to command window in Matlab

Post by Christopher Dembia » Mon Jan 22, 2018 5:15 pm

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.

User avatar
Daniel Gordon
Posts: 34
Joined: Fri May 06, 2016 7:57 am

Re: Output no longer displayed to command window in Matlab

Post by Daniel Gordon » Mon Apr 02, 2018 8:19 am

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?

User avatar
Christopher Dembia
Posts: 506
Joined: Fri Oct 12, 2012 4:09 pm

Re: Output no longer displayed to command window in Matlab

Post by Christopher Dembia » Mon Apr 02, 2018 9:12 am

The files are written to the current working directory.

User avatar
Bart van Veen
Posts: 9
Joined: Tue Jun 23, 2015 5:40 am

Re: Output no longer displayed to command window in Matlab

Post by Bart van Veen » 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.

User avatar
Russell Johnson
Posts: 14
Joined: Sun Dec 23, 2012 5:10 pm

Re: Output no longer displayed to command window in Matlab

Post by Russell Johnson » Wed Jun 17, 2020 11:06 am

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!

User avatar
Daniel Gordon
Posts: 34
Joined: Fri May 06, 2016 7:57 am

Re: Output no longer displayed to command window in Matlab

Post by Daniel Gordon » Mon Sep 28, 2020 1:58 pm

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

User avatar
Russell Johnson
Posts: 14
Joined: Sun Dec 23, 2012 5:10 pm

Re: Output no longer displayed to command window in Matlab

Post by Russell Johnson » Wed Nov 11, 2020 6:43 pm

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

POST REPLY