Matlab does not calculate

1 view (last 30 days)
Baran Can Kadioglu
Baran Can Kadioglu on 13 Nov 2021
Temperature = 0:5:100;
Viscosity = (1.458.*10.^-6).*((Temperature+273.15).^0.5)./(1+(110.4./(Temperature+273.15)))
fprintf('\n\n');disp(' Temperature(K) Viscosity');disp([Temperature',Viscosity'])
Viscosity =
1.0e-04 *
Columns 1 through 17
0.1716 0.1741 0.1765 0.1789 0.1813 0.1837 0.1861 0.1884 0.1908 0.1931 0.1954 0.1976 0.1999 0.2021 0.2043 0.2065 0.2087
Columns 18 through 21
0.2109 0.2131 0.2152 0.2173
Temperature(K) Viscosity
0 0.0000
5.0000 0.0000
10.0000 0.0000
15.0000 0.0000
20.0000 0.0000
25.0000 0.0000
30.0000 0.0000
35.0000 0.0000
40.0000 0.0000
45.0000 0.0000
50.0000 0.0000
55.0000 0.0000
60.0000 0.0000
65.0000 0.0000
70.0000 0.0000
75.0000 0.0000
80.0000 0.0000
85.0000 0.0000
90.0000 0.0000
95.0000 0.0000
100.0000 0.0000
i cant calculate viscosity value can anyone help??

Answers (1)

Stephen
Stephen on 13 Nov 2021
Just change the FORMAT, e.g.:
format short G
T = 0:5:100;
V = (1.458.*10.^-6).*((T+273.15).^0.5)./(1+(110.4./(T+273.15)));
[T(:),V(:)]
ans = 21×2
0 1.7161e-05 5 1.7407e-05 10 1.7652e-05 15 1.7894e-05 20 1.8134e-05 25 1.8372e-05 30 1.8609e-05 35 1.8843e-05 40 1.9076e-05 45 1.9307e-05

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!