April 6th, 2005, 01:03 PM
|
#1 (permalink)
| | Ultimate Member
Join Date: Sep 2003 Location: Philadelphia
Posts: 1,462
|
In matlab how would I create a surface or a countuour map form a matrix 3x1000 where each row is a point in 3d.
I have tried Code: plot3(matrix(1,:),matrix(2,:),matrix(3,:),.) But that just gives me a point type of graph.
How can I transform this structure into something that surf could use? |
| |
April 6th, 2005, 08:24 PM
|
#2 (permalink)
| | Ultimate Member
Join Date: Sep 2003 Location: Philadelphia
Posts: 1,462
| |
| |
April 6th, 2005, 08:50 PM
|
#3 (permalink)
| | Member
Join Date: Jun 2003 Location: Maine
Posts: 168
|
Have you tried using Where x,y,z are your matricies, and the c is your color? I haven't tested that because I don't have anything handy to make a surface... but that's just a quick thought.
On second thought, have you tried taking your one mega-matrix and seperating into the x,y,z components, and then try to use surf? |
| |
April 7th, 2005, 08:17 AM
|
#4 (permalink)
| | Ultimate Member
Join Date: Sep 2003 Location: Philadelphia
Posts: 1,462
|
Tried splitting it into three vectors. Gives me an Code: ??? Error using ==> surface
Arguments that are not parameter/value pairs must be numeric. |
| |
April 7th, 2005, 05:14 PM
|
#5 (permalink)
| | Member
Join Date: Jun 2003 Location: Maine
Posts: 168
|
I don't know how helpful this will be, but this is sort of a simplified surface plotting exercise that I learned for z=x^2 Code: x=-1:.1:1; %x matrix
y=-1:.1:1; %y matrix
[xx,yy]=meshgrid(x,y);
zz=xx.ˆ2;
mesh(xx,yy,zz);
title(’The graph of z=xˆ2’)
xlabel(’x-axis’)
ylabel(’y-axis’)
zlabel(’z-axis’)
axis tight The error said you didn't have numeric values... what was your code to split them up? |
| |
April 7th, 2005, 10:40 PM
|
#6 (permalink)
| | Ultimate Member
Join Date: Sep 2003 Location: Philadelphia
Posts: 1,462
|
Found that one last night. Still doesnt help me much. If someone doesnt come forward with an brutal soution Ill have to code it in a script.
Problem is zz needs to be matrix (2d) and mine is vector (1d).
How do you select the first n elments of a vector ? Or elements from n to m? |
| |
April 7th, 2005, 10:43 PM
|
#7 (permalink)
| | Ultimate Member
Join Date: Sep 2003 Location: Philadelphia
Posts: 1,462
|
Ok so to get the n-th thru m- th element in a vector you do an More of a note to myself really
Last edited by elmers : April 7th, 2005 at 10:50 PM.
|
| |
May 8th, 2006, 12:01 AM
|
#8 (permalink)
| | Junior Member
Join Date: May 2006
Posts: 4
|
you can easily parameterize your equations
example like plot(x, f(x), g(x, f(x))
otherwise try kluid ( http://www.kluid.com ) its a very good matlab forum, hope you will find the answer of your problem there
b4 : ] Quote: |
Originally Posted by elmers Ok so to get the n-th thru m- th element in a vector you do an More of a note to myself really | |
| |
May 9th, 2006, 06:25 AM
|
#9 (permalink)
| | Ultimate Member
Join Date: Sep 2003 Location: Philadelphia
Posts: 1,462
|
A year later ?!??! Really????!??!!
__________________ Buy the ticket, take the ride. - Hunter S. Thompson |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |