# Equivalent of [C{:}] for vertcat

5 views (last 30 days)
Luca Amerio on 21 Dec 2016
Commented: Matt J on 28 Dec 2016
To concatenate horizontally the content of a cell array we can use the very practice syntax [C{:}]. For example:
A = {(1:3) (4:7)};
B = [A{:}]
B =
1 2 3 4 5 6 7
Is there a way to obtain the same results in the vertical direction (except vertcat of course)
A = {(1:3)' (4:7)'};
B = ?
B =
1
2
3
4
5
6
7
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Accepted Answer

Matt J on 21 Dec 2016
Edited: Matt J on 21 Dec 2016
Well, it's not vertcat...
B=cat(1,A{:})
But no, I don't think there's a way purely with operator syntax.
##### 1 CommentShowHide None
Walter Roberson on 21 Dec 2016
Correct, there is no operator syntax for this.

Sign in to comment.

### More Answers (3)

José-Luis on 21 Dec 2016
Edited: José-Luis on 21 Dec 2016
EDIT
cell2mat(A')
##### 2 CommentsShowHide 1 older comment
José-Luis on 21 Dec 2016
cell2mat(A')

Sign in to comment.

KSSV on 21 Dec 2016
vertcat(A{:})
##### 1 CommentShowHide None
Luca Amerio on 21 Dec 2016
"except vertcat of course"
Thank you, but as [C{:}] is an equivalent for horzcat(C{:}), I was asking myself if there was such an equivalent for vertcat too..

Sign in to comment.

Greg on 28 Dec 2016
Do exactly the same thing, then transpose B...
A = {(1:3) (4:7)}; B = [A{:}]'
##### 1 CommentShowHide None
Matt J on 28 Dec 2016
This only works when the elements of A are row vectors, not column vectors, as in the OP's example.

Sign in to comment.

### Categories

Find more on Logical in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!