配列の要素の逆数の二乗平均の逆数をとるには?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
N=[2,3,5,6,4,7,2] の配列があり、
A[1]=1/((1/2)^2+(1/3)^2+(1/5)^2),A[2}=1/((1/3)^2+(1/5)^2+(1/6)^2),,,,
のように、元の配列Nの各要素の逆数の二乗平均の逆数をとるにはどうしたらよいでしょうか?
0 Kommentare
Akzeptierte Antwort
michio
am 24 Nov. 2017
A(1) は N(1) から N(3) の逆数の二乗平均の逆数、
A(2) は N(2) から N(4) の逆数の二乗平均の逆数、
.
.
と3要素づつ計算に入れる形でしょうか。何か既に試されましたか?
A(1) = 1/(sum(N(1:3).^2));
などを for ループで回せばとりあえずできそうです。
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrices in the MATLAB Environment finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!