Darcy
Darcy

Reputation: 659

Renaming a gui figure and .m file

I work in a team which shares a variety of Matlab scripts. One of my co-workers built a GUI which he named MT_v1.fig with a corresponding script MT_v1.m.

Now, I have made some edits to both the script and the figure (added a few buttons, etc).

What I want do now sounds like it should be easy: I want to rename the figure and the .m file such that I now have:

MT_v2.fig and MT_v2.m

However, when I try to do this it gives me a whole host of errors because all the callbacks in MT_v2.fig are still referencing the MT_v1.m file. I want to save the two separate version names so that people on the team can easily differentiate the two versions.

Is there an easy way to quickly update all the callbacks in MT_v2.fig so that they reference the MT_v2.m script?

Upvotes: 1

Views: 984

Answers (1)

Benoit_11
Benoit_11

Reputation: 13945

I had the same issue and needed to do the following:

1- Before applying any changes to the "new" GUI/.fig and .m files, save the .fig file under the new name. The corresponding .m file will be generated.

2- Apply your changes to the .fig and/or .m files only once the new versions have been saved.

3- You can then save normally both files under the new name and everything should be fine.

That worked for me hope it does for you!

Upvotes: 2

Related Questions