2D plot of surface slice

```I have a surface created with TriScatteredInterp, exactly as in the example here:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/triscatteredinterpclass.html

Now i need a 2D line plot of the intersection of a vertical plane with this surface.  This should be a very common problem, just the depth/elevation profile of a surface along a line, but I cannot find an example.
```
 0
Noel
11/19/2009 7:20:22 PM
comp.soft-sys.matlab 208554 articles. 8 followers. lunamoonmoon (258) is leader.

2 Replies
1168 Views

Similar Articles

[PageSpeed] 9
```"Noel Black" <tex.noel@gmail.com> wrote in message
news:he45pm\$1qv\$1@fred.mathworks.com...
>I have a surface created with TriScatteredInterp, exactly as in the example
>here:
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/triscatteredinterpclass.html
>
> Now i need a 2D line plot of the intersection of a vertical plane with
> this surface.  This should be a very common problem, just the
> depth/elevation profile of a surface along a line, but I cannot find an
> example.

Hi Noel,

When viewed from the Z direction your slice plane is line in the X-Y plane.
You just need to create a poly-line in the X-Y plane, compute the
corresponding values on the surface and plot them.
Here's an example that refers to the same data set;
Let's take a line that goes from (-2,-2) to (2,2) in the X-Y plane
The poly-line is as follows;
xl = (-2:0.25:2)';
yl = (-2:0.25:2)';

% Now evaluate the elevation on the surface
zl = F(xl,yl);

% Next plot the line on the surface
% Due it sampling inaccuracies the line will weave above and below the
surface facets.
% I will lift it up a tad to make the plot look pretty

mesh(qx,qy,qz);
zl_lifted = zl + max(zl)*0.05;
hold on;
plot3(xl,yl,zl_lifted, '-k', 'LineWidth',1.4)
hold off

How's that?

Damian

```
 0
Damian
11/20/2009 4:22:01 PM
```"Noel Black" <tex.noel@gmail.com> wrote in message <he45pm\$1qv\$1@fred.mathworks.com>...
> I have a surface created with TriScatteredInterp, exactly as in the example here:
> http://www.mathworks.com/access/helpdesk/help/techdoc/ref/triscatteredinterpclass.html
>
> Now i need a 2D line plot of the intersection of a vertical plane with this surface.  This should be a very common problem, just the depth/elevation profile of a surface along a line, but I cannot find an example.

give a look at this:

http://www.mathworks.com/matlabcentral/fileexchange/10408-contours-for-triangular-grids

```
 0
Luigi
12/8/2009 12:24:02 PM
Similar artilces about - 2D plot of surface slice:

I have data files that are: 34 columns a heck of a lot of rows! I need to read in the data (skipping the first 14 lines of header) to an array. I do have a way to do this, but I have found that it slows down on my large files. What I've done and it works, is: temp = textread(filename, '%f', 'headerlines', numOfHeaderLines) -- for i = 1:(size(temp)/34) for j = 1:34 dat(i,j) = temp(34*(i-1)+j); end end -- This reads in all the data to a 1D array of an enourmous length and then converts it to the 34 column 2D array....

