Hi there
I am implementing a Forward Dynamics pipeline in MATLAB, using the new API. Is it possible to change the location of (or even periodically clear/delete) the 'err' and 'out' log files when working with multiple models and motion capture trials?
When I start my code, the log files appear in the Current MATLAB Directory. However from then on, regardless of which directory I begin to work in, the output is saved in the same log files. I have to exit MATLAB and restart the program for it to change to another directory, and then the same situation continues.
Am i missing some method or object that allows me to control this output, or at least the location where this output is saved?
Regards,
Shaun
OpenSim 3.1 - Specifying log file location
- Shaun Fickling
- Posts: 13
- Joined: Fri Feb 24, 2012 11:48 am
- David John Saxby
- Posts: 83
- Joined: Mon May 09, 2011 8:39 pm
Re: OpenSim 3.1 - Specifying log file location
Hi Shaun,
I had a similar issue. I wanted to write the log file for each given operation, rather than overwrite.
What I did was (see below example from a scaling operation):
% Check for the log file
test4linscalelog = dir(fullfile(subjectDir, '*out.log'));
% Condition for copying log
if ~isempty(test4linscalelog)
% Rename the out.log so that it doesn't get overwritten.
% Nice feature if you keep track of fitting error and such.
copyfile('out.log',[subjectDir '\' name 'linear_scaling_out.log'])
end
This worked for me.
Cheers,
David
I had a similar issue. I wanted to write the log file for each given operation, rather than overwrite.
What I did was (see below example from a scaling operation):
% Check for the log file
test4linscalelog = dir(fullfile(subjectDir, '*out.log'));
% Condition for copying log
if ~isempty(test4linscalelog)
% Rename the out.log so that it doesn't get overwritten.
% Nice feature if you keep track of fitting error and such.
copyfile('out.log',[subjectDir '\' name 'linear_scaling_out.log'])
end
This worked for me.
Cheers,
David
- Shaun Fickling
- Posts: 13
- Joined: Fri Feb 24, 2012 11:48 am
Re: OpenSim 3.1 - Specifying log file location
Hi David
Thanks for the input, that's pretty much what I'm trying to do. I can copy the 'out.log' file to another name, but I still don't have permission to delete the original. So, when I run the following iterations, it just appends to the end of the original log file (even though my current working directory is now somewhere else).
I've tried using the "clear all" command in MATLAB to try release all links to OpenSim so that I can delete this file but that also doesn't work.
I must be missing something!
Shaun
Thanks for the input, that's pretty much what I'm trying to do. I can copy the 'out.log' file to another name, but I still don't have permission to delete the original. So, when I run the following iterations, it just appends to the end of the original log file (even though my current working directory is now somewhere else).
I've tried using the "clear all" command in MATLAB to try release all links to OpenSim so that I can delete this file but that also doesn't work.
I must be missing something!
Shaun
- David John Saxby
- Posts: 83
- Joined: Mon May 09, 2011 8:39 pm
Re: OpenSim 3.1 - Specifying log file location
Hi Shaun,
Are you running Windows 7? Are you running Matlab in Administrator mode? I think the permissions might be different between operating systems, not sure though.
David
Are you running Windows 7? Are you running Matlab in Administrator mode? I think the permissions might be different between operating systems, not sure though.
David
- Shaun Fickling
- Posts: 13
- Joined: Fri Feb 24, 2012 11:48 am
Re: OpenSim 3.1 - Specifying log file location
Hi David
I managed to get around it by toggling between working directories using the cd command in MATLAB. That way I can run the Tools from the same directory and the log files are always updated there. It's not ideal but it works!
Thank you for your help.
Cheers
Shaun
I managed to get around it by toggling between working directories using the cd command in MATLAB. That way I can run the Tools from the same directory and the log files are always updated there. It's not ideal but it works!
Thank you for your help.
Cheers
Shaun
- David John Saxby
- Posts: 83
- Joined: Mon May 09, 2011 8:39 pm
Re: OpenSim 3.1 - Specifying log file location
Hi Shaun,
That is also how my code runs. Some the API execution commands (maybe all not sure) require the path to the directory as input argument. While the write location doesn't seem modifiable, so it probably uses the cd as default.
Glad its working
David
That is also how my code runs. Some the API execution commands (maybe all not sure) require the path to the directory as input argument. While the write location doesn't seem modifiable, so it probably uses the cd as default.
Glad its working
David