How to programmatically comment/uncomment a Simulink block?
古いコメントを表示
Simulink blocks can be commented/uncommented using Ctrl+Shift+X.
Is there a way to do this programmatically in a Matlab script?
3 件のコメント
RAGHUVEER RAJESH
2023 年 9 月 21 日
編集済み: RAGHUVEER RAJESH
2023 年 9 月 21 日
Yes. there is and I found it out just now after I explored your question :))) in 2015 I was 17 years old and today I am pursuinig my Masters in Engineering.... Wooh!! That was a long time ago!!!... ;-)
Well the answer is: The path value has to be passed as a string. So put the path in ' ' single inverted commas.
Detailed answer with example given below this question.
Answer:
Please let me know if it helps... Have a nice day! Thanks.
Akhilesh
2024 年 3 月 30 日
how to pogrammatically comment and uncomment all the blocks in the simulink model ?
madhan ravi
2024 年 3 月 30 日
@Akhilesh I am not sure if the following works:
ModelName = 'my_model.slx'; % here you put the name of your Simulink model
set_param(ModelName,'Commented','on')
set_param(ModelName,'Commented','off')
Because in documentation it only mentions about commenting out a block. But even so be the case, you can simply engulf your whole model into a Subsystem and simply comment out that Subsystem block.
採用された回答
その他の回答 (1 件)
RAGHUVEER RAJESH
2023 年 9 月 21 日
編集済み: RAGHUVEER RAJESH
2023 年 9 月 21 日
0 投票
The path value has to be passed as a string. So put the path in ' ' single inverted commas.
For e.g.
set_param('subsystempath','Commented','on')
set_param('subsystempath','Commented','off')
the 'subsystempath' is full path to that subsystem. For e.g. 'modelName/subsystemName...'
If it helps, please let me know...
1 件のコメント
Abhishek
2024 年 10 月 3 日
it is working
thanks a lot
カテゴリ
ヘルプ センター および File Exchange で Subsystems についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!