bugGNU Octave - Bugs: bug #60555, Behavior of strcat in Octave is...

 
 

bug #60555: Behavior of strcat in Octave is different of the behavior in Matlab

Submitter:  None
Submitted:  Sat 08 May 2021 09:43:20 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Duplicate Assigned to:  None
Originator Name:  Thomas Stein Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 6.2.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

(+)Post a Comment

(-)Discussion

Sat 08 May 2021 10:42:47 AM UTC, comment #1: 

Double quotes in Matlab create string objects. In Octave, they create character arrays. (See bug #50855.)

If I run your example (but with character arrays) in Matlab R2021a, I get the same result:

>> strcat('Hello, ', 'how are you?', ' ', 'Nice weather today!')

ans =

    'Hello,how are you?Nice weather today!'


So the strcat function in Octave seems to be compatible with Matlab.

Closing as a duplicate of bug #50855.

Markus Mützel <mmuetzel>
Group administrator
Sat 08 May 2021 09:43:20 AM UTC, original submission:  

If I use strcat() in Matlab it don't ignore whitespaces. But in Octave Whitespaces will be ignored.

If I use for example the code:


strcat("Hello, ", "how are you?", " ", "Nice weather today!")


In Matlab the result is:

"Hello how are you? Nice weather today!"


And in Octave the result is:

"Hellohow are you?Nice weather today!"


It is correctly documented, that white spaces will be removed in Octave with strcat(). But if people use Matlab and Octave and need a compatibility it is not given in that case. In my case I try to generate C++ code with Octave and Matlab and need a compatibility. In the string handling some points are not one to one compatiple between Matlab and Octave.

I think that point could be an improvement.


Anonymous

 

(-)Attached Files

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

(-)Dependencies

Digest:
   bug dependencies.

Items that depend on this one: None found

 

(+)Mail Notification Carbon-Copy List

(+)Votes

(+)History

Back to the top

Powered by Savane 3.14-0b36.
Corresponding source code