how to draw surface
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
how do I write the program that draws the two-dimensional integral surface of the function in Matlab ?
0 Commenti
Risposta accettata
Ameer Hamza
il 8 Mag 2020
Modificato: Ameer Hamza
il 8 Mag 2020
You can draw it using meshgrid and surf
[X, Y] = meshgrid(linspace(-3,3));
Z = exp(-X.^2-Y.^2);
surf(X,Y,Z)
shading interp
9 Commenti
Ameer Hamza
il 8 Mag 2020
FYI, this is a faster version of the previous code in the comment
syms x y X Y
fun = matlabFunction(int(int(z,x,0,X),y,0,Y), 'Var', {X, Y});
[Xg, Yg] = meshgrid(linspace(0,2));
Z = arrayfun(fun, Xg, Yg);
surf(Xg,Yg,Z)
shading interp
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Surface and Mesh Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!