我目前正在尝试在MATLAB中创建信号流程图。为了做到这一点,我有3个表格,我想绘制不同的信号,这需要合并,以便在同一图表上绘制(但分开,以便分别看到信号)。
到目前为止,我已经尝试过:
% The variables below are examples of the tables that contain
% the variables I would like to plot.
s1 = table(data1.Time, data1.Var1); % This is a 8067x51 table
s2 = table(data2.Time, data2.Var2); % This is a 2016x51 table
s3 = table(data3.Time, data3.Var3); % This is a 8065x51 table
% This gives an error of 'must contain same amount of rows.'
S = [s1, s2, s3];
% This puts the three tables into a cell array
S = {s1, s2, s3};
欢迎任何建议。
答案 0 :(得分:1)
你很亲密。您只需要连接表vertically而不是horizontally:
S = [s1; s2; s3];
% Or in functional form
S = vertcat(s1, s2, s3);
请注意,这仅适用于所有表具有相同数量的变量(即列)的情况。