how to plot different cell arrays in just one graphic?

조회 수: 1 (최근 30일)
Fercho_Sala
Fercho_Sala 2021년 6월 22일
댓글: Fercho_Sala 2021년 6월 24일
Probably it could be a tricky question... however : having 2 different cell arrays, how can I plot the first cell (of the first array) and then the first cell (of the second array) consecutively and create a general plot in the same way for the other cells? , all together in a plot. Thanks.

채택된 답변

Walter Roberson
Walter Roberson 2021년 6월 22일
temp = [reshape(First, 1, []);
reshape(Second, 1,[])];
plot(temp{:})
  댓글 수: 5
Walter Roberson
Walter Roberson 2021년 6월 24일
maxinter = min(length(S), length(S7));
SS = [reshape([S(1:maxinter); S7(1:maxinter)], 1, []), S(maxinter+1:end), S7(maxinter+1:end)];
This code is valid no matter whether S or S7 is the longer vector, as long as both of them are row vectors.
Fercho_Sala
Fercho_Sala 2021년 6월 24일
@Walter Roberson yes, it works perfectly, thank's a lot for your knowledge :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by