Matlab R2016a MLX generated figure no response

2 vues (au cours des 30 derniers jours)
Ming Hu
Ming Hu le 21 Avr 2016
Commenté : Ming Hu le 9 Mai 2016
Hi, I am using Matlab R2016a live script to generate and save some figures. The figures were generated and shown in the live script. They were also saved as .fig file. But when i double clicked them, nothing happens. I wonder if there is something wrong with my installation.
Best, Ming

Réponse acceptée

Matt Cohen
Matt Cohen le 9 Mai 2016
Hi Ming,
This issue is likely related to a default setting made by the Live Editor when working with figures. The figure is probably not being displayed here because it is loaded invisible. When you use live scripts, the 'Visible' property of the figure is set to off because the preview that you see on the right is just a screenshot rather that a docked figure.
To make the figure visible, you would have to set the figure's 'Visible' property to on. You can do this using one of the following two code snippets:
% Assuming variable 'filename' contains the figure's name
f = openfig(filename)
f.Visible = 'on'
or
openfig(filename,'visible')
I hope this helps.
Matt
  1 commentaire
Ming Hu
Ming Hu le 9 Mai 2016
Thanks, Matt. That solved the mystery.
Now, i just need to set the 'visible' on first before saving the figure and then set it off in order to show it in the side panel of the live script.

Connectez-vous pour commenter.

Plus de réponses (1)

Nikhil Vyas
Nikhil Vyas le 25 Avr 2016
It might be possible that the *.fig extension files are not associated with MATLAB. You can change file association in Windows by the following procedure:
Right click the file > Properties > General > Opens With > Change > Select MATLAB.
Additionally, you can try opening the .fig file inside MATLAB using the following command:
openfig('filename.fig');
In case your file is not in your workspace path, you can copy it there. Or you can use an absolute filename like:
openfig('D:\some_folder\some_other_folder\filename.fig');

Catégories

En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by