Prev: remove multiple rows of matrix based the value and index of row of another matrix
Next: Printing the Command Windows
From: Rajeev Narayanan on 20 Mar 2010 15:28 Hi, I have created an array P=zeros(T,N,D), where T = 10, N = 100000 and D = 3. Now I am generating following values of P P= randn(T,N,D); If I need to plot with X-axis T, Y axis N and Z-axis D. How can I do it? I am getting the following error "Data may not have more than 2 dimensions" Somebody help. Thanks, Rajeev
From: Walter Roberson on 20 Mar 2010 16:08 Rajeev Narayanan wrote: > I have created an array P=zeros(T,N,D), where T = 10, N = 100000 and D = > 3. Now I am generating following values of P > > P= randn(T,N,D); > > If I need to plot with X-axis T, Y axis N and Z-axis D. How can I do it? > I am getting the following error > > "Data may not have more than 2 dimensions" Please show us the command you are trying to use to plot with, and any commands leading up to it that derive the appropriate data from P. Keep in mind that if you try to plot P, then you are trying to do a four dimensional plot -- T, N, D, and value.
From: Rajeev Narayanan on 20 Mar 2010 16:23 Hello Walter, Thanks for the reply. I used the command plot(P). Is there any way to plot? Rajeev Walter Roberson <roberson(a)hushmail.com> wrote in message <ho39vj$it9$1(a)canopus.cc.umanitoba.ca>... > Rajeev Narayanan wrote: > > > I have created an array P=zeros(T,N,D), where T = 10, N = 100000 and D = > > 3. Now I am generating following values of P > > > > P= randn(T,N,D); > > > > If I need to plot with X-axis T, Y axis N and Z-axis D. How can I do it? > > I am getting the following error > > > > "Data may not have more than 2 dimensions" > > Please show us the command you are trying to use to plot with, and any > commands leading up to it that derive the appropriate data from P. > > Keep in mind that if you try to plot P, then you are trying to do a four > dimensional plot -- T, N, D, and value.
From: us on 20 Mar 2010 17:01 "Rajeev Narayanan" <rite2rajeev(a)gmail.com> wrote in message <ho37k2$ga3$1(a)fred.mathworks.com>... > Hi, > > I have created an array P=zeros(T,N,D), where T = 10, N = 100000 and D = 3. Now I am generating following values of P > > P= randn(T,N,D); > > If I need to plot with X-axis T, Y axis N and Z-axis D. How can I do it? I am getting the following error > > "Data may not have more than 2 dimensions" > > Somebody help. > > Thanks, > Rajeev a hint: help plot3; us
From: Walter Roberson on 20 Mar 2010 18:38
Rajeev Narayanan wrote: > Thanks for the reply. I used the command plot(P). Is there any way to plot? How do you want your plot of P to look? I'm not sure I've understood your original question, but it appears that at position (x,y,z) you want to plot a point with value P(x,y,z), where P(x,y,z) could range from -infinity to +infinity (but is most likely fairly close to 0.) However, there is no fourth direction that we could use to move up in down in according to the value of P(x,y,z): the closest we can get to that is to convert P(x,y,z) into a color value. If that is what you want to do, then probably you want something like: MarkerSize = 1; [X, Y, Z] = ndgrid(1:T, 1:N, 1:D ); scatter3(X(:), Y(:), Z(:), MarkerSize, Z(:)); |