How to restore example to default

I opened a Simulink example file and made modifications before thinking of making a working copy. Now I can't get back to the original. How can I download it again from Mathworks?

댓글 수: 1

Torsten
Torsten 2024년 7월 26일
Can't you reinstall the Simulink examples folder ? If not, I'd reinstall complete MATLAB.

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

답변 (1개)

Shubham
Shubham 2024년 8월 5일

1 개 추천

Hi Roger,
It is my understanding that you want to restore your Simulink example to default state. You can do so by following these steps:
  1. Open your modified Simulink example.
  2. Search for its location in your system by using 'which example_model_name' command.
  3. Go to the location and delete/move the Simulink example to some other location as per your requirement.
  4. Again, open the example using 'openExample(example_name)' command.
This will open the default Simulink example.
Hope it helps.
Regards,
Shubham

댓글 수: 8

Roger Kaplan
Roger Kaplan 2024년 8월 5일
이동: Walter Roberson 2024년 8월 9일
I'm not sure if the above procedure would have worked, unless it causes Matlab to download the example again from the server. Instead, I uninstalled and reinstalled the toolbox. I would have preferred a mechanism to just update the examples. Maybe what you suggest does that automatically?
Thanks,
Roger Kaplan
Torsten
Torsten 2024년 8월 5일
이동: Walter Roberson 2024년 8월 9일
To me it sounds as if @Shubham misunderstood your problem. But I might be wrong.
Walter Roberson
Walter Roberson 2024년 8월 5일
이동: Walter Roberson 2024년 8월 9일
When you openExample(), MATLAB makes a copy of internal files (including unpacking internal archives) and drops the result into a user directory. The source files are left intact. If you remove the directory that the files were unpacked into, then the next time you openExample(), the files will be unpacked again.
Torsten
Torsten 2024년 8월 6일
이동: Walter Roberson 2024년 8월 9일
So it's impossible to irreversably modify Simulink example files as @Roger Kaplan claimed to have done ? Modifications are always done to a copy ?
Walter Roberson
Walter Roberson 2024년 8월 6일
이동: Walter Roberson 2024년 8월 9일
You would have to have dug around and found the master version and modified that. Not impossible, but unlikely.
The master versions of files are mostly stored in numbered files, and then for each example there is a manifest that says which files are to be extracted and what name they are to be given. This is done because there is a fair bit of overlap of files between examples, shared infrastructure.
Shubham
Shubham 2024년 8월 9일
이동: Walter Roberson 2024년 8월 9일
Hi @Roger Kaplan, It worked on my end and I was able to restore my examples to default state. Can you try implementing the solution to see if it works for you.
If you have any queries, feel free to comment
Roger Kaplan
Roger Kaplan 2024년 8월 9일
Thanks for your suggestions, but I already altered the conditions by reinstalling the toolbox. I'll try what you suggest next time.
nirlan neckir
nirlan neckir 2025년 1월 3일
Hi @Shubham, it worked, my examples were restored to default. Thank you.

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

제품

릴리스

R2024a

태그

질문:

2024년 7월 26일

댓글:

2025년 1월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by