tags:

views:

38

answers:

2
%   CAT(2,A,B) is the same as [A,B].
%   CAT(1,A,B) is the same as [A;B].

Seems I need to know this to understand what cat does.

+2  A: 
[A,B]

is a matrix formed by placing B to the right of A, while

[A;B]

is a matrix formed by placing B below A.

Learn also about horzcat and vertcat.

High Performance Mark
So each operator in matlab can be regarded as an operator for matrix?
Gtker
+2  A: 
[A, B] does col cat
[A; B] does row cat

eg:

x = [1, 2, 3];
y = [7, 8, 9];

[x, y] == > [1, 2, 3, 7, 8, 9]

becomes a 1x6 array




[x; y] == > [1, 2, 3]
            [7, 8, 9]

becomes a 2x3 array

Just try it in Matlab and open ans to see the difference

Pyrolistical