StackedPlot with separate events
I’d like to make a stacked plot with each plot showing different events (each plot’s own events only). How could I fix this code to show only the proper data’s corresponding events? (apologies for my clumsy coding)
%make timetable
times=[1, 2, 5]’;
s=seconds(times);
variable=[3, 4, 5]’;
T=table(s,variable);
TT=table2timetable(T);
%makes event table
EventTime = seconds(4);
lengths = seconds(1);
Events = eventtable(EventTime,EventLengths=lengths);
%Assign event table to time table
TT.Properties.Events=Events;
%make timetable
variable2=[6, 8, 9]’;
T2=table(s,variable2);
TT2=table2timetable(T2);
%makes event table
EventTime2 = seconds(1);
lengths2 = seconds(1);
Events2 = eventtable(EventTime2,EventLengths=lengths2);
%Assign event table2 to time table2
TT2.Properties.Events=Events2;
stackedplot(TT,TT2)I’d like to make a stacked plot with each plot showing different events (each plot’s own events only). How could I fix this code to show only the proper data’s corresponding events? (apologies for my clumsy coding)
%make timetable
times=[1, 2, 5]’;
s=seconds(times);
variable=[3, 4, 5]’;
T=table(s,variable);
TT=table2timetable(T);
%makes event table
EventTime = seconds(4);
lengths = seconds(1);
Events = eventtable(EventTime,EventLengths=lengths);
%Assign event table to time table
TT.Properties.Events=Events;
%make timetable
variable2=[6, 8, 9]’;
T2=table(s,variable2);
TT2=table2timetable(T2);
%makes event table
EventTime2 = seconds(1);
lengths2 = seconds(1);
Events2 = eventtable(EventTime2,EventLengths=lengths2);
%Assign event table2 to time table2
TT2.Properties.Events=Events2;
stackedplot(TT,TT2) I’d like to make a stacked plot with each plot showing different events (each plot’s own events only). How could I fix this code to show only the proper data’s corresponding events? (apologies for my clumsy coding)
%make timetable
times=[1, 2, 5]’;
s=seconds(times);
variable=[3, 4, 5]’;
T=table(s,variable);
TT=table2timetable(T);
%makes event table
EventTime = seconds(4);
lengths = seconds(1);
Events = eventtable(EventTime,EventLengths=lengths);
%Assign event table to time table
TT.Properties.Events=Events;
%make timetable
variable2=[6, 8, 9]’;
T2=table(s,variable2);
TT2=table2timetable(T2);
%makes event table
EventTime2 = seconds(1);
lengths2 = seconds(1);
Events2 = eventtable(EventTime2,EventLengths=lengths2);
%Assign event table2 to time table2
TT2.Properties.Events=Events2;
stackedplot(TT,TT2) stackedplot, plotting MATLAB Answers — New Questions