Prev: netCDF loop
Next: uitable
From: Paul on
Hi!

I have generated a 3D surface in Matlab, from x, y, z coordinates obtained experimentally. I am now interested in looking at profiles of this surface, so basically making a cut in the surface and looking at the 2D section.
I am not sure how to do this, can anyone help?

Thank you!
From: Walter Roberson on
Paul wrote:

> I have generated a 3D surface in Matlab, from x, y, z coordinates
> obtained experimentally. I am now interested in looking at profiles of
> this surface, so basically making a cut in the surface and looking at
> the 2D section. I am not sure how to do this, can anyone help?

Is the slice parallel to the z axis? Is it exactly at one of the
existing z values or could it be between existing z values?

Is the slice parallel to the x or y axis? And exactly at one of the
existing axis values?

If your slice is not parallel to an axis and exactly at one of the
existing axis values, then you will need to do some interpolation in
order to do the slice. Do you have a model of how the values should be
considered to vary? You need such a model in order to do interpolation
-- linear interpolation, quadratic, spline... ?
From: Paul on

> Is the slice parallel to the z axis? Is it exactly at one of the
> existing z values or could it be between existing z values?
>
> Is the slice parallel to the x or y axis? And exactly at one of the
> existing axis values?
>
> If your slice is not parallel to an axis and exactly at one of the
> existing axis values, then you will need to do some interpolation in
> order to do the slice. Do you have a model of how the values should be
> considered to vary? You need such a model in order to do interpolation
> -- linear interpolation, quadratic, spline... ?

The slice required is parallel to the z axis. I have taken some experimental measurements of a "flat" plate, and would like to see how flat it is along certain sections. So far I can see the entire flat plate, that I created with the "surf" function. I would therefore need a 2D view going from 2 given x,y coordinates. The plot would consist of the z values varying along the direction of the cut chosen.
From: Walter Roberson on
Paul wrote:
>
>> Is the slice parallel to the z axis? Is it exactly at one of the
>> existing z values or could it be between existing z values?
>>
>> Is the slice parallel to the x or y axis? And exactly at one of the
>> existing axis values?

> The slice required is parallel to the z axis. I have taken some
> experimental measurements of a "flat" plate, and would like to see how
> flat it is along certain sections. So far I can see the entire flat
> plate, that I created with the "surf" function. I would therefore need a
> 2D view going from 2 given x,y coordinates. The plot would consist of
> the z values varying along the direction of the cut chosen.

Are x and y at regular intervals? If so then you can easily calculate the
array indices using round((x-xmin)/xspacing) + 1 and likewise for y. Once you
have those indices, then YourArray(XIndex,YIndex,:) should give the z values
suitable for plot() .

The situation is, though, a bit different if your x and y coordinates are not
to be "snapped" to the nearest grid points ?
 | 
Pages: 1
Prev: netCDF loop
Next: uitable