Rectangle wave in MATLAB App Designer
1 回表示 (過去 30 日間)
古いコメントを表示
I'm using App designer for plotting rectangular graph for the points inputed by the user. For EX- if user give values for Yaxis as 1 , 2 ,4 , 5 and 2, 4, 1 , 3 for the Xaxis corresponding to the values of Yaxis. From this given data how can i plot rectangular graph for this given 4 points in MATLAB App Designer.
Please Help.
2 件のコメント
回答 (1 件)
Ameer Hamza
2020 年 11 月 23 日
First convert the given points in the correct order for drawing a polygon
x = [2, 4, 1, 3];
y = [1, 2, 4, 5];
pts = [x(:) y(:)];
idx = boundary(pts);
pts = pts(idx, :);
Then either use plot() or patch()
plot(pts(:,1), pts(:,2))
% or
patch(pts(:,1), pts(:,2), 'r')
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で Polygons についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!