Aramdeep,
I feel your pain and have experienced similar situations before. As such there are two solutions that I can think of that can solve your problem:
1st Solution: Instead of using the 'sim' command, I suggest using the model command. Specifically the model command is advantageous if you are just trying to treat your model as a funciton and get outputs for a given set of inputs. Additionally make sure that you 'compile' and 'term' the model as few times as possible to prevent initialization overhead.
Example: model_name([],[],[],'compile');
for i=1:number_cases
output_vector = model_name(0,state_vector,input_vector);
end
model_name([],[],[],'term');
2nd solution:
Tell the reference models not to rebuild. This is a two step process. First Go to Simulation->Configuration Parameters -> Model Referenceing -> Rebuild -> Never (Alternatively this can be also done progratically from the command line if needed. Just reply to this post if you need to know how). After that, make sure the secondary setting next to the rebuild parameter (regarding the error message) is set to None. I think it is the stupidest thing, but even if you tell Simulink not to rebuild, and dont set the error checking message also not to check, then it will still rebuild! Once this step is complete if you need to make changes to the reference models (like make a data or structural change) you need to temporarily set the Rebuild parameter to 'If out of Date' and then run the sim to recompile. Another alternative is if you need changes to be recognize, you can use the slbuild command.
2 件のコメント
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/20730-supress-simulink-re-compile-on-every-call#comment_45294
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/20730-supress-simulink-re-compile-on-every-call#comment_45294
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/20730-supress-simulink-re-compile-on-every-call#comment_45296
このコメントへの直接リンク
https://jp.mathworks.com/matlabcentral/answers/20730-supress-simulink-re-compile-on-every-call#comment_45296
サインインしてコメントする。