All input arguments must be tables error

18 次查看(过去 30 天)
I am new to use Matlab and runing the folloing code but turns out the error "All input arguments must be tables"? Any suggestion would be greatly appreciated. Thanks.
(NT1,T1,NT2,T2 are all 7*1 matrix)
>> A = horzcat(NT1,T1,NT2,T2);
>> C=[A(1,1) A(1,2) A(1,3) A(1,4) 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 A(1,1) A(1,2) A(1,3) A(1,4) 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 A(1,1) A(1,2) A(1,3) A(1,4) 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 A(1,1) A(1,2) A(1,3) A(1,4)
A(2,1) A(2,2) A(2,3) A(2,4) 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 A(2,1) A(2,2) A(2,3) A(2,4) 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 A(2,1) A(2,2) A(2,3) A(2,4) 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 A(2,1) A(2,2) A(2,3) A(2,4)
A(3,1) A(3,2) A(3,3) A(3,4) 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 A(3,1) A(3,2) A(3,3) A(3,4) 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 A(3,1) A(3,2) A(3,3) A(3,4) 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 A(3,1) A(3,2) A(3,3) A(3,4)
A(4,1) A(4,2) A(4,3) A(4,4) 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 A(4,1) A(4,2) A(4,3) A(4,4) 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 A(4,1) A(4,2) A(4,3) A(4,4) 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 A(4,1) A(4,2) A(4,3) A(4,4)
A(5,1) A(5,2) A(5,3) A(5,4) 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 A(5,1) A(5,2) A(5,3) A(5,4) 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 A(5,1) A(5,2) A(5,3) A(5,4) 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 A(5,1) A(5,2) A(5,3) A(5,4)];
%%
All input arguments must be tables.

回答(1 个)

Guillaume
Guillaume 2020-3-26
"NT1,T1,NT2,T2 are all 7*1 matrix"
Clearly not! At least one of them is a table. If you concatenate something with a table, as the error tells you all the somethings must be a table.
You can see what class the variables by looking at the class column in the output of:
whos NT1 T1 NT2 T2

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by