Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Surface Plot from equations

Status
Not open for further replies.

mustang82

Junior Member level 3
Junior Member level 3
Joined
Dec 2, 2005
Messages
27
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Third Rock from the sun
Activity points
1,556
Hello,

Can anyone of please tell me how 3d coordinates can be generated using a simple equation. I have a equation and through a couple of iterations I would like to create a surface plot in matlab.

Please suggest any books from the board which can help me.

Thank you
 

hi, Try the following code


//To create the 2D domain:
X=-5:0.1:5;
Y=-5:0.1:5;

[x,y]=meshgrid(x,y);

//The coordinates are ready, type the function
z=x.^2+y.^2;//Or Any function of X

// To plot it, See all the types and choose what suits you
figure;
subplot(2,1,1)
mesh(x,y,z);
title('Using the mesh command');

subplot(2,1,2);
surf(x,y,z);
title('Using the surf command');
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top