How do I break a table down into rows, and make the rows become variable in the work space?
Show older comments
Hi, I have a 39x3 table, and it has three columns (parameter, units, value), and there are 39 parameters. How do I make it so that I can access the parameter by their names and get the value and unit to also be included when I call it?
3 Comments
Why?
Why not just use the table ?
Magically creating variables in a workspace is a bad idea (no matter how much beginners like to dream it up), and should be avoided if you want to learn how to write efficient, readable, and robust code:
T2 = patients({'Adams','Brown'},:)
In your case you might find it easiest to convert the first column into rownames, then accessing the data will be as simple as:
your_table('parameter_name',:)
Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!