Plot 3D Eqns in MATLAB: 5x^2 - 2y^2 + 4x+ 4y -4 +2xy etc

  • Context: MATLAB 
  • Thread starter Thread starter cpeng
  • Start date Start date
  • Tags Tags
    3d Matlab Plot
Click For Summary

Discussion Overview

The discussion revolves around plotting multiple 3D equations in MATLAB, specifically focusing on surface plots and the use of various plotting functions. Participants share their attempts and seek assistance in achieving satisfactory visualizations of the equations provided.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant expresses a desire to plot three specific equations in 3D but is unsatisfied with their initial attempts using the plot3 function.
  • Another participant assumes the intention is to create a surface plot and provides an example using the "surf" command with a different equation.
  • A participant mentions that the three equations represent coordinates for a 3D plot and shares a successful attempt using the ezsurf function to combine the plots.
  • One participant seeks help with plotting three vectors in 3D, indicating they have struggled with the process.
  • Several participants suggest using the surf function with specified x and y values to plot the equations, reiterating the need for defined ranges.
  • Another participant suggests using the plot3 function for visualizing the three vectors, providing a basic example of its usage.

Areas of Agreement / Disagreement

There is no consensus on the best method for plotting the equations, as participants propose different approaches and tools within MATLAB. Multiple competing views remain regarding the most effective way to visualize the data.

Contextual Notes

Participants have not fully clarified the specific requirements for the plots, such as the desired appearance or the range of x and y values for the equations. There are also unresolved details regarding the dimensions and compatibility of the vectors mentioned.

Who May Find This Useful

Individuals interested in MATLAB plotting techniques, particularly those working with 3D surface plots or vector visualizations in mathematical or engineering contexts.

cpeng
Messages
2
Reaction score
0
i want to plot these equations in 3d

Eq 1= 5x^2 - 2y^2 + 4x+ 4y -4 +2xy
Eq 2 =x^2 +3x +2y +xy +5
eq 3 = -7x2 +3x -6y +5xy +2

i tried plot3 with 3 matix of x,y,z but i am not satisfied with the result.
please if anyone know how to plot these equations.let me know
thanks in advance
 
Physics news on Phys.org
What kind of plot are you trying to make? I'm going to assume a surface plot since you didn't specify. Here is an example using the "surf" command.

x = 1:1:100;
y = 1:1:100;
[X,Y] = meshgrid(x,y);
Z = X.^2.*Y.^3;
surf(X,Y,Z)
 
wel these 3 equations will represent 3 coordianted of plot(x,y,z)
combine plot of these equation. i have tried
ezsurf('-5*x.^2 - 2*y.^2 + 2*(x.*y) + 4*y + 4*x -4' ,'x.^2 +3*x +2*y +x*y +5 ','-7*x.^2 +3*x -6*y +5*(x.*y) +2 ');
thats work
 
Hi, I have 3 vectors of the same dimensions and want to plot a graph in 3D as surface or volume. I tried but I couldn't. Any body knows?
Vectors arr:
A=[2 5 15 25 30]
B=[0.1 0.2 0.5 0.9 1.0]
C=[1870 1890 1920 2000 2050]

thanks,
PK
 
cpeng said:
i want to plot these equations in 3d

Eq 1= 5x^2 - 2y^2 + 4x+ 4y -4 +2xy
Eq 2 =x^2 +3x +2y +xy +5
eq 3 = -7x2 +3x -6y +5xy +2

i tried plot3 with 3 matix of x,y,z but i am not satisfied with the result.
please if anyone know how to plot these equations.let me know
thanks in advance


for this one u can use this,

also mention the x and y values, ie starting and ending as x=1:10; y=1:10;

surf(x,y,Eq 1);
surf(x,y,Eq 2);
surf(x,y,Eq 3);
 
pashasrp67 said:
for this one u can use this,

also mention the x and y values, ie starting and ending as x=1:10; y=1:10;
figure;
surf(x,y,Eq 1);
surf(x,y,Eq 2);
surf(x,y,Eq 3);
hold on

so u can try with this
 
pkmalik said:
Hi, I have 3 vectors of the same dimensions and want to plot a graph in 3D as surface or volume. I tried but I couldn't. Any body knows?
Vectors arr:
A=[2 5 15 25 30]
B=[0.1 0.2 0.5 0.9 1.0]
C=[1870 1890 1920 2000 2050]

thanks,
PK

u can use plot3 function

as

plot3(A,B,C);
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
4
Views
15K
  • · Replies 16 ·
Replies
16
Views
3K
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 6 ·
Replies
6
Views
27K
  • · Replies 9 ·
Replies
9
Views
9K