the following command returns how many Inf's are in a vector
length(find(myVector==Inf))
just another blog. here you'll find my experiences with Matlab/Simulink, vba, LaTeX and Mac OS X.
the following command returns how many Inf's are in a vector
2 comments:
Actually a faster way is this:
sum(isinf(myVector))
ah. yes. you are right. this is more elegant. but the long way may be easier to adapt to other requirements. for example, if you whant to count how many "2"s are in a row, or how many zeros.
thanks for the comment!
leg
Post a Comment