Vertcat Issue in Table Concatenation

2 ビュー (過去 30 日間)
Daelyn Greene
Daelyn Greene 2019 年 3 月 14 日
回答済み: KSSV 2019 年 3 月 14 日
I am trying to merge a column from a table with an input. These values can be numbers or text. Whenever I try I get the error "Error using vertcat Dimensions of arrays being concatenated are not consistent." I have no clue what is going wrong.

回答 (1 件)

KSSV
KSSV 2019 年 3 月 14 日
It seems you are not concatenating a column table...so the error.
col1 = rand(10,1) ;
col2 = rand(20,1) ;
row1 = rand(1,10) ;
T1 = table(col1) ;
T2 = table(col2) ;
T3 = table(row1) ;
%
T1.Properties.VariableNames = {'column'} ;
T2.Properties.VariableNames = {'column'} ;
T12 = vertcat(T1,T2) ; % no error
T3.Properties.VariableNames = {'column'} ;
T13 = vertcat(T1,T3) ; % error

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by