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

Matlab char array help please?

  1. Oct 31, 2004 #1

    I hope you can help, i'm trying to create an array of characters in matlab:

    It has to be 100 x 5000 in size, i'm not to sure where to start. I've looked at some web resources and it some mention bringing in java strings?

    I'd ideally not like to use java as i want to learn the core workings of matlab.

    Is there a way this can be done? I'd really appriciate any helped offered..

    Thanks for your time
  2. jcsd
  3. Nov 1, 2004 #2
    Hello, i hope i can help You.

    You can start from inputing "help char" command in You Matlab Command window. You will see several exaples on creating the char array.
  4. Nov 3, 2004 #3
    u make it just like a numerical matrix... but instead of using brackets --> [], u use the curly brackets --> {}


    >> x = {'I' 'am' 'using';'a' 'character' 'array'}

    x =

    'I' 'am' 'using'
    'a' 'character' 'array'


    get it? just do it with the number of rows and columns you need... btw, the " ; " allows the data to be put onto the next row... refer to the above.. hope that helped...
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook