octave-maintainers
[Top][All Lists]
Advanced

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

Should vertcat(A,B) behave identically to [A;B]?


From: Keith Goodman
Subject: Should vertcat(A,B) behave identically to [A;B]?
Date: Mon, 11 Apr 2005 14:14:10 -0500

Should vertcat(A,B) behave identically to [A;B]?

In matlab vertcat('a ';'a') and ['a ';'a'] return an error. In octave
vertcat('a ';'a') returns an error but ['a ';'a'] doesn't.

That means, for example, that

> disp(unique(['a ';'a'],'rows'))
a
> disp(unique([' a';'a'],'rows'))
 a
a

In other words, trailing blanks, but not initial blanks, are ignored
in unique because

> disp(1*['a ';'a'])
  97  32
  97  32
> disp(1*[' a';'a'])
  32  97
  97  32

If you think that 'a ' and 'a' are unique, then you shouldn't allow ['a ';'a'].



reply via email to

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