熱傳模組建立
this a test
The blog is for students who attend the course of 'Applications of Matlab in Engineering' to submit their homeworks, discussions and classnotes. Related blog can be refered to http://bime-matlab.blogspot.com. Students's work should be posted to this blog through a specified email address under a preset or self-defined title with proper contents. Students also have to leave their comments consistently to all the posted titles. Both posting material and comments will be graded later.
前言:早前出差去使用經緯儀,希望能用兩種角度去作定位
問題:如何在只有兩組經緯儀的角度下作空間點群的定位,在建立公式以及程式後,發覺程式當時剛學技巧有需要改進且似乎這樣的計算是有錯的,希望大家幫忙想
程式流程:
clear
format long
matrix=xlsread('diow.xls','sheet1','A2:L3'); %% read the data
[m,n]=size(matrix); %% get row and column
L=input('Input the L you get==> ')
%%request the distance between two measure point
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% to build the alpha's array
for i=1:m
A(i)=matrix(i,1)
%% to build the alpha's array
A2(i)=matrix(i,2)
%% to build the alpha's minute array
A3(i)=matrix(i,3)
%% to build the alpha's second array
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% to build the theta's array
S(i)=matrix(i,4)
%% to build the theta's array
S2(i)=matrix(i,5)
%% to build the theta's minute array
S3(i)=matrix(i,6)
%% to build the theta's second array
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% to build the Beta's array
B(i)=matrix(i,7)
%% to build the Beta's array
B2(i)=matrix(i,8)
%% to build the Beta's minute array
B3(i)=matrix(i,9)
%% to build the Beta's second array
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% to build the PHI's array
F(i)=matrix(i,10)
%% to build the PHI's array
F2(i)=matrix(i,11)
%% to build the PHI's minute array
F3(i)=matrix(i,12)
%% to build the PHI's second array
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% to make their unit coherence
for i=1:m
A(i)=A(i)+(A2(i)/60)+(A3(i)/3600)
S(i)=S(i)+(S2(i)/60)+(S3(i)/3600)
B(i)=B(i)+(B2(i)/60)+(B3(i)/3600)
F(i)=F(i)+(F2(i)/60)+(F3(i)/3600)
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%find that limit it or not is no matter
for i=1:m
% if B(i)<90
C(i,1)=L*sin(B(i)/180*pi)/sin((B(i)-A(i))/180*pi)
% to build X's array (X,Y are not the real coordinate)
C(i,2)=L*sin(A(i)/180*pi)/sin((B(i)-A(i))/180*pi)
% to build Y's array
% end
% if B(i)>90
% C(i,1)=L*sin(B(i)/180*pi)/sin((B(i)+A(i))/180*pi)
% to build X's array
% C(i,2)=L*sin(A(i)/180*pi)/sin((B(i)+A(i))/180*pi)
% to build Y's array
% end
end
%% to build coordinates' matrix
for i=1:m
H(i,1)=C(i,1)*sin(A(i)/180*pi)
H(i,2)=C(i,1)*cos(A(i)/180*pi)
H(i,3)=C(i,1)*tan(S(i)/180*pi)
H(i,4)=C(i,2)*sin(B(i)/180*pi)
H(i,5)=C(i,2)*cos(B(i)/180*pi)+L
H(i,6)=C(i,2)*tan(F(i)/180*pi)
end
%output the data to excel
xlswrite('test',H,'sheet1','A2');
for i=1:m
plot3(H(i,1),H(i,2),H(i,3),'o');
plot3(H(i,4),H(i,5),H(i,6),'o');
hold on
end
張貼者:
黃世榮
於
11/03/2006 02:02:00 下午
0
意見
標籤: 黃世榮
%problem#2
程式流程:
%question 1
clear
format short
B=[98 100 102 104 98.4 98.2 98.5 101 102 99.5]
C=(B-32)*5/9 % that's a)'s answer
[u,v]=find(C>38);
D=zeros(1,10);
D(u,v)=1
%question 2
clear
A= [10 8 6 4 -5 20]
B=[2 8 5 10 -6 3]
D1=[A>B]
D2=(A>5)
D3=A+B
%question 3
clear
x=[10 20 30]
y=[1 4 6]
A=3*x+y
B=5*y/x
C=4*x.*y*2
D=sin(x).*cos(y)
E=5*x.*sin(2*y)
%question 4
R=[ 10 30 200 400]
Req1=sum(R)
%series
Req2=prod(R)/sum(R)
%parallel
執行結果:
Q1:
B =
Columns 1 through 8
98.0000 100.0000 102.0000 104.0000 98.4000 98.2000 98.5000 101.0000
Columns 9 through 10
102.0000 99.5000
C =
Columns 1 through 8
36.6667 37.7778 38.8889 40.0000 36.8889 36.7778 36.9444 38.3333
Columns 9 through 10
38.8889 37.5000
D =
0 0 1 1 0 0 0 1 1 0
Q2:
A =
10 8 6 4 -5 20
B =
2 8 5 10 -6 3
D1 =
1 0 1 0 1 1
D2 =
1 1 1 0 0 1
D3 =
12 16 11 14 -11 23
Q3:
x =
10 20 30
y =
1 4 6
A =
31 64 96
B =
0.9643
C =
80 640 1440
D =
-0.2939 -0.5967 -0.9487
E =
45.4649 98.9358 -80.4859
Q4:
R =
10 30 200 400
Req1 =
640
Req2 =
37500
Q5:
A =
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 24
14 15 16 17 18 19 20 21 22 23 24
B =
1 4 7 10 13 16 19 22
2 5 8 11 14 17 20 23
3 6 9 12 15 18 21 24
C =
1 7 13 19
2 8 14 20
3 9 15 21
4 10 16 22
5 11 17 23
6 12 18 24
D =
1 3 5 7 9 11 13 15 17 19 21 23
2 4 6 8 10 12 14 16 18 20 22 24
張貼者:
黃世榮
於
9/29/2006 04:06:00 下午
0
意見
標籤: 黃世榮
老師好 我是黃世榮 我想換此帳號 diowking@gmail.com
這是BETA的帳號
張貼者:
黃世榮
於
9/29/2006 02:22:00 下午
0
意見
標籤: 黃世榮
題旨:操作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 可以讓精度變高
張貼者:
不留白老人
於
9/25/2006 04:54:00 下午
0
意見
標籤: 黃世榮
以前所提供之作業繳交方式仍然有效,將繼續計分直到期末。由於沒有期末考,故一切作業均在明年一月十二日午夜到期,逾期不收件,請同學注意。