Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
calculating z value for mesh plot

Subject: calculating z value for mesh plot

From: edward

Date: 28 Jun, 2011 20:09:02

Message: 1 of 5

I have 60s load data for 24-hrs (x-coord) and associated value for each time stamp (y-coord)...I can get things to plot well in a standard 2D plot(x,y) but want to plot in 3D w/ a mesh...I am new to matlab and have searched and tested sample code from the web but can't seem to get the correct z value...can anybody give me a hand
...your reading from a real novice so beware of dumb questions

Subject: calculating z value for mesh plot

From: Roger Stafford

Date: 28 Jun, 2011 22:30:27

Message: 2 of 5

"edward" wrote in message <iudccu$qbe$1@newscl01ah.mathworks.com>...
> I have 60s load data for 24-hrs (x-coord) and associated value for each time stamp (y-coord)...I can get things to plot well in a standard 2D plot(x,y) but want to plot in 3D w/ a mesh...I am new to matlab and have searched and tested sample code from the web but can't seem to get the correct z value...can anybody give me a hand
> ...your reading from a real novice so beware of dumb questions
- - - - - - - - - - - -
  I have read and reread your request and can find no third dimensional quantity involved in your data. It looks as though you have one quantity from the "60s load data for 24-hrs" which you called "x-coord" and a corresponding quantity "time stamp" called "y-coord". I see no third quantity which z could be set to. What is your idea of the contents of z?

  Also it looks as though each x-coord corresponds one-to-one with each y-coord and it would not make sense to make a mesh of them - that is, it would seem highly irrelevant to be pairing the load data that was measured at, say, 8:39 A.M. with the time stamp that read 4:17 P.M.

  Your 2D plot would seem to exhibit all there is to tell about your problem. What more do you want to see?

Roger Stafford

Subject: calculating z value for mesh plot

From: edward

Date: 29 Jun, 2011 16:29:10

Message: 3 of 5

"Roger Stafford" wrote in message <iudkm3$j15$1@newscl01ah.mathworks.com>...
> "edward" wrote in message <iudccu$qbe$1@newscl01ah.mathworks.com>...
> > I have 60s load data for 24-hrs (x-coord) and associated value for each time stamp (y-coord)...I can get things to plot well in a standard 2D plot(x,y) but want to plot in 3D w/ a mesh...I am new to matlab and have searched and tested sample code from the web but can't seem to get the correct z value...can anybody give me a hand
> > ...your reading from a real novice so beware of dumb questions
> - - - - - - - - - - - -
> I have read and reread your request and can find no third dimensional quantity involved in your data. It looks as though you have one quantity from the "60s load data for 24-hrs" which you called "x-coord" and a corresponding quantity "time stamp" called "y-coord". I see no third quantity which z could be set to. What is your idea of the contents of z?
>
> Also it looks as though each x-coord corresponds one-to-one with each y-coord and it would not make sense to make a mesh of them - that is, it would seem highly irrelevant to be pairing the load data that was measured at, say, 8:39 A.M. with the time stamp that read 4:17 P.M.
>
> Your 2D plot would seem to exhibit all there is to tell about your problem. What more do you want to see?
>
> Roger Stafford

roger,
thanks, you are correct a simple x/y plot tells the fundamental message...what i want to do is to represent the data in a 3D world so undulations in loads can be viewed from the z direction...from what i am able to read from sifting through the web there is a method to generate a z value from the x/y and then to use the 'mesh' x/y with the z (z referring to the horizontal surface) to generate a 3Dplot...what follows is a description of what i've gotten from the web...what i don't know is how to computatinally plug in the appropriate formula of x and y to generate a z (if that is possible?)
mesh(z) creates a surface in xyz space where z is a matrix
               of the values of the function z(x,y). z can be
               interpreted to be the height of the surface above
               some xy reference plane.

Subject: calculating z value for mesh plot

From: Roger Stafford

Date: 29 Jun, 2011 17:40:26

Message: 4 of 5

"edward" wrote in message <iufjsm$2qb$1@newscl01ah.mathworks.com>...
> thanks, you are correct a simple x/y plot tells the fundamental message...what i want to do is to represent the data in a 3D world so undulations in loads can be viewed from the z direction...from what i am able to read from sifting through the web there is a method to generate a z value from the x/y and then to use the 'mesh' x/y with the z (z referring to the horizontal surface) to generate a 3Dplot...what follows is a description of what i've gotten from the web...what i don't know is how to computatinally plug in the appropriate formula of x and y to generate a z (if that is possible?)
> mesh(z) creates a surface in xyz space where z is a matrix
> of the values of the function z(x,y). z can be
> interpreted to be the height of the surface above
> some xy reference plane.
- - - - - - - - - -
  I repeat my question. What physical or conceptual numerical quantity can you associate with an x-coord of "load data" which was measured at 8:39 A.M. with a y-coord with a time stamp of 4:17 P.M.? Moreover, how can this be extended to all possible (60*24)^2 = 1440^2 = 2,073,600 such combinations of the x-ccord and y-coord values? If you can think of any such entity which is capable of computation, then that could be your z(x,y) and it would make sense to create a three-dimensional plot of it.

  I cannot tell you how to calculate such a function z(x,y) that (so far) I do not understand. You talked about "undulations in loads". What do you mean by that? Is there anything in that which would involve a relationship between two arbitrary points in time within your 24 hour period?

  Until you can give a straightforward answer to the above questions, there is no way you or anyone else can produce such a z(x,y) meaningfully out of thin air.

Roger Stafford

Subject: calculating z value for mesh plot

From: edward

Date: 2 Aug, 2011 16:04:08

Message: 5 of 5

"Roger Stafford" wrote in message <iudkm3$j15$1@newscl01ah.mathworks.com>...
> "edward" wrote in message <iudccu$qbe$1@newscl01ah.mathworks.com>...
> > I have 60s load data for 24-hrs (x-coord) and associated value for each time stamp (y-coord)...I can get things to plot well in a standard 2D plot(x,y) but want to plot in 3D w/ a mesh...I am new to matlab and have searched and tested sample code from the web but can't seem to get the correct z value...can anybody give me a hand
> > ...your reading from a real novice so beware of dumb questions
> - - - - - - - - - - - -
> I have read and reread your request and can find no third dimensional quantity involved in your data. It looks as though you have one quantity from the "60s load data for 24-hrs" which you called "x-coord" and a corresponding quantity "time stamp" called "y-coord". I see no third quantity which z could be set to. What is your idea of the contents of z?
>
> Also it looks as though each x-coord corresponds one-to-one with each y-coord and it would not make sense to make a mesh of them - that is, it would seem highly irrelevant to be pairing the load data that was measured at, say, 8:39 A.M. with the time stamp that read 4:17 P.M.
>
> Your 2D plot would seem to exhibit all there is to tell about your problem. What more do you want to see?
>
> Roger Stafford

Tags for this Thread

No tags are associated with this thread.

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.

Contact us