I have an array of structs and would like to set all empty attributes to NaN:
structArray =
29x1 struct array with fields:
value
id
How do I set all struct.value attributes to NaN, if they are empty?
If they are empty the conversion [structArray.value] omits the empty elements…
Given this:
You can set the value of all
.idfields like thisTo set only a particular subset of values define a mask of values to set and then use it in your assignment statement: