On Sat, Oct 17, 2009 at 1:45 PM, Eric Chassande-Mottin <echassandemot...@gmail.com> wrote: >> b = >> >> '2' >> '' > > OK, I'm almost there but I'm blocked by a last problem > with vectors of strings. I'm not able to create a vector b > as above. I receive the following error: > > a=cell(2);a{1}="2";a{2}=""; b=cell(2,1); b=a{1,:} > error: invalid assignment of comma-separated list > > how can I extract a vector of strings from a cell array? >
When indexing cells with {}, referencing more than one element produces a comma-separated list (cs-list). cs-lists can't be assigned to a variable; only the first element is assigned. The above expression should work and should end up with b = "2". What's your Octave version? There's no such thing as "vector of strings" in Octave. If you mean a cell array (1xN or Nx1) of strings (character matrices), then I don't understand your question. If you're asking how to convert a cell array of strings into a character matrix with multiple rows, then the answer is char (). Please be more specific about what you need. -- RNDr. Jaroslav Hajek computing expert & GNU Octave developer Aeronautical Research and Test Institute (VZLU) Prague, Czech Republic url: www.highegg.matfyz.cz ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev