Transcription of ビゥヺシのことをケボヱデョアヱという。 Octave …
1 Octave .. 1.. > a=1+2;. Octave MATLAB .. MATLAB 3 x=0 :10*pi;.. OS . (Windows Installer ) . 2011 10 ? Octave . windows Notepad++ .. > edit Notepad++ . Octave (Matlab) C Fortran, TeX, Java . Octave . Octave OS Octave . Notepad++ . Notepad++. EUC-JP . > . > .. 1. ( ) . :1>. > clear x x .. ! > clear . PS1('>') . :1> PS1('>') . >. Octave . (windows) Octave . (. ( ). ) .. > sqrt(2) . % . ans = > cos(0) . % . Octave . ans = 1. PS1('>') > exp(1) . % . ans = .. PS1('>'). gamma(x) . beta(z,w) . Octave ( besselj(n,x) 1 . C: Octave bin) .octaverc ..octaverc . Octave . i, j, e, pi .. > i %i .. 2 ( ). ) ans = 0 + 1i > j %j .. ans = 0 + 1i > e ( ). % ). > 2+1-5 ans = ans = -2 > pi . % . > 2*3 ans = ans = 6. > 3^3 . ans = 27. i . ans answer i=0 i . i .. > x=2 x 2 . x = 2 . % .. > y=3 y 3 .. y = 3. > z=x/y z x/y . z= . 2. (ans = ).
2 ; Octave 2D, 3D . (plot, pcolor, surf ) . > a= 1+2; .. % . >. a 3 .. ( ) y=sin2 x 0 x 5 . 15 ( ) > x=0 :5;.. % . > format long . % > y=sin(2*pi*x);. > pi pi . % . ans = > plot(x,y);. 5 ( ) . > format short . % . > pi ans = . (. ( . ). ) .. > a=0:10 %a 0 10 1 .. a = 0 1 2 3 4 5 6 7 8 9 10. x x : . > a=1:2:10 %a 2 sin () . a= 1 3 5 7 9 OK . > a=0 :1 % . a= ( ) .. ( ) Octave . > a(3) % a 3 . Octave . ans = . ( ) C 0 Octave 1. > xlabel('x axis'); %x . 0 a(0) > ylabel('y axis'); %y . > title('test'); . % . > . legend('sine curve'); % . > a(0). error: subscript indices must be either Octave gnuplot . positive integers or logicals. gnuplot . gnuplot . 3. help > a=[2;3;4] . % . help a =. 2. 3. ( ) plot 4. > help plot ; . 'plot' is a function from the file C:.. (matrix). --Function File: plot (Y). --Function File: plot (X,Y) ( ).
3 --Function File: plot (X,Y, PROPERTY, VALUE,. 3 3 1 2 3 .. plot plot(Y), plot(X,Y) A = 4 5 6 . 7 8 9 .. 3. > A=[1 2 3; 4 5 6 ; 7 8 9]. A =. 1 2 3. (row vector) 4 5 6. [] 7 8 9. ( ) 3 3 A (2,3) . > A(2,3). ( ) a=(2 3 4) ans = 6.. > a=[2 3 4] . % . a = ' . 2 3 4. ( ) a=(1 2 3 4) . : . > a=1:4. a=. > a=2:4. 1 2 3 4. a =. > a'. 2 3 4. ans =. 1.. 2. (column vector) 3. 4. ; . ( ) . ( ). 2 .. a = 3 . 4 . * . ( ). 4. 1 2 3 1 B=M A > N^-1.. M = 4 5 6 A = 2 ans =. 7 8 9 3 . M A ( ) B (singular) B^-1 . > M=[1 2 3; 4 5 6 ; 7 8 9]. M= (Inf) . 1 2 3. 4 5 6 > B^-1. 7 8 9 warning: inverse: matrix singular to > A = [1;2;3] machine precision, rcond =0. A = ans =. 1 Inf Inf Inf 2 Inf Inf Inf 3 Inf Inf Inf > B=M*A (. (*)) (determinant). (determinant). B = det . 14. 32. > det(N). 50 ( ). ans = -5. > det(B). ans = 0 %B 0. ( ) 1 2 3 1 2 3 B=M N.)
4 M = 4 5 6 N = 0 5 0 (. ( ). ). 7 8 9 1 0 2 .. ( .* ../ .^ ) . > N=[-1 2 3; 0 5 0 ; 1 0 -2]. N = . -1 2 3 ( ) y=x2 0 x 1 . 0 5 0. 1 0 -2 ( )x . > B=M*N. B = > x=0 :1; %x . 2 12 -3. 2 33 0 y=x^2 y . 2 54 3.. * - ^ > y=x^2;. error: for A^b, A must be square x^2 x 2 . 1 11 x 2 (x . x) . ^-1 x (squre). 1. ( ) N N (N 3 3 ) 2 .. 5. > y=x.^2; . %^ > X=[0 2; 0 0]. X =. 0 2. 2 . 0 0. plot(x,y) > exp(X). ans =. ( ) ( ). > expm(X).. ans =. 3 3 1 2. 0 1.. > A=[1 2 3; 4 5 6; 7 8 9]; exp(X) expm(X) . > A.*A. ans =. 1 4 9 2 . % . 16 25 36 . % 4. (. ( ). ). 49 64 81. > A*A .. ans = save . 30 36 42. 66 81 96 load . 102 126 150 ( ) M a . A .. 2 A.*A . A 2 A*A .. > save M a . Octave MATLAB . MATLAB . X m n X11 save -V6 . sin(X) sin(X11) sin(X12) . > save M a -V6. m n exp(X) .. exp .. ( ) . 1. (. e X. = X n ) . n = 0 n! > load expm(X).
5 M a .. ( ) M . (-ascii) . > save -ascii M.. 6. a == 0. for . for ( ) . C FORTRAN . a >= 0. (FORTRAN do ). ( ) 0 .. 10 OR | . a a<0 a>5 . > a=0 :10 a<0 | a>0. for AND & 0<a<5 .. for k=1:101. a(k) = * (k-1) ;. end a>0 & a<5. ( ) n=10 n! . > n=10; %n . > a(1)=1; %a 1 1 .m . > for k=2:n %2 n (n-1) .. > a(k)=k*a(k-1); . %k . k-1.. k .. > end . % . > a(n) % a n . ans = 3628800 ( ). ). 10! ( ) sin ( . > prod(1:10) %prod ) . ans = 3628800 ( ). ). x=0 :5;. y=sin(2*pi*x);. plot(x,y);. xlabel('x axis');. if ylabel('y axis');. title(' ');. ( ) a b 0 1 . if a < 0 . b=0. else b=1. end . a=0 = .. 7. ( ) ( ) 1 .. (Current from detector (nA) ) 10nA .. ? 2 .. C: Users ABC Octave for if . cd . > cd C: Users ABC Octave .. % cd . > sinplot % .. > C: Users ABC Octave sinplot . 10 nA 1 .. 0.. 1.. 2. threshold . 3. for . kk . threshold . R 1.
6 R 0 .. 4. R (( .. )).. UNIX . cd (change directry ). ls . pwd . 8. % ( ). clear .. % 1 0 2 . data=[0 2 5 1 30 1 2 1 3 0 55 1 0 9 2 1 0 3 4 0];.. % ? ( 2 2. 10nA . threshold = 10; % . for k=1:20 20 . % . if data(k) > threshold ).. % .png wiki . R(k) = 1; %R 1 . else ( . R(k) = 0; 0 . % .png ). end end num=sum(R) %R num . sum(R) R .. > cosmic num = 2 ( ) 2 . ( Octave Matlab ). Octave for if .. % clear . data=[0 2 5 1 30 1 2 1 3 0 55 1 0 9 2 1 0 3 4 0];. For x y 2 . threshold = 10;. R=(data > threshold); . % if . num=sum(R). 200 . R=(data > threshold) data . threshold ( ) 1/3 . 1 0 for k=1:3:ymax . R . data=[0 2 ] R=[0 1 0] data=[-1 12. 2] R=[0 1 1 1] R 0 1.. for .. for .. 9.. % clear function . A=imread(' '); . % . * . M=double(A(:,:,3)); . % . [xmax ymax]=size(M); . % . % function num=cosmicFunc(data,threshold). y=0.
7 Function num=cosmicFunc(data,threshold). for k=1:3:ymax %y for . cosfunc . % . x=0; y=y+1;. n . [m n]=size(data); % . for h=1:3:xmax %x for . for k=1:n x=x+1;. if data(k) > threshold 200 . if M(h,k) < 200 % . R(k) = 1;. 1 . map(x,y)=1; % . else else R(k) = 0;. 0 . map(x,y)=0; % . end end end end num=sum(R). end . figure; % . size .. pcolor(flipud(map)); % .. colormap(gray); % data 3 4 [m n]=size(data) . shading flat . % . m=3 n=4 . For if data threshold . num cosmicFunc . % clear . A=imread(' ');. M=double(A(:,:,3)<200); % . [xmax ymax]=size(M); function .. map=M(1:3:xmax,1:3:ymax); .. figure; % .. data_large . data_large . 5. (. (function) . function . > data_large=sprand(1,1000, )+. sin exp rand(1,1000) * + rand(1,1000)* > save data_large . sprand, rand . help .. (function) . * function . Octave help .. 10. % clear load thresh=0 :1.)
8 [m n]=size(thresh);. for k=1:n num(k)=cosmicFunc(data_large,thresh(k)); . % . cosmicFunc . end plot(thresh,num). xlabel('Threshold (nA)'); . % . ylabel('Counts');. title('Threshold dependence');. nA . ( threshold= ) . cosmicJudge .. > load % . > threshold= ; . % . > cosmicFunc(data_large,threshold). ans = 48 ( ) 48 . nA . > threshold= ;. > cosmicFunc(data_large,threshold). ans = 41 ( ) 41 .. function Threshold nA . function nA .. ( ) cosmicFunc ( . threshold) .. cosmicFunc [m n]=. size(data) n cosmicFunc . data_large threshold .. num . ( n) .. 11.. cosmicFunc data [m . n]=size(data) .. ( ) ( ) .. C (function) . % . Clear . global n2 %n2 . load thresh=0 :1;. [m n]=size(thresh);. [m2 n2]=size(data_large);. %data_large n2 . for k=1:n R(k)=cosmicFunc2(data_large,thresh(k));. end . plot(thresh,R) % .. % function num=cosmicFunc2(data,threshold).
9 Global n2 %n2 . for k=1:n2 %n2 . if data(k) > threshold R(k) = 1;. else R(k) = 0;. end end num=sum(R);. n2 .. path . for . [m,n]=size(thresh) . for .. 12.
