Filter löschen
Filter löschen

3D PLOT please help

8 Ansichten (letzte 30 Tage)
francis am 6 Jul. 2013
Verschoben: DGM am 29 Dez. 2023
xlabel('Molecules Speed(m/s)'); ylabel('Temperature(K)'); zlabel('Probability');
this is the problem: Make a 3d plot of P(v)as a function of v and T for 0<v<1000 and 70<T<320
Molecules of gas in a container are moving at different speeds. Maxwell speed distribution law gives a probability P(v)
P(v)=4pi(M/(2piRT))^(3/2) * v^2 *e^((-Mv^2)/(2RT))
R= 8.31
this is the error I get
??? Error using ==> times
Matrix dimensions must agree.
Thanks for the feedback and help

Akzeptierte Antwort

the cyclist
the cyclist am 6 Jul. 2013
To plot over a range of (x,y), you need the complete grid of coordinates. You can use the command meshgrid() to do this:
[xx,yy] = meshgrid(x,y);
Calculate z from xx and yy instead of x and y.
You probably want to decrease the granularity of your grid, otherwise you have way too many points to plot. It looked pretty good when I did
  1 Kommentar
francis am 6 Jul. 2013
Verschoben: DGM am 29 Dez. 2023
thanks I get it now

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)


Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by