MATLAB: Are the first 3 elements of a vector NaN

nan

Dear all,I have
A={
[NaN]
[NaN]
[NaN]
[3]
[3]
[6]
[4]}
I want to find a rule that will tell me if the first 3 elements of a vector A are NaN or not
thanks

Best Answer

A is a cell.
all(cellfun(@isnan,A(1:3)))