Uploaded by Anthony M

HW1

advertisement
old=load("floatnums.txt");
old=old';
new=round(old');
save('intnums.txt', 'new')
T=input("Please enter the wind chill temperature (F): ")
v=input("Please enter the wind speed (mi/h): ")
Twc=35.74+(0.6215*T)-(35.75*(v^0.16))+(0.4275*(v^0.16));
fprintf("The wind chill temperature is :%.0lf", Twc)
R=4;
L=1.3;
V=12;
t=0:0.5;
i=(V/R)*(1-(exp((-R*t)/L)));
plot(i,t);
hold on;
t=0.5:2;
i=(exp((-R*t)/L))*(V/R)*((exp(0.5*R/L)-1));
plot(i,t);
hold off;
xlabel('Current');
ylabel('Time');
title('Anthony b00087346');
weather=load("weatherdata.txt");
C=(weather-32)*(5/9);
ad=C(:,1);
dxb=C(:,2);
meanad=mean(ad);
meandxb=mean(dxb);
fprintf("The average temperature in Abu Dhabi is %.2f, while the average weather in Dubai is %.
The average temperature in Abu Dhabi is 29.77, while the average weather in Dubai is 29.00.
x=0:1:30;
hold on;
plot(ad,'-*r')
plot(dxb,'-og')
plot(x,meanad*ones(size(x)),'-r')
plot(x,meandxb*ones(size(x)),'-g')
hold off;
xlabel('Days')
ylabel('Temperature (C)')
title('Anthony b00087346')
legend('Abu Dhabi','Dubai');
1
2
Download