All input arguments must be tables error

14 ビュー (過去 30 日間)
HW
HW 2020 年 3 月 26 日
回答済み: Guillaume 2020 年 3 月 26 日
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 Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by