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