フィルターのクリア

How to fill a Cellarray with the real components of a matrix

1 回表示 (過去 30 日間)
Paul Nanfah
Paul Nanfah 2015 年 9 月 12 日
コメント済み: Star Strider 2015 年 9 月 12 日
hi everyone, I have the following matrix and want to create a Cellarray with contents the real component of the Matrix. my code doesnt work:
[m n]=size(Mat);
C=cell(m,n);
for h = 1:m
for l=1:n
C(h,l) = real(Mat(h,l));
end
end
I got the error "Conversion to cell from double is not possible."
thank you in advance

採用された回答

Star Strider
Star Strider 2015 年 9 月 12 日
Avoid the loop. This works:
C = real(Mat);
  2 件のコメント
Paul Nanfah
Paul Nanfah 2015 年 9 月 12 日
it does work ,thank you
Star Strider
Star Strider 2015 年 9 月 12 日
My pleasure.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by