필터 지우기
필터 지우기

Extract data from 800x11 cell to column vector

조회 수: 3 (최근 30일)
Owen Gray
Owen Gray 2021년 1월 18일
댓글: Owen Gray 2021년 1월 19일
Basically I have an 800x11 cell containing either empty [], text or a scalar value. I am trying to extract the scalar values =/0 from the 6th column and store them in a column vector. I'd then also like to take all of the values = 0 and store them in a column vector also.
This is what I've produced so far, apologies it's my first time ever using Matlab
  댓글 수: 4
Adam Danz
Adam Danz 2021년 1월 18일
편집: Adam Danz 2021년 1월 18일
Try
% cell named sesl_results
col = 6; % column 6
idx = cellfun(@(c)isscalar(c) && isnumeric(c) && c>0, sesl_results(:,col));
z = [sesl_results{idx,col}];
Owen Gray
Owen Gray 2021년 1월 19일
Thank you so much for all the help! @Adam Danz this worked perfectly, greatly appreciate it!

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by