Writing 2D content to a Canvas3D
What is the best way to write static 2D data to a Canvas3D? For example, if I wanted to draw a title centered at the top of my screen (which would be positioned relative to the dimensions of it's AWT container rather than scene geometry), what would be the best way to do this? Reading through the docs has left me confused as to the best way to do this. Mark McKay -- http://www.kitfox.com ...

Mathematica 6: How to plot multiple lists with error bars?
I want to plot multiple series of data points in Mathematica 6. Each data point has an error bar. ErrorListPlot plots only a single list. Is there a way to plot multiple lists with error bars? Thanks. Kezhao Hi Kezhao, ErrrorListPlot can deal with multiple datasets.E.g.: d1=Table[{i,RandomReal[]},{i,0,20}]; d2=Table[{.5i,RandomReal[]},{i,0,20}]; ErrorListPlot[{d1,d2}] hope this helps, Daniel Kezhao Zhang wrote: > I want to plot multiple series of data points in Mathematica 6. Each > data point has an error bar. ErrorListPlot plots only a single...

Plotting y(i)-y(i-1) vs x(i)
Hi all. I have a data file with 2 columns for X and Y values. I want to plot delta = Y vs X, i.e. at each point I'll have y(i)-y(i-1) for the current y value an= d x(i) for the x value. I think this is related to the running average exam= ple, but I couldn't figure it out on my own.=20 I should add that sure, I can preprocess my data file and calculate the nee= ded values, but I'm looking for a gnuplot-only solution.=20 Any help is appreciated, Cheers, Victor. On 20.07.2011 01:27, Victor wrote: > I have a data file with 2 columns for X and Y values. I want > to p...

=?ISO-8859-1?Q?Managerial_Accounting=3A_Decision_Making_and_Motivatin?= =?ISO-8859-1?Q?g_Performance_Plus_NEW_MyAccountingLab_with_Pearson_eText_=2D=2D?= =?ISO-8859-1?Q?_Access_Card_Package=2C_1=2FE=2
! ! ! TEST BANKS, SOLUTION MANUALS, INSTRUCTOR MANUALS, CASE SOLUTIONS, POW= ER POINT SLIDES ! ! ! Hello Everybody, To get the Solution manuals and Test banks just email me with your book det= ails. My e-mail address is: testbankandsm@xxxxxxxxx, testbankandsm(at)gmail(dot)c= om. Please replace (at) by @ and (dot) by .=20 If you need Test banks and Solution manuals, email to me.=20 http://testbankandsm.blogspot.in/ Reply time: Within 6 hours, If online, immediately!!!! Delivery time: Within 12- 24 hours. If online, immediately after payment ve= rification!!!!!!!!! Having...

How to pass 2D array to sub function and return 2D array?
Hi all, I want to pass 2D array to sub function and return 2D array. //-------------------------- For example, use strict; use warnings; my @array=([1,2,3],[4,5,6],[7,8,9]); my \$array_ref = \@array; \$array_r = increase_array_element(\$array_ref); sub increase_array_element { //recover the 2D array my @array_tmp = @{\$array_ref}; print \$array_tmp[2][2]; return \@array_tmp; } //------------------------- But it seems the compile did not think @array_tmp is a 2D array? Thanks! Davy "Davy" <zhushenli@gmail.com> wrote in message news:1154593889.794457.16810@m79...

combine plots
I have to plots P1 and P2 generated form 2 matrices [2x36000]. How can I generate 3rd plot or data matrix with the sum of y values from P1 and P2 in different ratios? ...

Re: Plotting x and y arrays
On 10/26/07 at 5:20 AM, johnlee_15@hotmail.com (John Lee) wrote: >I have a table of x values and a separate table of corresponding y >values. Is there a way to plot these values directly without using >MapThread and without creating a new table to store the x and y >values? ListPlot[Transpose@{x,y}] -- To reply via email subtract one hundred and four ...

Iteration in 2D
Hello, I am now setting up a 2D array (3X200) and want to do a finite differencing. I know how to iterate in 1D but the array that I have now looks like this. [Ai,j Ai,j+1 Ai,j+2 Ai+1,j Ai+1,j+1 Ai+1,j+2 ------------------------------------ ------------------------------------ ----------------------------------- Ai+200,j Ai+200,j+1 Ai+200,j+2] How do I iterate in 2D so that the finite differencing can be done using a while statement? Thanks, Mahesh You can iterate in N dimensions as the same way as you iterate in 1D. For example: array=FIN...

Lattice types in 2d ising model
Hi Some time ago now I wrote a simple program in C++ to simulate the 2d ising model on a square lattice which could calculate various quantities such as specific heat capacity and so on. I started thinking about this code again recently and thought that I might like to extend it a little. For example I was considering altering the lattice from the square one that everyone seems to do to a triangular one. I am sure that this has been done before and I was wondering if anyone out there knows if I would see any different physics - such as will the transition temperature change and so on. The...

Joining 2d points
Hi, I have set of 2D points Pi(x,y), i=1.....n. I want to join all of them, so that total distance between them is going to be minimal. erazem Erazem Polutnik wrote: > Hi, > I have set of 2D points Pi(x,y), i=1.....n. I want to join all of them, so > that total distance between them is going to be minimal. "Travelling salesman problem". Google. Cheers, Nicholas Sherlock Sounds more like a minimum spanning tree problem... Arash Partow __________________________________________________ Be one who knows what they don't know, Instead of being one who knows not w...

plotting precipitation distribution over US
Hi, I am new to MATLAB mapping tool. I have latitude-longitude information and corresponding precipitation data for each station. I need to produce US map and superimpose precipitation distribution corresponding to at each latitude and longitude. Let me know how to do so. Thanks, ...

2D
Does anyone here think that Civ3, riding on the back of a franchise, and Commandos III, are the last hand-drawn, 2D games that were deemed worthy of implementation? I hope not. A third dimension can be merry hell to program and quite humiliating if it plays no special role in your game. I'd like to implement a game that looks like a cross between Age of Empires and The Sims, and, professional though the tech demo looks, I really don't see anything with a similar 2D look to it on the market. Any thoughts? Do you think anyone would look at Age of Empires now and instantl...

Linotype slice-of-life
A feature story in, of all places, the Centerville Daily Iowegian of Centerville, Iowa has a nice photograph of the Linotype machine once used at the newspaper. The story, which is about a Linotype operator from Chicago who moved to southern Iowa to retire is at: <http://www.dailyiowegian.com/homepage/ local_story_356101353.html?keyword=leadpicturestory> A better version of the photo is: <http://www.dailyiowegian.com/homepage/ images_sizedimage_356101426/resources_photoview> (Apologies for the line breaks; my newsreader doesn't permit long lines to be posted.) I recall that...

Looking for how to model 3D objects in 2D relational databases
Hi - I am looking for sources of any kind that have to do with modelling objects, specifically organic molecules and are 3D, in a 2D relational database. Can anyone suggest anything? Thanks, Doug C. Doug C wrote: > Hi - I am looking for sources of any kind that have to do with > modelling objects, specifically organic molecules and are 3D, in a 2D > relational database. Can anyone suggest anything? The first thing you need to observe is that relational databases are not 2D. A dimension is a measure independent of any other dimensions. The columns of a relational t...

Hi All, I'm scattering a huge data [4000 points], belong to 8 different classes. some classes are overlap. due to this large number of data, the legend is not suitable to me, (because i need to show these figure in small pages). is there any way to shade the areas of different classes with different colors or shadows instead. Thank you very much Mike ...

plot a matrix in 3D
hi, I am having a m x n matrix of 275 x 275. where m is the number of scanned frame and n is the actual data. I am scanning an object by a laser and detecting the edges and storing the radius component in the column of the matrix. The object I am scanning is somewhat like cylinder. but the radius keeps changing. so each frame has different values. I tried to plot matrix by cylinder function but the radius is overlooked by the largest one of all the frames. is there anyway i could plot the object in 3d with varying radius. ...

2D to 1D and back to 2D
Hello together, I have a picture in following format: "496*784 uint 16" This is nice to handle, but I want to have a single array with 388864 Elements, representing the data. Then, I�ll do some Operation to the array. After finnished operation I want to transform the 388864 Elements back to a 2D Array consisting 496*784 Elements. ??? How can this be done with Matlab functions ??? Thank you very much, Kevin Hi there, try 'reshape' and perform your calculation, then reshape back. e.g. a = reshape(x,newN,newM) Yang K.Ostheimer wrote: > > > Hello together, >...

US-AZ-Tucson: CAD-Surfacing, Pro/SURFACE, GD&T, ANSI Y14.5M, ASME standards; Per (45294257609)
US-AZ-Tucson: CAD-Surfacing, Pro/SURFACE, GD&T, ANSI Y14.5M, ASME standards; Per (45294257609) ============================================================================================== Position: CAD-Surfacing Reference: SMC01262 Location: Tucson AZ Duration: Perm Skills: 6 + years ProEngineering CAD tools especially Pro/SURFACE. Mechanical design principles, concepts practices and standards. GD&T in accordance with ANSI Y14.5M. Technical drafting, ASME drawing standards. Design and documen...

Power Spectrum 2D field
Is there someone who can help me to calculate and plot the power spectrum of a 2D field? I have already calculated the power spectral density (it's a 3D function) of the matrix through the FFt of the same matrix, you can use various techniques, for example using the periodogram, but now i need the power spectrum of the field so...? How can i do? (PS: for example in turbulence you give a 3D field and you can compute the power spectra, how? Therefore I am in the 2D input case) Is there someone who have already done any Mathematica routine? Thank you very much, Matteo. ...

plot with specified handle value
Hi, Is there any way to plot a point, line, etc. with a specific handle value ? Thx in advance, -horatiu- Horatiu V. Corbeanu wrote: > > > Hi, > > Is there any way to plot a point, line, etc. with a specific handle > value ? > > Thx in advance, > -horatiu- > > > No there isn't. Whenever MATLAB creates a graphics object, it assigns a unique handle to the object. Why would you want to specify one? --- Tim Farajian tfarajia@mathworks.com Well, I asked the question earlier on the net and I didn't receive an answer, so I found some wor...

How to smooth contour data plot?
Are there any command to smooth the contour data I have x, y, and Z data where x is 1-by-20; y is 1-by-50; and z is 20-by-50. Thanks so much help interp2 "peter" <peter@xyz.com> wrote in message news:ef36efc.-1@webx.raydaftYaTP... > Are there any command to smooth the contour data > I have x, y, and Z data where x is 1-by-20; y is 1-by-50; and z is > 20-by-50. > > Thanks so much In article <ef36efc.-1@webx.raydaftYaTP>, peter <peter@xyz.com> wrote: > Are there any command to smooth the contour data > I have x, y, and Z data where x is 1-b...

Paste 2D array into excel via activex
I've managed to select a range of cells in my workbook and I want to paste an array into those cells. Select(Range(ActSheet,'A1:C100')); I then tried to use ActCell = get(Spreadsheet1,'ActiveCell'); set(ActCell,'Value',data); but it didn't work. I assumed the active cell property would cover the whole range selected, but it doesn't appear so. If I try ActRange = get(Spreadsheet1,'Range'); I recieve an error: ??? Invoke Error: Incorrect number of arguments Error in ==> torquecurveinput8>labelupdate at 264 ActRange ...

Plotting matrixes
I have a matrix of four columns of data. The first one is time and the others are data. I want to plot the last three columns against the first one. How do I do this? plot(M(:, 1), M(:, 2:end)) Litvinov Sergey wrote: > > > plot(M(:, 1), M(:, 2:end)) > > Thank you very much. ...