MATLAB: Can anyone help me with the water level tank (sltank) example available on Matlab

s-function

What does yData(3:4) mean? it is available in flag==2 S-function code for the water level tank example available by writing in the matlab command: (sltanlk)

Best Answer

There is user data "hidden" in the figure 'tankdemo'. The user data gets extracted into the variable 'yData' by the line
yData=get(tankHndlList(1),'YData');
yData(1) is the offset. yData(3:4) the height. The next lines use yData([3 4]), which means the same.