Plot cell array content

7 ビュー (過去 30 日間)
Auryn_
Auryn_ 2016 年 12 月 16 日
コメント済み: José-Luis 2016 年 12 月 19 日
Hello, I have a cell (F3cell) with three arrays inside (1x9, 1x49, 1x99). What I would like to do at the end is to plot the first set of values again t=1:9, the second against t=1:49, etc. Unfortunately I cannot do plot(tcell{1,:} F3cell{1,1:n_steps(1)-1}); being n_steps(1)=10. I have tried several paths but it doesn't work. Could you please help me? Thank you very much in advance.
  1 件のコメント
Auryn_
Auryn_ 2016 年 12 月 17 日
I should specify that the initial data cell (F3cell) is 3x99 cell, where the first row is 1x9 and the rest empty. Any idea how I could proceed in this case?

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

回答 (1 件)

José-Luis
José-Luis 2016 年 12 月 16 日
data = {rand(1,9), rand(1,49), rand(1,99)};
hold on
cellfun(@(x) plot(x), data)
  2 件のコメント
Auryn_
Auryn_ 2016 年 12 月 16 日
Thank you for your answer. Your data cell is 1x3 cell, mine is 3x99 cell, where the first row is 1x9 and the rest empty. Do you know how I can proceed in this case?
José-Luis
José-Luis 2016 年 12 月 19 日
Pass only the first column of your data to cellfun.

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

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by