Hi,
I want to replace a column A in table S with a table that has the column title A.
In other words
t=array2table(A)
how can i replace column A in table s with t?

답변 (1개)

R
R 2024년 9월 11일

1 개 추천

Here's a simple example on how to do achieve this
s = table([1; 2; 3], [4; 5; 6], 'VariableNames', {'A', 'B'});
% Create the new table
t = array2table([7; 8; 9], 'VariableNames', {'A'});
% Replace column A in table s with table t
s.A = t.A;
disp(s)
A B _ _ 7 4 8 5 9 6

카테고리

도움말 센터File Exchange에서 Tables에 대해 자세히 알아보기

질문:

2018년 6월 6일

답변:

R
R
2024년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by