1

我目前正在尝试在 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};

欢迎任何建议。

4

1 回答 1

1

你很亲密。您只需要垂直连接表格而不是水平连接:

S = [s1; s2; s3];
% Or in functional form
S = vertcat(s1, s2, s3);

请注意,这仅在所有表具有相同数量的变量(即列)时才有效。

于 2017-06-13T13:49:02.317 回答