필터 지우기
필터 지우기

Rectangle wave in MATLAB App Designer

조회 수: 3 (최근 30일)
Tejas Mahajan
Tejas Mahajan 2020년 11월 23일
댓글: Tejas Mahajan 2020년 11월 25일
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
Mario Malic
Mario Malic 2020년 11월 23일
See line and rectangle.
Tejas Mahajan
Tejas Mahajan 2020년 11월 23일
?

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

답변 (1개)

Ameer Hamza
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
Tejas Mahajan
Tejas Mahajan 2020년 11월 25일
This produces a Recatngle shape. i want graph of this type ->
Tejas Mahajan
Tejas Mahajan 2020년 11월 25일
t = app.EntertheSignalEditField.Value;
t1 = str2double(strsplit(t));
x = 1 :numel(t1);
thats how im going to take values for Y axis from user and print it
user will be giving values in this format - 1 2 3 4 (using space not comma)

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by