How can I insert a uifigure in my livescript code?

조회 수: 8 (최근 30일)
Giuseppe
Giuseppe 2021년 6월 11일
댓글: Adam Danz 2021년 6월 12일
Hi guys, I d' like to insert a uifigure in my livescript as in the following image:
The problem is that when I run the code, the uifigure appears in a separate window but I want it inside a box within my livescript.
The image is taken by an example livescript that is given by the mapping toolbox:
Can you help me, pleae
  댓글 수: 6
Walter Roberson
Walter Roberson 2021년 6월 12일
And the separated figure can be uifigure(), but you cannot get one in line with Live script.
Adam Danz
Adam Danz 2021년 6월 12일
GIFs are image files but I could have been clearer. If you look at other figures in that demo created by uifigure, they are all inserted as images (example below).
The creators of that demo could have been clearer that they were inserting images.

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

채택된 답변

Adam Danz
Adam Danz 2021년 6월 11일
편집: Adam Danz 2021년 6월 11일
Embedded figures in the Live Editor should be created with the figure() function instead of the uifigure() function.
If, for some reason a uifigure is required or you'd like to embed an existing uifigure, you can copy its content to a regular figure using the example below.
% In Live Editor (r20201a)
fig = uifigure('Visible','off'); % Produced externally, but invisible.
ax = axes(fig);
plot(ax, rand(5))
f2 = figure; % Produced internally
set(fig.Children,'Parent',f2)
delete(fig)
This won't not work for graphics objects that require the use of uifigure.

추가 답변 (1개)

Giuseppe
Giuseppe 2021년 6월 12일
Mystery solved!
In the example livescript, the images and GIF are inserted as external files!
However, thanks to everyone for your support.

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by