How can I plot the same index from two arrays?
이전 댓글 표시
There are two arrays consisting of 1440 elements each. (for y-axis)
T_start1= {}; %start time

T_end = {}; %end time

x = 1:1:1440 %nodes (x-axis)
I'm trying to figure out how to combine these two arrays (T_start1 and T_end). For example, the first element of T_start1 is paired with the first element of T_end to get a vertical line.

Instead of having two different plot lines, is it possible to do this? That means the first element paired with the other first element. This go on for the other elements. Is it possible?

Current code:
T_start1= {}; %start time
T_end = {}; %end time
figure(4);
x = 1:1:1440 %nodes
y1 = cell2mat(T_start1);
m = cell2mat(T_end);
plot (x,y1,x,m)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

