home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 1703
Discussions: 188,402, Posts: 2,243,609, Members: 232,632
Old April 6th, 2005, 01:03 PM   Digg it!   #1 (permalink)
Ultimate Member
 
elmers's Avatar
 
Join Date: Sep 2003
Location: Philadelphia
Posts: 1,462
Matlab surface

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?

elmers is offline   Reply With Quote
Old April 6th, 2005, 08:24 PM     #2 (permalink)
Ultimate Member
 
elmers's Avatar
 
Join Date: Sep 2003
Location: Philadelphia
Posts: 1,462
Bump: Anyone???

elmers is offline   Reply With Quote
Old April 6th, 2005, 08:50 PM     #3 (permalink)
Member
 
Join Date: Jun 2003
Location: Maine
Posts: 168
Have you tried using

Code:
surface(x,y,z,c)
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?

Elburn is offline   Reply With Quote
Old April 7th, 2005, 08:17 AM     #4 (permalink)
Ultimate Member
 
elmers's Avatar
 
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.
elmers is offline   Reply With Quote
Old 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?
Elburn is offline   Reply With Quote
Old April 7th, 2005, 10:40 PM     #6 (permalink)
Ultimate Member
 
elmers's Avatar
 
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?
elmers is offline   Reply With Quote
Old April 7th, 2005, 10:43 PM     #7 (permalink)
Ultimate Member
 
elmers's Avatar
 
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

Code:
x = y(n:m)
More of a note to myself really

Last edited by elmers : April 7th, 2005 at 10:50 PM.
elmers is offline   Reply With Quote
Old 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

Code:
x = y(n:m)
More of a note to myself really
b4codes is offline   Reply With Quote
Old May 9th, 2006, 06:25 AM     #9 (permalink)
Ultimate Member
 
elmers's Avatar
 
Join Date: Sep 2003
Location: Philadelphia
Posts: 1,462
A year later ?!??! Really????!??!!
__________________
Buy the ticket, take the ride.
- Hunter S. Thompson
elmers is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems installing Matlab release 13 on windows xp home ERTW Technical Support 1 May 8th, 2006 12:04 AM
Matlab and GUIs jon112981 Webmastering and Programming 4 May 7th, 2006 11:57 PM
Surface Scan HD in XP bfcx Technical Support 5 August 18th, 2004 06:44 PM
Surface area! IC IMO Community 38 November 3rd, 2003 09:30 PM
Matlab engineering jon112981 Webmastering and Programming 2 May 21st, 2003 10:10 AM

Most Active Discussions
Is It Just Me? (2906)
3-days in and no threads about Gaza (161)
Misery Loves Company... (2144)
New Build ( Finally ) (7)
CPU wont boot (7)
Building a gaming computer advice (5)
I think I just killed my computer w.. (24)
RCA 52Inch HDTV wont turn on (5)
Folderchat Weekday thread (444)
Recent Discussions
Futronix has water features? (0)
Laptop proccesor to desktop mob.. (2)
Please help! multiple problems! (4)
RCA 52Inch HDTV wont turn on (5)
New Build ( Finally ) (7)
Common Spyware Solutions (97)
How do you move a hard-drive to.. (4)
What is the best external enclo.. (0)
Partition Magic 7.0 (Unallocate.. (17)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 04:39 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28