Info
この質問は閉じられています。 編集または回答するには再度開いてください。
equivalence of the codes that can be used for erasing the first row of R if cell R(1,3) is occupied by NaN?
1 回表示 (過去 30 日間)
古いコメントを表示
Dear all,
Could you please verify the equivalence of the codes that can be used for erasing the first row of R if cell R(1,3) is occupied by NaN?
Code 1:
[N,T,R] = xlsread(xlfilename);
if isnan(cell2mat(R(1,3)))
R(1,:)=[];
End
Code 2
TT = cellfun( @isnan, R(1,3), ‘UniformOuput’, true);
R( ( TT,1), : ) = [] ;
0 件のコメント
回答 (1 件)
F.
2012 年 7 月 5 日
I'm sorry but I don't understand what you are looking for. Code 2 is the code that I gave you http://www.mathworks.fr/matlabcentral/answers/42710-problem-with-xlsread-bizarre-results
R is the raw output of the xlsread function. In each cell, there is a numeric or a string. So R(1,3) is a cell, and you are checking one value to erase the column of your cell array. In code 2 you are using a command (cellfun)used to manage cell arrays just for one cell, and after, you don't use TT !!
*for erasing the first row of R if cell R(1,3) is occupied by NaN *
if all(isnan( R{1,3} ))
R(1,:) = []
end
1 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!