2

I got this cell array resulted from the function textscan

r =

{139952x1 cell}

and when you type r{1} in the command window, you get something like

  • '1:07:50'
  • '1:07:50'
  • '1:07:50'
  • '1:07:50'
  • '1:07:52'
  • '1:07:52'
  • '1:07:52'
  • '1:07:52'
  • '1:07:54'

my question is, how to reach an individual element in this cell array, the fourth element for example ?

4
  • r{i} should let you access the element i of a cell array. I looks like the contents of the cell might be an array. Try a = r{1} and examining a specifically. Commented Mar 2, 2015 at 1:49
  • no it doesn't @eigenchris, this will display the whole column Commented Mar 2, 2015 at 1:55
  • I was trying to say that r{1} itself is a column array. So with a=r{1}, a(4) would be the 4th element of the array in the first cell of r. Commented Mar 2, 2015 at 1:56
  • @eigenchris I got you, thanks : ) yeah that works fine Commented Mar 2, 2015 at 2:02

1 Answer 1

1

Here is how to access parts of cells Basically you should do:

r{1}(i)

where i is a specified individual element

Sign up to request clarification or add additional context in comments.

1 Comment

Yep indeed it takes some time ;) Once you done you can accept an answer clicking on it! Cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.