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?
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 Exchange에서 Annotations에 대해 자세히 알아보기

질문:

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