- This topic has 2 replies, 3 voices, and was last updated 3 years, 2 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
Home › Forum › Announcements / Infos › Launching SOFA from Matlab script
Tagged: matlab sofa
This was tried in Ubuntu machine.
1. Launch Matlab preloading libraries that Sofa uses.
LD_PRELOAD=”/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5:/usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5:/usr/lib/x86_64-linux-gnu/libQt5Gui.so.5:/usr/lib/x86_64-linux-gnu/libQt5Core.so.5″ matlab
2. From a Matlab script launch sofa.
pathToSofaScene = fullfile(PATH_TO_SOFA_SCENES, ‘sofaScene.scn’)
[status, result] = system([‘PATH_TO_SOFA_BIN/runSofa -g batch -n 10’ pathToSofaScene]);
It reads in result the sofa terminal output.
Note. Matlab plots, and other Qt related funcitons (write png images) will be a bit broken
Thank you for sharing Jaime!
Also, in Windows there is no need to load any library. Just write a Matlab scripts as:
pathToSofaScene = ‘”FULL ADDRESS TO YOUR SCENE\scene.scn”‘;
[status, result] = system([‘C:\Users\XXX\SOFA\vXXX\bin\runSofa -g batch -n 100 ‘ pathToSofaScene])
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.