Clear Filters
Clear Filters

Need help on plotting the graph

1 view (last 30 days)
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 Comment
Walter Roberson
Walter Roberson on 7 May 2012
You need to describe the behavior you want when the arrays are not symmetric.

Sign in to comment.

Accepted Answer

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

More Answers (0)

Categories

Find more on Graph and Network Algorithms in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!