Kayıtlar

filter data

Resim
y ( n ) = 1 4 x ( n ) + 1 4 x ( n − 1 ) + 1 4 x ( n − 2 ) + 1 4 x ( n − 3 ) load count.dat x = count(:,1); Create the filter coefficient vectors. a = 1; b = [1/4 1/4 1/4 1/4]; Compute the 4-hour moving average of the data, and plot both the original data and the filtered data. y = filter(b,a,x); t = 1:length(x); plot(t,x, '--' ,t,y, '-' ) legend( 'Original Data' , 'Filtered Data' )

surface plot

Resim
[X,Y] = meshgrid(1:0.5:10,1:20); Z = sin(X) + cos(Y); surf(X,Y,Z)

POLYFIT

Resim
x = linspace(0,4*pi,10); y = sin(x); Use  polyfit  to fit a 7th-degree polynomial to the points. p = polyfit(x,y,7); Evaluate the polynomial on a finer grid and plot the results. x1 = linspace(0,4*pi); y1 = polyval(p,x1); figure plot(x,y, 'o' ) hold on plot(x1,y1) hold off

POLYVAL

polyval   p ( x ) = 3 x 2 + 2 x + 1  at the points  x = 5 , 7 , 9 p = [3 2 1]; x = [5 7 9]; y = polyval(p,x) y = 1×3 86 162 262 I =  3 − 1 ( 3 x 4 − 4 x 2 + 1 0 x − 2 5 ) d x . Create a vector to represent the polynomial integrand  3 x 4 − 4 x 2 + 1 0 x − 2 5 . The  x 3  term is absent and thus has a coefficient of 0. p = [3 0 -4 10 -25]; Use  polyint  to integrate the polynomial using a constant of integration equal to  0 . q = polyint(p) q = 1×6 0.6000 0 -1.3333 5.0000 -25.0000 0 Find the value of the integral by evaluating  q  at the limits of integration. a = -1; b = 3; I = diff(polyval(q,[a b]))

FILE PERMISSONS

'r' Open file for reading. 'w' Open or create new file for writing. Discard existing contents, if any. 'a' Open or create new file for writing. Append data to the end of the file. 'r+' Open file for reading and writing. 'w+' Open or create new file for reading and writing. Discard existing contents, if any. 'a+' Open or create new file for reading and writing. Append data to the end of the file. 'A' Open file for appending without automatic flushing of the current output buffer. 'W' Open file for writing without automatic flushing of the current output buffer.

XLSREAD

 [num,text]=xlsread("iks.xlsx") num =      1      2      3      4      5      6 text =   7×2 cell array     {'Harfler'}    {'numaralar'}     {'a'      }    {0×0 char   }     {'b'      }    {0×0 char   }     {'c'      }    {0×0 char   }     {'d'      }    {0×0 char   }     {'e'      }    {0×0 char   }     {'f'      }    {0×0 char   } XLSX DOSYASI Harfler numaralar a 1 b 2 c 3 d 4 e 5 f 6

FILE OPEN READ

filem=fopen("deneme.txt","r") if filem<0     fprintf("file could not opened.."); else     while feof(filem)==0        t=fgetl(filem);         fprintf("%s\n",t);     end end z=fclose(filem); if z==0    fprintf("end of the program"); else     fprintf("an error just accured while closing the file") end fprintf("spesifik veriyi almak için tekrar çalıştırıyoruz\n"); newfilem=fopen("numm.txt","r"); a=1; while a~=0     if str2num(newfilem(a))==5        fprintf("başarılı, %d",a)        a=0;     end end fclose(newfilem);