フィルターのクリア

How to add rows to an existing table

560 ビュー (過去 30 日間)
Morgan Roberts
Morgan Roberts 2018 年 1 月 11 日
コメント済み: Martin Dale 2019 年 4 月 30 日
Hi
I am trying to add rows to this existing table, however I can't seem to add any, the one row just gets changed to the new value.
1×7 table
Neuron Neuron_ID NoSynapses SynapticDensity NoBranches BranchDensity Clustering
________ _________ __________ _______________ __________ _____________ __________
'ipsiCN' [5] [2] [4.0060] [12] [0.0482] [0]
Does anyone have any help on this?
Cheers
  3 件のコメント
Brian Droncheff
Brian Droncheff 2018 年 8 月 26 日
A link to this particular documentation for this particular question would be helpful. I have been looking all around for this exact same thing but... ended up here as well as not being able to find the answer.
Martin Dale
Martin Dale 2019 年 4 月 30 日

サインインしてコメントする。

回答 (2 件)

Brian Droncheff
Brian Droncheff 2018 年 8 月 26 日
編集済み: Brian Droncheff 2018 年 8 月 26 日
Fitting to this format where 'A', 'B', etc.. are your values of Neuron Neuron_ID etc.
C = {1,2,3,4}
T = cell2table(C,'VariableNames',{'A','B','C','D'})
T1 = table(5, 6, 7, 8,'VariableNames',{'A','B','C','D'})
Tout = [T;T1]
Basically you are creating one Table T from cell2table and then creating the table T1 and Matlab matches the 'variableNames' together. NOTE 'variableNames' is a keyword, it is not an arbitrary name, also that the actual number of and string names such as 'A' 'B' 'C' and 'D' MUST match between the two tables.
The post which I modified the above from is here: Adding Rows to Table
Brian

KSSV
KSSV 2018 年 1 月 11 日
T = table([10;20],{'M';'F'},'VariableNames',{'Age','Gender'},'RowNames',{'P1','P2'})
Tnew = table(30,{'F'},'VariableNames',{'Age','Gender'},'RowNames',{'P3'}) ;
T = [T ; Tnew]

カテゴリ

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