store prefix name, abbreviation, and exponent from the rownumber-th row as variables in matlab

Assuming you have a table T with column names 'Prefix', 'Abbreviation', and 'Exponent', and you want to store the values from the rownumber-th row as variables prefix, abbrev, and exp, respectively, you can use the following code:

main.m
% Get the values from the rownumber-th row of the table
prefix = T.Prefix(rownumber);
abbrev = T.Abbreviation(rownumber);
exp = T.Exponent(rownumber);
151 chars
5 lines

Here, we use array indexing to get the values of the specified row from each column. The T.Prefix, T.Abbreviation, and T.Exponent notations are shorthand for accessing the Prefix, Abbreviation, and Exponent columns of table T.

Note that rownumber should be an integer between 1 and the height of the table. Also, make sure that the variable names you choose for prefix, abbrev, and exp are not the same as any existing functions or variables in your Matlab workspace, as this could cause conflicts.

gistlibby LogSnag