I am working with a matlab project. And I have a text file like this
AGE 1 1
SEX 2 2
NOP 3 0
SES 0 5
PDD 6 6
ACD 0 0
UDC 8 3
and i want to create a variable from this tab delimited file using textread like the sample below.
x=
'AGE' 1 1
'SEX' 2 0
'NOp' 3 3
'SES' 0 5
'PDD' 6 6
'ACD' 0 0
'UDC' 8 3
how can i do it? I tried many things but couldn’t manage to find a solution please help.
You can do it this way:
Then you’ll have:
Then to expand the cell arrays elements, so that each element can be addressed directly:
And then you can address the elements directly: