add column in table
56 次查看(过去 30 天)
显示 更早的评论
采纳的回答
Voss
2023-7-11
G = struct('ones',{1 1 1 1},'twos',{2 2 2 2}); % for example
T= struct2table(G);
c=1:height(T); % use height
c=c';
T.new_column = c
7 个评论
Voss
2023-7-12
[Is it] possible [to] move c in the first column?
Yes, see below:
G = struct('ones',{1 1 1 1},'twos',{2 2 2 2}); % for example
T= struct2table(G);
c=1:height(T); % use height
c=c';
T.new_column = c;
T = T(:,[end 1:end-1])
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!