Matlab R2016a MLX generated figure no response

1 回表示 (過去 30 日間)
Ming Hu
Ming Hu 2016 年 4 月 21 日
コメント済み: Ming Hu 2016 年 5 月 9 日
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

採用された回答

Matt Cohen
Matt Cohen 2016 年 5 月 9 日
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 件のコメント
Ming Hu
Ming Hu 2016 年 5 月 9 日
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.

サインインしてコメントする。

その他の回答 (1 件)

Nikhil Vyas
Nikhil Vyas 2016 年 4 月 25 日
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');

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by