# accessing the first column of each cell ?

7 views (last 30 days)
Abbi Hashem on 9 Dec 2018
Commented: madhan ravi on 9 Dec 2018
lets say I have a cell matrix that was created with 2000 cells each is a 6 by 7 matrix . I want to acces the 7th column of each of these cells and store them in 200 matricies as well. How can I do that ?
Next, I want to solve a linear equation with the right hand side being the 2000 vectors that I have exracted and the left hand side being the 6 by 6 matricies, and of course i should obtain 2000 values for x's.

madhan ravi on 9 Dec 2018
"200 matricies as well"
what??
Abbi Hashem on 9 Dec 2018
2000 sry

madhan ravi on 9 Dec 2018
Edited: madhan ravi on 9 Dec 2018
c=cell(1,2000);
for i = 1:2000 % -> numel(cellmatrix)
c{i}=cellmatrix{i}(:,1); % change 1 to 7 if you want to extract 7th column
end
celldisp(c) % -> first columns extracted from 2000 cells

Abbi Hashem on 9 Dec 2018
thank you
madhan ravi on 9 Dec 2018
Anytime :) , if you got the answer to your question make sure to accept the answer else let know what's additionally required.