PROBLEM #1:黃世榮
題旨:操作MATLAB基本指令 程式流程和程式內容: %%%% Problem #1 %%%%
format long
clear
% question 1 f=200 ;%force's unit is kg
t=60 ;%time's unit is s
l=20 ;%distance's unit is m
Power=f*9.8*l/(t*1000) %power's unit is kw
% question 2
R=1+20+200 ;%resistor's unit is ohm
V=110 ; %voltage's unit is V
I=V/R %the current's unit is Amp
P=V^2/R %the power
% question 3
A=650; B=428 ;C=282; %triangle's three sides
S=0.5*(A+B+C);
Area=(S*(S-A)*(S-B)*(S-C))^0.5 % question 4
numbers=(52000+84300-25000)/600 % (total heat dissipate per hour)/(heat
form Hog per hour)
% question 5
L=4;H=0.9;
Q=3.33*[L-0.2*H]^(3/2)
執行結果與討論
Power =
0.65333333333333
I =
0.49773755656109
P =
54.75113122171945
Area =
4.523315598098368e+004
numbers =
1.855000000000000e+002
Q =
24.86218409261745
結論:使用FORAMT LONG 可以讓精度變高
沒有留言:
張貼留言