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 个评论

What is your indepent variable for the plotting? Just the vector array index?
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,...

请先登录,再进行评论。

 采纳的回答

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 Exchange 中查找有关 2-D and 3-D Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by