All input arguments must be tables error

조회 수: 17 (최근 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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by