computing matrix in for loop

2 visualizaciones (últimos 30 días)
astronot
astronot el 29 de Nov. de 2020
Editada: VBBV el 29 de Nov. de 2020
hi friends ı want to calculate matrix of ZMN in for loop , it must have values like Z11,Z12,...Z55, but my code just calculate Z11 value . after that ı defined matrix as VM (1x5) and [VM] = [Z]*[IN] how can ı find IN matrix? How can ı do this ? ı hope you help me, ı desing this below code:
l=1;
a=0.001;
V=1;
delta=l/5;
for n = 1:5
for m = 1:5
dminus(m,n) = l-delta;
dplus(m,n) = l+ delta;
if (m==n) ZMN=2*log (delta+ (sqrt( a*a +delta*delta))/a);
elseif (2>= abs(m-n)) ZMN=log ( (dplus+ sqrt(dplus*dplus +a*a))/ (dminus +sqrt(dminus*dminus+a*a)));
else log(dplus/dminus);
end
end
end
A = [1.11*(10^-10),1.11*(10^-10),1.11*(10^-10),1.11*(10^-10),1.11*(10^-10)];
VM=A.';

Respuesta aceptada

VBBV
VBBV el 29 de Nov. de 2020
l=1;
a=0.001;
V=1;
delta=l/5;
for n = 1:5
for m = 1:5
dminus(m,n) = l-delta;
dplus(m,n) = l+ delta;
if (m==n)
Z(m,n)=2*log (delta+ (sqrt( a*a +delta*delta))/a);
elseif (2>= abs(m-n))
Z(m,n)=log ( (dplus(m,n)+ sqrt(dplus(m,n)*dplus(m,n) +a*a))/ (dminus(m,n) +sqrt(dminus(m,n)*dminus(m,n)+a*a)));
else
Z(m,n) = log(dplus(m,n)/dminus(m,n));
end
end
end
  2 comentarios
astronot
astronot el 29 de Nov. de 2020
thank you can ı ask anthing else ? after that ı defined matrix as VM (1x5) and [VM] = [Z]*[IN] how can ı find IN matrix?
A = [1.11*(10^-10),1.11*(10^-10),1.11*(10^-10),1.11*(10^-10),1.11*(10^-10)];
VM=A.';
VBBV
VBBV el 29 de Nov. de 2020
Editada: VBBV el 29 de Nov. de 2020

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Spline Postprocessing 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