%bisect.m
rt=10.;
fprintf('solve sqrt(%d)=?\n',rt); %solve sqrt(10)
a=round(sqrt(rt))
b=a+1
m=(a+b)/2.
e=10^-4 %hold condition, 精確到小數點第三位,則設到小數點第四位
error=m^2-rt;
count=1;
fprintf('count=%d, error=%f, sqrt(%d)=%f\n',count,error,rt,m);
while abs(error)>e
if error >0
b=m;
else
a=m;
end
a
b
m=(a+b)/2.
error=m^2-rt;
count=count+1;
fprintf('count=%d, error=%f, sqrt(%d)=%f\n',count,error,rt,m);
end
2017年9月20日 星期三
2017年9月14日 星期四
106-1資訊概論課綱
1.運算思維與Blocky Game
2.Blocky Game (Puzzle, Maze)
3.Blocky Game (Bird)
4.Blocky Game (Bird)
5.Blocky Game (Turtle)
6.Blocky Game (Turtle)
7.Blocky Game (Movie)
8.Blocky Game (Movie)
9.Blocky Game (Pond tutor)
10.Blocky Game (Pond tutor)
11.scratch,transformer, Arduino 簡介
12.S2A, transformer LED呼吸燈實驗
13.LED紅綠燈實驗
14.字串 print
15.超音波測距離
16.3D printer introduction
17.Inkscape 繪圖
18.Thingiverse introduction and download file
19.Thinkcad 繪圖
20.3D printer 作品實驗
平時成績60%:上機實驗
段考成績40%:繳交作品;遲交者扣分;未交者0分計算
2.Blocky Game (Puzzle, Maze)
3.Blocky Game (Bird)
4.Blocky Game (Bird)
5.Blocky Game (Turtle)
6.Blocky Game (Turtle)
7.Blocky Game (Movie)
8.Blocky Game (Movie)
9.Blocky Game (Pond tutor)
10.Blocky Game (Pond tutor)
11.scratch,transformer, Arduino 簡介
12.S2A, transformer LED呼吸燈實驗
13.LED紅綠燈實驗
14.字串 print
15.超音波測距離
16.3D printer introduction
17.Inkscape 繪圖
18.Thingiverse introduction and download file
19.Thinkcad 繪圖
20.3D printer 作品實驗
平時成績60%:上機實驗
段考成績40%:繳交作品;遲交者扣分;未交者0分計算
2017年9月13日 星期三
Excel 數據分析 average, variance, standardize
x | x+b | ax | ax+b | a | |
1 | 3 | 3 | 5 | 3 | |
2 | 4 | 6 | 8 | ||
3 | 5 | 9 | 11 | ||
4 | 6 | 12 | 14 | ||
5 | 7 | 15 | 17 | ||
6 | 8 | 18 | 20 | ||
7 | 9 | 21 | 23 | ||
8 | 10 | 24 | 26 | ||
9 | 11 | 27 | 29 | ||
10 | 12 | 30 | 32 | ||
sum | 55 | 75 | 165 | 185 | 觀察sum的變化 |
count | 10 | 10 | 10 | 10 | |
sum/count | 5.5 | 7.5 | 16.5 | 18.5 | |
average | 5.5 | 7.5 | 16.5 | 18.5 | 觀察average的變化 |
var.p | 8.25 | 8.25 | 74.25 | 74.25 | 觀察var.p的變化 |
stdevp | 2.8722813233 | 2.8722813233 | 8.6168439698 | 8.6168439698 | 觀察stdevp的變化 |
x | mu | X-mu | (X-mu)^2 | ||
1 | 5.5 | -4.5 | 20.25 | ||
2 | -3.5 | 12.25 | |||
3 | -2.5 | 6.25 | |||
4 | -1.5 | 2.25 | |||
5 | -0.5 | 0.25 | |||
6 | 0.5 | 0.25 | |||
7 | 1.5 | 2.25 | |||
8 | 2.5 | 6.25 | |||
9 | 3.5 | 12.25 | |||
10 | 4.5 | 20.25 | |||
sum | 55 | 0 | 82.5 | ||
count | 10 | ||||
sum/count | 5.5 | ||||
average | 5.5 | ||||
var.p | 8.25 | sum/count | 8.25 | ||
stdevp | 2.8722813233 | sqrt(sum/count) | 2.8722813233 | ||
x | pseudo mu | X-pseudo mu | n*pseudo mu | ||
1 | 5 | -4 | |||
2 | -3 | ||||
3 | -2 | ||||
4 | -1 | ||||
5 | 0 | ||||
7 | 2 | ||||
8 | 3 | ||||
9 | 4 | ||||
10 | 5 | ||||
11 | 6 | ||||
sum | 60 | 10 | 50 | ||
count | 10 | ||||
sum(x)=sum(x-pseudo mu)+n*pseudo mu | |||||
pseudo:儰 |
訂閱:
文章 (Atom)