Matlab 如何合并具有不同行数的表?

Matlab 如何合并具有不同行数的表?,matlab,merge,matlab-table,Matlab,Merge,Matlab Table,我目前正试图在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 8067x5

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

欢迎您提出任何建议。

您很接近了。您只需要连接表,而不是:


请注意,只有在所有表都有相同数量的变量(即列)的情况下,这才有效。

您的逻辑有缺陷。你不需要把任何东西合并在一起就可以把东西画在一起。检查文档中的
hold-on
@AnderBiguri我知道
hold-on
但是,我想分离信号。我不想让它们重叠。分开定义。你是说一个接一个?抵消它们?
s1、s2、s3是否为“表格”?或者它们是向量?@AnderBiguri是的,我的意思是偏移它们,s1、s2和s3是独立的表。我不认为你可以只绘制表。您需要显示一个示例数据。谢谢!我不知道维特猫的事。
S = [s1; s2; s3];
% Or in functional form
S = vertcat(s1, s2, s3);