Kevin
Kevin

Reputation: 3239

Matlab - Assign a matrix to an index of a variable

how can I get a matrix out of cell array?

here is my cell array:

d{1} = [[1 1]; [2 2]; [3 3]]
d{2} = [[1 2]; [2 3]]

I want to get the first matrix out of d{1} which should give me [1 1] but I tried this:

d{1}(1) and It only gives me the first element in the cell. How can I get it to return these cells as a matrix?

Upvotes: 0

Views: 52

Answers (1)

Sardar Usama
Sardar Usama

Reputation: 19689

As you want to access both columns of the first row. So, simply do this: d{1}(1,:)

Upvotes: 1

Related Questions