Extract data from 800x11 cell to column vector

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 件のコメント

dpb
dpb 2021 年 1 月 18 日
Is the content of the 6th column consistently a double, one hopes?
For clarity, show us what
whos ses1_results
returns.
the cyclist
the cyclist 2021 年 1 月 18 日
Better yet, save ses1_results in a mat file, and upload it here.
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 件)

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

質問済み:

2021 年 1 月 18 日

コメント済み:

2021 年 1 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by