how I can plot 3 independent variables in matlab (4 dimensions)?

4 visualizzazioni (ultimi 30 giorni)
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)?!

Risposta accettata

KSSV
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.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by