How to plot a surface in its parametric form ?

54 Ansichten (letzte 30 Tage)
Loris Chavée
Loris Chavée am 10 Feb. 2017
Beantwortet: José-Luis am 10 Feb. 2017
Hello,
I have à problem when I try to plot a surface that has this form for exemple:
0=<r=<infinite
0=<t=<2*pi
x=r*cos (t)
y=r*sin (t)
z=(r^3)/6
This is the surface il want to plot but the value in z bother me. Indeed I can't use meshgrid because of that.
What can I do?
Thanks for your help !

Akzeptierte Antwort

KSSV
KSSV am 10 Feb. 2017
clc; clear all ;
M = 100 ; N = 100 ;
rinf = 100 ; % take rinf how big you want
r = linspace(0,rinf,M) ;
t = linspace(0,2*pi,N) ;
[R T] = meshgrid(r,t) ;
X = R.*cos(T) ;
Y = R.*sin(T) ;
Z = R.^3/6 ;
surf(X,Y,Z) ;
  1 Kommentar
Loris Chavée
Loris Chavée am 10 Feb. 2017
So I'm supposed to use meshgrid With the two parameters of the surface ?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

José-Luis
José-Luis am 10 Feb. 2017
You don't need to use meshgrid() if you have the symbolic math toolbox.

Community Treasure Hunt

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

Start Hunting!

Translated by