Error dimensiones de matriz
Publicado por Maria (6 intervenciones) el 22/07/2009 09:46:47
Hola,
Estoy calculando un función definida a trozos en Matlab, para poder representarla. Pero al
calcular la función me da un error:
"Error using ==> mtimes
Inner matrix dimensions must agree."
Os adjunto la función y los valores que he asignado para ver si alguine me puede ayudar.
x=0:0.01:500;
hl=8; hr=3;
uu=0;
hh=5;
alfa=0.1;
t=5;
l1=3;
l2=2;
%Función
h2=(hl+alfa*x-alfa*t*uu)*((x/t)<l1)+((1/2)*(hl+hr)+alfa*x-alfa*t*uu)*(((x/t)>l1)&((x/t)<l2))+(hr+alfa*x-alfa*t*uu)*((x/t)>l2);
plot(x,h2);
Gracias
Saludos
Estoy calculando un función definida a trozos en Matlab, para poder representarla. Pero al
calcular la función me da un error:
"Error using ==> mtimes
Inner matrix dimensions must agree."
Os adjunto la función y los valores que he asignado para ver si alguine me puede ayudar.
x=0:0.01:500;
hl=8; hr=3;
uu=0;
hh=5;
alfa=0.1;
t=5;
l1=3;
l2=2;
%Función
h2=(hl+alfa*x-alfa*t*uu)*((x/t)<l1)+((1/2)*(hl+hr)+alfa*x-alfa*t*uu)*(((x/t)>l1)&((x/t)<l2))+(hr+alfa*x-alfa*t*uu)*((x/t)>l2);
plot(x,h2);
Gracias
Saludos
Valora esta pregunta


0