Water viscosity

%Water viscosity.
%       This exercise uses the M-file KVISC which contains a table
%       of water viscosities. See subdirectory CH08\TAB.

% 1)
kvisc
plot(kvisc(:, 1), kvisc(:, 2))
xlabel(‘Temperature, deg C’), ylabel(‘Kinematic viscosity, m^2/s’)
title(‘Fresh-water kinematic viscosity’)
pause
disp(‘To continue press any key’)

% 2)
ti = 0.5: 27.5;
visci = table1(kvisc, ti)
plot(kvisc(:, 1), kvisc(:, 2), ti, visci, ‘*’)
pause
disp(‘To continue press any key’)

% 3)
t = kvisc(:, 1);       % separate temperature
nu = kvisc(:, 2);      % separate viscosity
invertvisc = [ nu t ]; % inverted table
t09 =  table1(invertvisc, 0.9)
plot(kvisc(:, 1), kvisc(:, 2), t09, 0.9, ‘*’)
pause
disp(‘To continue press any key’)

% 4)

nu30 = table1(kvisc, 30)
disp(‘The function TABLE1 does not perform extrapolation.’)