How to set the Model History information programmatically?

The Model Properties > History tab allows you to uncheck "Read Only" and then make modifications to the "Created by" and "Last saved by" fields (as well as the others).
Programmatically, the following code should change the field,
set_param(sys, 'LastModifiedBy', 'Ada');
however this error is thrown:
How can these model parameters be changed? Is there a way to programmatically unset the "Read Only" flag?

 채택된 답변

Monika Jaskolka
Monika Jaskolka 2018년 2월 21일
I ended up contacting Matlab Support for this.
Some of these parameters are formatted based on another parameter. While the LastModifiedBy, LastModifiedDate , and ModelVersion parameters are read-only, you can change their values by changing their corresponding "format" parameters.
For instance, to change the name of who modified the model last, i.e, the LastModifiedBy parameter, you must modify ModifiedByFormat and save the model for the change to affect the LastModifiedBy parameter.
set_param(sys, 'ModifiedByFormat', 'Ada')
save_system(sys)
A summary of how to change all the values in the Model information section of the model properties is given in the table.

댓글 수: 4

Hi Monika,
This is praveen, I have doubt about the following picture i mentioned. I highlighted part i need to take programmatically. Can you help me to solve this problem...キャプチャ.PNG
Monika Jaskolka
Monika Jaskolka 2019년 7월 11일
편집: Monika Jaskolka 2019년 7월 11일
Hi Praveen,
There is no way to programmatically check/uncheck the Read Only flag. Why do you want to do this? If you want to uncheck it so you can modify one of the Model Information parameters, please see my earlier response. You can change these parameters without unchecking the Read Only flag.
Hello Monika,
is there any way to set the model workspace programatically?
Thanks,
V. Ajay Krishna

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by