accessing the first column of each cell ?

조회 수: 9 (최근 30일)
Abbi Hashem
Abbi Hashem 2018년 12월 9일
댓글: madhan ravi 2018년 12월 9일
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.
Any help is appreciated please
  댓글 수: 2
madhan ravi
madhan ravi 2018년 12월 9일
"200 matricies as well"
what??
Abbi Hashem
Abbi Hashem 2018년 12월 9일
2000 sry

댓글을 달려면 로그인하십시오.

답변 (1개)

madhan ravi
madhan ravi 2018년 12월 9일
편집: madhan ravi 2018년 12월 9일
Only first part is answered:
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
  댓글 수: 2
Abbi Hashem
Abbi Hashem 2018년 12월 9일
thank you
madhan ravi
madhan ravi 2018년 12월 9일
Anytime :) , if you got the answer to your question make sure to accept the answer else let know what's additionally required.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by