how to write the expression properly to plot use mesh

1 visualización (últimos 30 días)
xueqi
xueqi el 30 de Oct. de 2013
Comentada: xueqi el 30 de Oct. de 2013
Dear Fellows,
I am trying to plot a 3d figure. I don't quite understand how to write the expression for the function in this case properly. It seems the normal mulitiplication sign * needs to be changed to .*, but it also failed. Here is my code.
if true
% p=[1/3;1/3;1/3];
dd=[ 0.1000 -0.5000 0.6000
-0.6000 0.2000 0.5000];
mu=dd*p;
r=0.02;
coef=[1 -1 0;1 0 -1;0 1 -1];
[C1,C2] = meshgrid(0:0.1:100,0:0.1:100);
U=-[C1,C2]*mu+r*max(abs([C1,C2]*dd*coef));
mesh(C1,C2,U)
ezcontour(u,[0,100,0,100]);
end
  2 comentarios
Walter Roberson
Walter Roberson el 30 de Oct. de 2013
When you write that
mu = dd*p
then what do you want to have happen there? Multiply each dd by each p? Do a matrix multiplication? Something else?
xueqi
xueqi el 30 de Oct. de 2013
Just maatrix multipilcation. dd is a 2*3 matrix and p is 3*1 so mu should be 2*1.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Surface and Mesh Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by