How to use the function quiver in app designer?

조회 수: 13 (최근 30일)
Elise Bruas
Elise Bruas 2021년 5월 17일
편집: Cris LaPierre 2021년 5월 17일
Hello,
I don't know how to use quiver (2D) in app designer?
Imshow does not work and I want to display a figure with the quiver knowing that I have already created an empty figure in the designer view. Can someone help me?
Elise

채택된 답변

Rik
Rik 2021년 5월 17일
You can specify the Parent property:
%load example data from the doc
load('wind','x','y','u','v')
X = x(11:22,11:22,1);
Y = y(11:22,11:22,1);
U = u(11:22,11:22,1);
V = v(11:22,11:22,1);
ax=uiaxes(uifigure);% create uiaxes handle
quiver(X,Y,U,V,'Parent',ax)

추가 답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 5월 17일
편집: Cris LaPierre 2021년 5월 17일
The general adaptation to get it to work in app designer is to explicitly tell the function which axes to plot into. For some functions, like quiver, the target axis is one of the optional inputs.
For others, like imshow, you use use the 'Parent' name-value pair.
imshow('peppers.png','Parent',app.UIAxes);
In app designer, the default axis name is app.UIAxes.
Another helpful page is Display Graphics in App Designer.

카테고리

Help CenterFile Exchange에서 Vector Fields에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by