matlab - Create workspace variables from table -
essentially opposite of create table workspace variables. i.e. table containing var1, var2, ..., assign var1, var2 base environment, or if called within function, assign these variables calling environment.
for example:
load patients patients = table(age,gender,height,weight,smoker,... 'rownames',lastname); patients has 5 variables, assign them workspace. e.g. age = patients.age, gender = patients.gender ... there way without manually typing everything?
the example given in documentation think should you're looking for. completeness, i'll create table can verified:
create table:
load patients patients = table(age,gender,height,weight,smoker,... 'rownames',lastname); extract data table , assign variable a:
a = patients{1:5,{'height','weight'}}; a 5x2 array of height , weight of patients 1-5, can seen from:
whos a; hope helps!
Comments
Post a Comment