How do I range through a set of columns in a table to generate data and store data in new columns?
Show older comments
Hi,
I've got a 33x12 table "T", where I'd like to generate 8 new columns of data ("Result 1 - 8") by doing a simple calculation of going through values in Column 1-8 one at a time and multiplying each of them with data in Column 12 ("FixedConcentration") and muliplying that by 100. I can do this calculation for one column at a time by doing this...
T.Result1 = (T.APConcentration_mM__1)./(T.FixedConcentration).*100
...but would like this to be done automatically. I use readtable to get the excel file into MATLAB but I'm stuck on how to create a loop that accesses the data column 1-8. Apologies if this is a simple question, but I have limited programming experience and I'd appreciate any help.
Thank you.
Accepted Answer
More Answers (1)
Seth Furman
on 9 Mar 2021
0 votes
You might be interested in varfun.
1 Comment
schilakwad
on 9 Mar 2021
Categories
Find more on Data Import from MATLAB 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!