Matlab - graphing multivariable functions

Click For Summary

Discussion Overview

The discussion revolves around graphing multivariable functions in Matlab, specifically focusing on how to plot two different planes side by side for comparison. Participants are seeking assistance with coding in Matlab to achieve this visualization.

Discussion Character

  • Homework-related
  • Technical explanation

Main Points Raised

  • One participant expresses difficulty in graphing two planes simultaneously in Matlab and requests specific code to do so.
  • Another participant suggests using the "subplot" function to plot multiple graphs in the same figure.
  • A different participant provides a code snippet for plotting two sine and cosine functions side by side as an example.
  • Another suggestion includes using "ezplot" or "plot3d" for graphing the specified planes, with a note on the range for x and y values.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method to graph the planes, as some suggest different functions and approaches without resolving which is the most effective.

Contextual Notes

There is uncertainty regarding the participant's familiarity with Matlab functions, and the effectiveness of the suggested methods remains unverified.

Who May Find This Useful

Students or individuals learning Matlab who are interested in graphing multivariable functions and visualizing mathematical concepts.

JoshHolloway
Messages
221
Reaction score
0
I am taking a vector calculus course and am having trouble figuring out how to graph things in Matlab to verify my answers.

Here is exactly what I want to do:
I want to graph side by side two different graphs simultaneously, so I can compare them.

I will give you the equations of the two planes I am attempting to graph side by side. If someone could write the code for me to graph these side by side, then I am sure I can play around with the code and figure out how to graph other functions.

I want to graph side by side the planes:
Z = (-1/4)x + y - 19
and
Z = (-1/3)x + (2/3)y - 4

Thanks in advance!
 
Last edited:
Physics news on Phys.org
Anyone?
 
Type "help subplot". This tells you how to plot multiple graphs in the same figure for convenient pictures
 
I have tried that, but I still don't understand how to do it.

If someone could write the code to do what I am trying to do for those two equations I gave, then I would be EXTREMELY grateful.
 
Is this enough? It will show you how to plot two vectors next to each other.

Code:
t = 0:0.01:10;
f1 = sin(t);
f2 = cos(t);subplot(1,2,1);
plot(f1);

subplot(1,2,2);
plot(f2);
 
Awesome! Thanks!
 
Try explot also.

ezplot((-1/4)x + y - 19) I think that should work. If not try
plot3d((-1/4)x + y - 19),x,-10,10,y,-10,10) x and y ranges are -10 to 10
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 12 ·
Replies
12
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K