Using a plugin Analyze Tool in Matlab
Posted: Wed Aug 16, 2023 7:15 am
Hi all,
I am trying to use the plugin 'MuscleForceDirection' within a Matlab code. I have tried two options and want to know if there is any way this can work better.
1. I would love to be able to use the AnalyzeTool within Matlab to run StaticOptimization, MuscleAnalysis, and MuscleForceDirection all together. My code for that looks like:
import org.opensim.modeling.*
opensimCommon.LoadOpenSimLibraryExact('C:\OpenSim 4.4\plugins\MuscleForceDirection.dll');
mfdTool = MuscleForceDirection();
mfdTool.setStartTime(startTime);
mfdTool.setEndTime(endTime);
Loading the OpenSim library returns true so it seems like that worked, however, when trying to actually use the MuscleForceDirection tool, Matlab is still saying that it is an unrecognized function or variable.
2. Alternatively, when following the documentation for the MuscleForceDirection plugin, this code is given:
[message,result] =dos(['analyze -S ',SetupFile,' -L ','MuscleForceDirection.dll'],'-echo');
It seems to run everything, but does so separately from the other analyses so it takes double the time. I also can't edit any of the settings for the tool, such as 'print_muscle_attachments'.
Is there another way I could be calling this plugin to edit and print it to the .xml set up file for AnalyzeTool? Also, how would I find the other proper Matlab commands for settings within the tool since these are not going to be found on the API page?
Thanks in advance!
Reese
I am trying to use the plugin 'MuscleForceDirection' within a Matlab code. I have tried two options and want to know if there is any way this can work better.
1. I would love to be able to use the AnalyzeTool within Matlab to run StaticOptimization, MuscleAnalysis, and MuscleForceDirection all together. My code for that looks like:
import org.opensim.modeling.*
opensimCommon.LoadOpenSimLibraryExact('C:\OpenSim 4.4\plugins\MuscleForceDirection.dll');
mfdTool = MuscleForceDirection();
mfdTool.setStartTime(startTime);
mfdTool.setEndTime(endTime);
Loading the OpenSim library returns true so it seems like that worked, however, when trying to actually use the MuscleForceDirection tool, Matlab is still saying that it is an unrecognized function or variable.
2. Alternatively, when following the documentation for the MuscleForceDirection plugin, this code is given:
[message,result] =dos(['analyze -S ',SetupFile,' -L ','MuscleForceDirection.dll'],'-echo');
It seems to run everything, but does so separately from the other analyses so it takes double the time. I also can't edit any of the settings for the tool, such as 'print_muscle_attachments'.
Is there another way I could be calling this plugin to edit and print it to the .xml set up file for AnalyzeTool? Also, how would I find the other proper Matlab commands for settings within the tool since these are not going to be found on the API page?
Thanks in advance!
Reese