octave-maintainers
[Top][All Lists]
Advanced

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

Re: line continuations


From: Nicholas Jankowski
Subject: Re: line continuations
Date: Wed, 19 Feb 2020 15:01:12 -0500

Not that it matters much but in Matlab (according to the documentation and
asking a colleague to test it) we get and error if the first argument is not a
character vector.

Should I fill this as a Matlab compatibility issue or is this done on purpose?


I think the strrep function is fine. c is a char array. the bug about how the array is stored is changing the shape of the array.  the substitution appears to be fine, if c was actually what you wanted (a two row char array). As stated in 'help char',   Matlab/Octave concatenates char arrays vertically (are stored columnwise). so the stored order is 1 4 2 5 3 6. eg:

octave:13> a=char('test1','test2')
a =

test1
test2

octave:14> a(1)
ans = t
octave:15> a(2)
ans = t
octave:16> a(:)
ans =

t
t
e
e
s
s
t
t
1
2



reply via email to

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