Find minimum and maximum of a two variable function on fixed interval
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi every body I have this function below and I would calculated the minimum and maximum of this, and also ploting the min/max values.
How I can write their code?
[x,y]=meshgrid(0:0.1:pi,0:0.1:2*pi)
a=77.2; b=36.2; c=12.9;
E=100;
U=-E.^2*(a.*sin(x).^2.*cos(y).^2+b.*sin(x).^2.*sin(y).^2+c.*cos(x).^2);
Regards
0 comentarios
Respuestas (1)
jonas
el 7 de Ag. de 2018
Editada: jonas
el 7 de Ag. de 2018
Just take the max/min over the desired dimension. For example:
max(U,[],1) %max row-wise
max(U,[],2) %max column-wise
You can plot like this:
plot(x(1,:),max(U,[],1),...
x(1,:),min(U,[],1),...
y(:,1),max(U,[],2),...
y(:,1),min(U,[],2))
0 comentarios
Ver también
Categorías
Más información sobre HDL Verifier en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!