jdelacroix / simiam

A MATLAB-based educational bridge between theory and practice in robotics.
http://gritslab.gatech.edu/projects/robot-simulator
Other
103 stars 52 forks source link

About Simulink patch: for someone loves use Simulink blocks #9

Open BlueBirdHouse opened 10 years ago

BlueBirdHouse commented 10 years ago

For the first time to use simiam’s Simulink blocks in “simulink” folder, the matlab can’t set the right paths: (“../”means the unzipped folder, and you charge some classes in “../+simiam”, you would like to use the newest. ) (The “slx” file you built with some simiam’s classes, for example: use “Matlab Function block”, and in the block your code is using simiam’s classes) If you stay in “../ simulink” and run the “slx” file you built with some simiam’s classes, the matlab will not find “../+simiam” which may contain your own charges. But if you open the “slx” file you built with some simiam’s classes, and return to “../”, the Simulink will not filed the “getSimulatorBlockUserData.m”, “msfun_simiam_ui.m” or other m files in “../ simulink”. Then you are puzzled: “Which folder should I stay with?” Consider you stay in “../ simulink” and run these code manually: root_path = fullfile(fileparts(mfilename('fullpath')), '../'); addpath(genpath(root_path)); You can write a m file in “../simulink” with these codes before you run your own “slx” file.