computing matrix in for loop
2 ビュー (過去 30 日間)
古いコメントを表示
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.';
0 件のコメント
採用された回答
VBBV
2020 年 11 月 29 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Spline Postprocessing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!