If I have a database like this:
field = {'Name','GPA,'Salary'};
data = {'Jim', 3.2, $1000}
How to get data GPA '3.2' from my database to be my variable, so I can use it? Table name is 'data'.
If I have a database like this:
field = {'Name','GPA,'Salary'};
data = {'Jim', 3.2, $1000}
How to get data GPA '3.2' from my database to be my variable, so I can use it? Table name is 'data'.
If you can work with this variables this is a matlab data structure called cell. the problem is that you have things that matlab can read
The first expression has an unclosed string
field = {'Name','GPA,'Salary'};
so it should be:
field = {'Name','GPA','Salary'};
The problem with the second is the dollar symbol you should or remove it or work as a string
data = {'Jim', 3.2, 1000}
then accessing to cell is easy here is the documentation
field{2}
ans =
GPA
you can work with the numbers inside a cell, with positions you know that GPA is position 2:
>> data = {'Jim', 3.2, 1000}
data =
'Jim' [3.2000] [1000]
>> data{2} = data{2} + 0.8
data =
'Jim' [4] [1000]