Matlab R2016a MLX generated figure no response

조회 수: 2 (최근 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 CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by