I want to check if the final value of the string is 'NaN'

`parents=[2 3 1 NaN];f = parents(size(parents,2));if f == 'NaN' check=0else check=1end`

Skip to content# MATLAB: How to use if with the value of the array is a string

###### Related Question

arrayif statement

I want to check if the final value of the string is 'NaN'

`parents=[2 3 1 NaN];f = parents(size(parents,2));if f == 'NaN' check=0else check=1end`

- Min/max indexing of array
- Help reading and cleaning data from text file
- How to find mean with nan
- How to get TRUE/FLASE to work for arrays of cells with mixed string and integer values
- How to replace the array elements with “Nan” or “Inf” to either zero or some other number
- Replace numbers in a matrix depending on neighbor numbers
- How to set a condition for sequential number of non NaN values in a vector
- Help with removing duplicate sub-elements….
- Replace NaN with nearest numerical value to the left in the same row
- Make all elements of given row numbers equal to NaN.

## Best Answer