Clear Filters
Clear Filters

how to create a multi dimension matrix

1 view (last 30 days)
i have a variable having 7 characteristics associated with it.. i have to analyse 15 variables with all 7 parameters.. how to make a 15 x 7 matrix with the obtained charc. of each variable

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 19 Jul 2014
Edited: Azzi Abdelmalek on 19 Jul 2014
You can use a struct class
v=struct('name',{'tom','jerry','kim'},'age',{12 15 20},'height',{6 5 4})
To acces your data
v(1).name
v(1).age
v(3).name
You can also use table
your_vars={'var1' 'var2' 'var3'}'
name={'tom','jerry','kim'}'
age={12 15 20}'
height={6 5 4}'
data=table(name,age,height,'RowNames',your_var)
  1 Comment
RAMESH MUNIRATHINAM
RAMESH MUNIRATHINAM on 21 Jul 2014
thanks for your help.. but if i want to add the details some more persons during the process what will be the command. if the number of person keeps on increasing i cant type the details every time.. instead how to add the details with already built matrix

Sign in to comment.

More Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!