Automate SFunction generation - Simulink workflow
显示 更早的评论
Hi,
I've got a subsystem block that I'm generating an SFunction of, which I'm then using in a model.
How do I automate the generation of the SFunction so that when the subsystem changes the SFunction is regenerated, so I can be sure I have the latest version? Any script I can write to do this will be called when the library file containing the subsystem changes, but I don't know what to put in the script.
As far as I can see, if the SFunction is regenerated it will replace all the code files - so it isn't necessary to make any changes to the model that uses it. Please correct me if I'm wrong in this assumption. (This is assuming I can treat the block as a black box and the inputs/outputs won't be changing).
Many thanks,
采纳的回答
更多回答(1 个)
TAB
2011-9-15
You can trace the change in your library file containing subsystem by its 'ModifiedDate'.
Write a script to find the modified date as
% Load model library & get its handle
h=load_system('subsystem_library_model');
% Get object from handle
ho=get_param(h,'object');
% Get last modified date & time
LastMdfd=ho.ModifiedDate;
Output will be in the formate 'Thu Sep 15 16:19:06 2011'
You can save the ModifiedDate in a text file and compare the current obtaind date with saved date .
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Coder 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!