Reassigning columns to a table
Show older comments
Hi,
I have a table A from which I selected few columns to recompute using function correctiona. The column names are from a survey and they are quite confusing sometimes but I want to retain how they were named.
B=[A.SQ013_SQ001,SQ013_SQ004,A.SQ013_SQ003,A.SQ013_SQ002,A.SQ013_SQ001,A.SQ013_SQ004,A.SQ013_SQ003,A.SQ013_SQ002];B_corrected=correctiona(B); %B_corrected is is the corrected B matrix
is their a way to reassign the values of B_corrected to the matrix A without having to write long codes like this:
A.SQ013_SQ001=B_corrected(:,1);
A.SQ013_SQ004=B_corrected(:,2); etc....
In other words, can I tell matlab that the each of B_corrected columns to be reassigned to Table A based on the names I used to construct B. The reason is that my correction codes ar every long and confusing and I am afraid of making mistakes. It would be easy if what I take from table A could be reassigned back without having to deal with the column names after each manipulation.
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!