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
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

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>
Project Member
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

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.

     

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-05-08 mmuetzel StatusNone Duplicate
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #50855

    Back to the top


    Powered by Savane 3.9