[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parsing a string into a vector
From: |
Søren Hauberg |
Subject: |
Re: Parsing a string into a vector |
Date: |
Sun, 08 Feb 2009 13:00:09 +0100 |
søn, 08 02 2009 kl. 03:37 -0800, skrev AlexG1:
> I need to parse a string containing numbers (e.g. '1 2 3 4 5') into a
> numeric vector.
> In Matlab I simply used the strread() function, but I don't see any
> equivalent for it in Octave. I've tried using strtok() but I can't get it
> work properly, and it's pretty ugly anyway.
Is 'str2num' what you want?
str2num ('1 2 3 4 5')
ans =
1 2 3 4 5
Søren