UserData goes empty when I use restore link

조회 수: 5 (최근 30일)
Adrian Dronca
Adrian Dronca 2013년 2월 5일
Hello all,
I've created a toolbox and saved all the data in UserData. I've made the toolbox a library and after I copy the library into a normal model I disable the link.
The UserData data is still present, but when I restore the link to the library the UserData = [];
Why is this happening ? I need to restore the link in the models when I make small updates to the library.
Best Regards, Adrian
  댓글 수: 2
Jan
Jan 2013년 2월 5일
You are talking about Simulink, correctly? UserData are usually volatile, such that a reloading of the object must initialize it before using.
Adrian Dronca
Adrian Dronca 2013년 2월 5일
Yes, I am talking about Simulink. I set the parameter UserDataPersistent to on.

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

채택된 답변

Jan
Jan 2013년 2월 5일
편집: Jan 2013년 2월 5일
Does the note on associating-user-data-with-blocks solve your problem?
Setting UserDataPersitent does:
The following command saves the user data associated with a block in the model file of the model containing the block.
Does this mean, that you have to save the block to store the user data also? If so, did you save the block after setting the UserData?
  댓글 수: 3
Jan
Jan 2013년 2월 7일
I do not understand the 2nd sentence. Splitting this sentence into smaller parts might support my understanding as a non-native speaker.
However, I'm convinced that the bahaviour of the UserData is explained exactly and exhaustively in the documentation of Simulink.
Adrian Dronca
Adrian Dronca 2013년 2월 8일
It's OK, I can work with this also.
Thank you for your support.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by