Using cell arrays and find. Undefined function 'le' for input arguments of type 'cell'.

4 次查看(过去 30 天)
I'm trying to index data in between two values that vary for each cell.
dew_finalplus=dew_final+1;
dew_finalminus=dew_final-1;
for i=1:length(dew_array)
dew_final1{i}=mat2cell(dew_finalplus, ones(1, size(dew_finalplus, 1)), size(dew_finalplus, 2));
dew_final2{i}=mat2cell(dew_finalminus, ones(1, size(dew_finalminus, 1)), size(dew_finalminus, 2));
end
This part was used to convert a matrix dew_final into two seperate matricies with values +1 and -1 from the original matrix. Then I converted it to a cell array to try to combat an error I had before.
for i=1:length(dew_array)
i;
y_index=find(subdewfinal{i}<=dew_final1{i} & subdewfinal>=dew_final2{i});
DewIV=subdewfinal{i}(y_index);
This is the beginning of a for loop I want to find the indicies in subdewfinal in between dewfinal1 and dewfinal2.
I keep gettng an error 'Undefined function 'le' for input arguments of type 'cell'.' I tried using double() but I can't use that for a cell. Any ideas or modifications to help me out? Thanks

采纳的回答

Alex Taylor
Alex Taylor 2013-6-3
LE is the less than or equal to operator in the statement
subdewfinal{i}<=dew_final1{i}
These items have still not been resolved into numeric matrices that can be compared with "<=". My guess is that you have cell arrays within cell arrays and that you need to refine your indexing to make sure that you are comparing numeric quantities instead of cells.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by