Thread Subject: Plotting - Getting Error

Subject: Plotting - Getting Error

From: Rajeev Narayanan

Date: 20 Mar, 2010 19:28:02

Message: 1 of 5

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

Subject: Plotting - Getting Error

From: Walter Roberson

Date: 20 Mar, 2010 20:08:18

Message: 2 of 5

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.

Subject: Plotting - Getting Error

From: Rajeev Narayanan

Date: 20 Mar, 2010 20:23:02

Message: 3 of 5

Hello Walter,

Thanks for the reply. I used the command plot(P). Is there any way to plot?

Rajeev

Walter Roberson <roberson@hushmail.com> wrote in message <ho39vj$it9$1@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.

Subject: Plotting - Getting Error

From: us

Date: 20 Mar, 2010 21:01:06

Message: 4 of 5

"Rajeev Narayanan" <rite2rajeev@gmail.com> wrote in message <ho37k2$ga3$1@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

Subject: Plotting - Getting Error

From: Walter Roberson

Date: 20 Mar, 2010 22:38:14

Message: 5 of 5

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(:));

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
reference us 20 Mar, 2010 17:04:07
rssFeed for this Thread

Contact us at files@mathworks.com