Why does OCTAVE produce this symbol when using strcat

1 次查看(过去 30 天)
I apologize if I'm not supposed to ask a question about OCTAVE but I couldn't find a forum specific to OCTAVE
I'm trying to concatenate the contents of two cell arrays using strcat and I get the following display (see attached image):
Here is my code which produces a weird symbol at the start of each for of array "b"
>> LET =["C,C#,D,D#,E,F,F#,G,G#,A,A#,B"]
>> LETsplit = ostrsplit(LET, ",")
>> LETtrans=LETsplit';
>> LETtrans=LETsplit';
>> C=cell(12,12);
>> C(1:12,1)=LETsplit{1,1};
>> C(1:12,2)=LETsplit{1,2};
>> C(1:12,3)=LETsplit{1,3};
>> C(1:12,4)=LETsplit{1,4};
>> C(1:12,5)=LETsplit{1,5};
>> C(1:12,6)=LETsplit{1,6};
>> C(1:12,7)=LETsplit{1,7};
>> C(1:12,8)=LETsplit{1,8};
>> C(1:12,9)=LETsplit{1,9};
>> C(1:12,10)=LETsplit{1,10};
>> C(1:12,11)=LETsplit{1,11};
>> C(1:12,12)=LETsplit{1,12};
>> b=strcat(2,C(1:12,2),LETtrans);

采纳的回答

Walter Roberson
Walter Roberson 2018-8-5
You have
b=strcat(2,C(1:12,2),LETtrans)
which requests to put char(2) as the first character of the output.
strcat() does not accept a dimension number: it always concatenates horizontally. It is not the same as cat(): cat() accepts a dimension number.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Octave 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by