how to plot cell array and how to get its imaginary part?

1 回表示 (過去 30 日間)
Nara Lee
Nara Lee 2021 年 4 月 24 日
編集済み: dpb 2021 年 4 月 25 日
hi there
if each cell has two components an i just want one of them to be plotted waht should I do?
and how i could get its imaginary part only?

採用された回答

dpb
dpb 2021 年 4 月 24 日
Use cell indexing expressions--
>> c={[rand(4,1),rand(4,1)]}; % presume the format described for some sample data
>> c{:} % the cell content
ans =
0.94 0.61
0.46 0.56
0.98 0.29
0.20 0.79
>> c{:}(:,2) % return column 2 only
ans =
0.61
0.56
0.29
0.79
>>
See the doc for details on addressing cell arrays @
<https://www.mathworks.com/help/matlab/matlab_prog/access-data-in-a-cell-array.html>
  2 件のコメント
Nara Lee
Nara Lee 2021 年 4 月 25 日
okay i did it but there is no answer and i got error
dpb
dpb 2021 年 4 月 25 日
編集済み: dpb 2021 年 4 月 25 日
"i did it but there is no answer and i got error"
What, specifically, was "it" and what was the error? Can't see your terminal from here and the crystal ball is back in the shop for repairs (yet again)...
And, of course, I guessed at what your original Q? was actually describing so show us what you actually have and had tried before if you hope for any meaningful answers.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by