Using cell arrays and find. Undefined function 'le' for input arguments of type 'cell'.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
1 Kommentar
Akzeptierte Antwort
Alex Taylor
am 3 Jun. 2013
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!