MATLAB: How to get control input if in workspace, u is stored as NaN

coupled tank systemismc

I am writing MATLAB code for ISMC of level control of SISO coupled tank system but when I run the m.file ,I workspace u appears as NaN.How I correct this??

Best Answer

As the documentation of nan states, you can get NaN from:
  • Any arithmetic operation on a NaN, such as sqrt(NaN)
  • Addition or subtraction, such as magnitude subtraction of infinities as (+Inf)+(-Inf)
  • Multiplication, such as 0*Inf
  • Division, such as 0/0 and Inf/Inf
  • Remainder, such as rem(x,y) where y is zero or x is infinity
In the absence of any code, we obviously can't guess which is the case for you.