matrix values from loop to raw vector?
古いコメントを表示
Hello guys,
I have been trying other people suggestion, but still cannot create a vector of TEN 4x4 matrixes (also seen as a 4X40 matrix), that I should obtain by iteration for n=1:10
I just want to be able to obtain a final matrix that should be 4X40 but I keep on getting a matrix that is 10x40, which I don't understand :(
q=0.1;
L=2.5;%m
p=0.52;
c1=0;
c2=(1:10);
C=zeros(4,40)
for n=(1:10)
C(n,:)=[c2(n)+c2(n) -c2(n) -c2(n) (p*c2(n)-(1-p)*c2(n))*L; -c2(n) c1+c2(n) 0 -p*c2(n)*L; -c2(n) 0 c1+c2(n) (1-p)*c2(n)*L;(p*c2(n)-(1-p)*c2(n))*L -p*c2(n)*L (1-p)*c2(n)*L p^2*L^2*c2(n)+(1-p)^2*L^2*c2(n)]
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!