how I can plot 3 independent variables in matlab (4 dimensions)?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Mohammed Ahmed Alqaissi
il 25 Mag 2020
Commentato: M Naeem
il 23 Lug 2021
Hi all,
How I can draw the folloiwng function on matlab?
f = (exp(x) + y).^2 + 3*(1-z).^2
where 0<=x<=1
0<=y<=2
2<=z<=3
I spent the last few days trying all functions I could find and nothing worked (plot, plot3, surf, isosurf, sliceomatic)?!
0 Commenti
Risposta accettata
KSSV
il 25 Mag 2020
m = 10 ; n = 10 ; p =10 ;
x = linspace(0,1,m);
y = linspace(0,2,n) ;
z = linspace(2,3,p) ;
[X,Y,Z] = meshgrid(x,y,z) ;
f = (exp(X)+Y).^2+3*(1-Z).^2 ;
figure
hold on
for i = 1:p
surf(X(:,:,i),Y(:,:,i),Z(:,:,i),f(:,:,i))
end
Read about slice.
3 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Annotations 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!