Is there anyway to modify a matlab app component to fit my needs?

4 ビュー (過去 30 日間)
Paulo
Paulo 2024 年 5 月 22 日
コメント済み: Paulo 2024 年 5 月 22 日
I need a compass-like component for my application. The "Heading Indicator" component almost fits my needs but I would need to modify it. I would need a different icon that is not a plane and I would need said indicator to rotate instead of the coordinates.

回答 (1 件)

Venkat Siddarth Reddy
Venkat Siddarth Reddy 2024 年 5 月 22 日
編集済み: Venkat Siddarth Reddy 2024 年 5 月 22 日
Hi Paulo,
I don't think you can change the icon of the "heading indicator" since this is a component in Aerospace Toolbox for displaying measurements for "aircraft heading (in degrees)".
However, if you are looking for a compass with pointer as the icon, then I think you can checkout the compass feature of MATLAB:
u = [5 3 -4 -3 5];
v = [1 5 3 -2 -6];
compass(u,v)
compass(U,V) plots arrows originating from the point (0, 0). Specify the direction of arrows using the Cartesian coordinates U and V, with U indicating the x-coordinates and V indicating the y-coordinates.
To learn more about the compass function,please refer to the following documentation:
Hope it helps!
  1 件のコメント
Paulo
Paulo 2024 年 5 月 22 日
I already tried that solution but couldn't remove the degree labels in app designer.
theta=angle*pi/180;
r = 3; % magnitude (length) of arrow to plot
x = 4; y = 5;
u = r * cos(theta); % convert polar (theta,r) to cartesian
v = r * sin(theta);
c=compass(app.UIAxes,u,v,'g');
c.LineWidth=2;
set(findall(gcf,'String','120','-or','String','30','-or','String','60','-or','String','60','-or','String','150','-or','String','210','-or','String','240','-or','String','300','-or','String','330','-or','String',' 2','-or','String',' 3','-or','String',' 1'),'String',' ')
set(findall(gcf,'String','90'),'String','North')
set(findall(gcf,'String','180'),'String','West')
set(findall(gcf,'String','270'),'String','South')
set(findall(gcf,'String','0'),'String','East')

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

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by