How do I find the value of the cell from a particular row number

1 view (last 30 days)
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
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?

Sign in to comment.

Accepted Answer

Adam
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
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.

Sign in to comment.

More Answers (0)

Categories

Find more on Data Types in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!