how to assign two variables in single cell
4 views (last 30 days)
Show older comments
Vijay Reddy
on 10 Jul 2015
Answered: Walter Roberson
on 11 Jul 2015
Consider a cell in a matrix (2,2). I want to assign carbon concentration value as well as grain number value to that cell. How is it possible. Which data structure should I use. Please explain.
0 Comments
Accepted Answer
Walter Roberson
on 11 Jul 2015
datacell(2,2) = struct('carbon', [], 'grain', []);
now you can look at datacell(1,1).carbon, datacell(2,1).grain and so on.
datacell(1,2).carbon = 17;
datacell(2,2).grain = 9;
and so on.
0 Comments
More Answers (0)
See Also
Categories
Find more on Multidimensional Arrays 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!