Programming Practices Tips - Index on matrix with some information
Show older comments
Hi,
I want a tip on what is the best way to code something. I have a matrix with some information. The first column is the index number and the other columns are the informations (length, area, mass etc).
I would like to know if it is best to keep the first column or not. I mean, the index number is the number of row, so, instead of looking for the index number in the matrix and returning the proper information of the other columns, I just need to get the information on that row. However, I was told I could keep the index numbers because if I change my input, I don't need to rewrite the input, but I will have to look for the index number in the matrix.
Which one is the best? Keep the index numbers and do the research every time or use the rows numbers to find the information?
Thanks
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices 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!