Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB newbie: how to index a string array?

  1. Jun 27, 2011 #1
    I'm a Matlab newbie. I have an array of strings, for example:

    header = {'Fred', 'Tom'}

    When I do:
    header(1)

    I get 'Fred'

    I want to be able to change elements--for example:
    header(1) = 'Jill'

    But I get this error:
    ??? Conversion to cell from char is not possible.

    I would be very grateful for advice. If it isn't possible to do this, is there some other container I could use for storing and changing strings? The strings will form a header row for matrix columns output to a file. Thanks a lot.
     
  2. jcsd
  3. Jun 27, 2011 #2
    It should be:
    header(1) = {'Jill'}
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: MATLAB newbie: how to index a string array?
  1. Matlab newbie (Replies: 6)

  2. Matlab and arrays (Replies: 0)

  3. Arrays in MATLAB (Replies: 3)

Loading...