필터 지우기
필터 지우기

Need help on plotting the graph

조회 수: 1 (최근 30일)
reez all
reez all 2012년 5월 7일
i need help on plotting the dot on the graph, although this will not affect my result but i really need it on my graph..
clearall;clc
sizeA=[20 20];
x1=1:sizeA(1);
for j=1:sizeA(2)
X(j,:)=x1;
Y(:,j)=x1';
end
plot(X,Y,'r*')
The problem in here is, this code only can be used if the dimension is same, but i required different dimension which is zeros(20,30). Thank you for your help.
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 5월 7일
You need to describe the behavior you want when the arrays are not symmetric.

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

채택된 답변

Walter Roberson
Walter Roberson 2012년 5월 7일
Guessing what you are trying to do here:
[X, Y] = ndgrid(1:sizeA(1), 1:sizeA(2));
plot(X, Y, 'r*');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by