Using loops, print a table showing wind chill factors
Show older comments
hi guys,
I am writing a function that need to print a table showing wind chill factors,which temperatures is -25:5:55(in column), ind speed is 0:5:55(in row). Now I have to calculate the value in the table, the forumla is 35.7 + 0.6*t- 35.7*(v^0.16) + 0.43*t*(v^0.16);
0 5 10 15 20 25 30 35 40 45 50
-25
-20
-15
-10
-5
0
5
10
15
20
25
30
35
40
45
50
55
So far , I got
function y = wcf(t,v)
y = 35.7 + 0.6*t- 35.7*(v^0.16) + 0.43*t*(v^0.16);
for i= -25:5:55;j= 0:5:55;
A(i,j) = wcf(t*(i),v*(j));
end
end
I know I can use a function wcf(x,y) to produce a matrix of values A(i, j) = f( x(i), y(j) ), for i=1:length(x), j= 1:length(y), by using a nested for-loop. However, I still don't know how to calculate in middle part of the table.
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!