help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help-octave Digest, Vol 16, Issue 65


From: James Sherman Jr.
Subject: Re: Help-octave Digest, Vol 16, Issue 65
Date: Tue, 31 Jul 2007 11:24:18 -0400

As far as I know, this is how octave represents strings, as a row vector of characters.  You can see this with the line:

octave:7> ['g' 'u' 't' 'e' 'n'] == 'guten'
ans =

   1   1   1   1   1

It compares them element by element just like comparing vectors.  Note this is why you can't make a vector of strings, only a cell array of strings, because if you do something like
string = ['guten', 'tag'];
It'll just do concatenation and you'll get,
string = gutentag
just like if you did
vector = [[1,2,3],[4 5]];

Ich hoffe, daß dieses hilft.

James Sherman

P.S. I hope I got that German right.

On 7/31/07, Gerd Rösser <address@hidden > wrote:
Hello!
Anybody here knows a simple method to convert a vector containing characters
like [g e r d] to a string 'gerd'?
Thanks in advance!

Mit freundlichem Gruß
Gerd Rösser


_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave


reply via email to

[Prev in Thread] Current Thread [Next in Thread]