Removing rows with [] in cell array

9 ビュー (過去 30 日間)
mashtine
mashtine 2014 年 5 月 8 日
コメント済み: mashtine 2014 年 5 月 8 日
Hey everyone,
Clearly my syntax is off. I have seen my a post about this and tried many ways but I keep getting errors, particularly
Error using subsindex
Function 'subsindex' is not defined for values of class
'cell'.
I would like to remove the entire row of data if [] is found in the 3rd column. I read a post that said this error is often returned when I have a variable with a similar name to a matlab function but when I do the following that doesn't seem to be the case.
>> which data
data is a variable.
Here is the final code I tired:
>> data(cellfun(@(x)x(~isempty(x)), data(:,3),'un',0),:)= []
Error using subsindex
Function 'subsindex' is not defined for values of class
'cell'.
Attached is my file! Thank you!
  4 件のコメント
Jens
Jens 2014 年 5 月 8 日
just happy to help.
mashtine
mashtine 2014 年 5 月 8 日
Well you are certainly appreciated. Many thanks, one day I will return the favour to someone

サインインしてコメントする。

採用された回答

A Jenkins
A Jenkins 2014 年 5 月 8 日
data(cellfun(@(x) isempty(x), data(:,3)),:)=[]

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by