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
    Hi,

    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
    Snk_majin
     
  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 --> {}

    ex.

    >> 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...
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Matlab char array help please?
  1. Help in MATLAB please (Replies: 22)

  2. Matlab Help please (Replies: 4)

Loading...