From: shahnaz fatima on 23 Jun 2010 13:08 hai all there i have one variable say 'a' which has 10 rows and 2 columns. i.e, there are 10 instances of 2 dimentional. similarly i have anothor two variables, 'b' and 'c'. all are having 10 instances, in two dimensions. or simply , a=rand(10,2); b=rand(10,2); c=rand(10,2). i want to plot these a, b and c on scatter plot diagram each with different symbols or colours. but i am not getting that. anybody can explain. can anybody help me on this.please waiting for the reply.
From: Walter Roberson on 23 Jun 2010 14:01 shahnaz fatima wrote: > hai all there > > i have one variable say 'a' which has 10 rows and 2 columns. i.e, there > are 10 instances of 2 dimentional. > > similarly i have anothor two variables, 'b' and 'c'. all are having 10 > instances, in two dimensions. > or simply , a=rand(10,2); b=rand(10,2); c=rand(10,2). > > i want to plot these a, b and c on scatter plot diagram each with > different symbols or colours. > > but i am not getting that. anybody can explain. > > can anybody help me on this.please scatter(a, 1, 'r'); hold on scatter(b, 1, 'g'); scatter(c, 1, 'b');
From: shahnaz fatima on 24 Jun 2010 06:05 thanks for the reply. i tried to give these commands. but i am getting error. can you please solv emy problem. a=rand(10,2); >> b=rand(10,2); >> c=rand(10,2); >> scatter(a, 1, 'r'); ??? Error using ==> scatter at 62 X and Y must be vectors of the same length.
From: sscnekro on 24 Jun 2010 06:35 > a=rand(10,2); > >> b=rand(10,2); > >> c=rand(10,2); > >> scatter(a, 1, 'r'); > ??? Error using ==> scatter at 62 > X and Y must be vectors of the same length. At a very quick reading, scatter takes two inputs to plot of the same length. You specified a of length 10 (which by the way has two columns) and 1, which is a 1 x 1 scalar. Refer to columns in your variables, e.g. scatter(a(:,1), b(:,2), 'r')
From: sscnekro on 24 Jun 2010 06:50 > At a very quick reading, scatter takes two inputs to plot of the same length. You specified a of length 10 (which by the way has two columns) and 1, which is a 1 x 1 scalar. Refer to columns in your variables, e.g. > scatter(a(:,1), b(:,2), 'r') Ah, I see now, only after reading your first post, where did you take that command from. Walter focused on your main point, using different symbols or colours. Things are explained e.g. here http://www.mathworks.com/access/helpdesk/help/techdoc/ref/linespec.html and there was a post a time ago where it was Walter I think to explain how to create a cell with strings or so representing symbols or colors so that you can use them in a loop.
|
Next
|
Last
Pages: 1 2 3 Prev: The Compatibility of struct() with VHDL Next: Problem with fzero and maxiter option |