access row/column of 2 dimensional cell array

See here.
C = { …
rand(100,2) rand(150,2) rand(130,2) rand(50,2); …
rand(110,2) rand(120,2) rand(310,2) rand(10,2); …
rand(130,2) rand(115,2) rand(110,2) rand(40,2); …
};
C =
[100×2 double]    [150×2 double]    [130×2 double]    [50×2 double]
[110×2 double]    [120×2 double]    [310×2 double]    [10×2 double]
[130×2 double]    [115×2 double]    [110×2 double]    [40×2 double]

To access (1,2) of C,
C12 = C(1,2); % [150×2 double]
To access 2nd row/column of C,
Crow2 = C(2,:);
Ccolumn2 = C(:,2);

To concatenate row/column,
Vrow2 = cell2mat(Crow2(:));
Vcolumn2 = cell2mat(Ccolumn2(:));

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s