Hello.... I need help regarding saving values of for loop.. i am running a program having 7 variables calculating in 1 iteration and i made 50 iterations so there is a 7*50 matrix form ...but i get results in seperate not in a matrix form? how can i

2 ビュー (過去 30 日間)
X = X(:)-mean(X(:));
X = X./std(X,1);
N = length(X);
M20 = mean(X.^2);
M21 = mean(X.*conj(X));
M22 = mean(conj(X).^2);
M40 = mean(X.^4);
M41 = mean(X.^3.*conj(X));
M42 = mean(X.^2.*conj(X).^2);
M43 = mean(X.*conj(X).^3);
M60 = mean(X.^6);
M61 = mean(X.^5.*conj(X));
M62 = mean(X.^4.*conj(X).^2);
M63 = mean(X.^3.*conj(X).^3);
C40 = M40 - 3*M20^2;
C41 = M41 - 3*M20*M21;
C42 = M42 - abs(M20)^2 - 2*M21^2;
C60 = M60 - 15*M20*M40 + 30*M20^3;
C61 = M61 - 5*M21*M40 - 10*M20*M41 + 30*M20^2*M21;
C62 = M62 - 6*M20*M42 - 8*M21*M41 - M22*M40 + 6*M20^2*M22 + 24*M21^2*M20;
C63 = M63 - 9*M21*M42 + 12*M21^3 - 3*M20*M43 - 3*M22*M41 + 18*M20*M21*M22;
M = [M20 M21 M22 M40 M41 M42 M43 M60 M61 M62 M63];
C = [C40 C41 C42 C60 C61 C62 C63];

採用された回答

Walter Roberson
Walter Roberson 2016 年 2 月 25 日
編集済み: Walter Roberson 2016 年 2 月 25 日
for IterationNumber = 1 : 50
X = ...
...
M(:, IterationNumber) = [M20 M21 M22 M40 M41 M42 M43 M60 M61 M62 M63];
C(:, IterationNumber) = [C40 C41 C42 C60 C61 C62 C63];
end
  1 件のコメント
Wajeeha Najeeb
Wajeeha Najeeb 2016 年 2 月 25 日
1 more thing how can i get answer in the form of like [C40 C41 C42 C60 C61 C62 C63;C40 C41 C42 C60 C61 C62 C63;C40 C41 C42 C60 C61 C62 C63;C40 C41 C42 C60 C61 C62 C63; upto 50 iterations]

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by