MATLAB Answers

How do i get a element in a matrix that is stored in a cell array?

43 views (last 30 days)
Hello guys, i have a cell array 1X4 in each cell i have a MXN matrix. I want to get a element(x,y) inside one of the matrix stored in the cell.
Im currently creating 4 matrices outside de array and the looking for the elements.
How can i do this?
Tks in advance.
Leonardo Hermoso

  0 Comments

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 30 Apr 2013
theMatrixInside = yourCellArray{2}; % Use braces to get the array, not a cell.
theElementsValue = theMatrixInside(row, column); % or (y, x)

  7 Comments

Show 4 older comments
NS
NS on 6 Dec 2018
How to do this for all matrices in cell array using cellfun? I need to extract (2,1) i.e. second row and first column element of all matrices within cell array ?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!