Plot a cell array with in each cell a different number of values

I have a cell array (10x5) and in each cell there are many values with a different length. (see picture)
Is there a possibility to plot each row in a different plot and within each plot the columns of the row?
Thanks!

2 件のコメント

Walter Roberson
Walter Roberson 2020 年 12 月 14 日
What is your indepent variable for the plotting? Just the vector array index?
Lotte
Lotte 2020 年 12 月 14 日
編集済み: Lotte 2020 年 12 月 14 日
No, it is a cell array too.
On the x-axis I want my time, cell array of 10x5. (see picture) And on the y-axis I want my knee angle, which is a cell array too (10x5). (see picture)
The cells of the time and of the knee angle have the same length.
Thus I want a first plot with the first row and every colomn. So on the x-axis I want row 1 of time and on the y-axis I want row 1 of the knee angle. And then I want a second plot with row 2 of time on the x-axis and row 2 of the knee angle on the y-axis,...

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

 採用された回答

Walter Roberson
Walter Roberson 2020 年 12 月 14 日

0 投票

You might as well just use a double nested loop over rows and columns.
Although you could do the inner loop as a cellfun(), with it needing two different array inputs and probably not wanting to plot anything for the nan entries, and with probably wanting to put up labels and legends... and with you needing 10 different plots (different figures? 5 x 2 subplots ?)... it all gets messy enough to vectorize that you might as well save the trouble and just loop writing clear code.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

質問済み:

2020 年 12 月 14 日

コメント済み:

2020 年 12 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by