How do I find the value of the cell from a particular row number
2 views (last 30 days)
Show older comments
I have a data array consisting of 1 row and 4000 columns of data values, I want to find out the value which exists in certain cells, say for example row 1, column 2000, how would i go about this?
2 Comments
Stephen23
on 1 Aug 2017
"I have a data array ... I want to find out the value which exists in certain cells..."
What do you mean by a "data array": is this a file of some kind, or is it already in the MATLAB workspace?
Accepted Answer
Adam
on 1 Aug 2017
Edited: Adam
on 1 Aug 2017
myArray{ 1, 2000 }
if it is a cell array or
myArray( 1, 2000 )
if it is a numeric array.
Although when using a 1d array I tend to omit the 1 and just use
myArray( 2000 )
which works equally, but
myArray( row, col )
is the generic acess.
3 Comments
Image Analyst
on 1 Aug 2017
List your columns in brackets:
extractedColumns = fullData(:, [1000, 2000, 3000, 4000]);
That will give you an array with all the rows and only those 4 columns.
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!