9 Aralık 2013 Pazartesi

Generalized Linear Least Squares Method

This document is useful to understand how to fit polinomial for given data. However, it doesn't contain how to generalize least squared method.

It consists of only result of this theory.

i hope to be helpful.

Warm regards...

Erim

https://drive.google.com/file/d/0B6cnkEB1ywMWVEV5THVXTDA2clk/edit?usp=sharing

4 Haziran 2013 Salı

Matlab GUI ile hazırlanmış bir programla grafik çizme(plotting with the programme written with Matlab GUI)



                                                               PROMRAM LINK:
Güncel versiyon: ReadPlot2014v701

Not:
------- 
rar içindeki
CALISTIR.m
okuyup_ciz_2.m
okuyup_ciz_2.fig
plot_fit.m
plot_fit.fig

sistem dosyalarını silmeyiniz.

CALISTIR.m dosyasını "run" etmeniz yeterlidir.

18 Ocak 2013 Cuma

Matlab' da polinom uydurma (polynomial curve fitting in MATLAB)

Matlab da polyfit komutunu kullanarak nasıl veri setine polinom uydurulur?

Aşağıdaki Matlab kodu ve açıklama satırlarını dikkate alarak inceleyiniz, bu kodu m file açıp kaydedip run edin.

şu veri setini örnek olarak alabilirsiniz


1.000000 3.200000
2.000000 11.600000
3.000000 28.200000
5.500000 28.356250
7.000000 55.400000
8.500000 263.918750
9.000000 372.000000

not defterine yapıştırıp .txt olarak kaydedin.

sütun 1: x değerleri, sütun 2: y değerleri

----------------------------------------MatLab Code----------------------------------------------------------

clear all;
close all;
clc;

%girdiler
xStr=input('veri dosya yolunu uzantsını ekleyerek yapıştırınız\n','s');
x=load(xStr); 
polyPow=input('polinom derecesini giriniz: ');

eps=0.01;
xDeg=min(x(:,1)):eps:max(x(:,1));  % veri setimizdeki 1 sütündaki en küçük ve en büyük iki değer arasında eps değeri artışlarla bir vektör oluşturuyoruz.

p=polyfit(x(:,1),x(:,2),polyPow);  %polyPow polinom derecesi değerini kullanarak veri setine polinom uydurduk

coef=p;

plot(x(:,1),x(:,2),'*');  % veri setini çizdirme
hold on;
plot(xDeg,polyval(p,xDeg),'r');
grid on;

disp('  ')
disp('coefficients of fitting curve(a(n),a(n-1),...,a(0)):')
disp(coef)

strcoef=num2str(coef);

lnc=length(strcoef);


msgbox(num2str(coef),'a(n),a(n-1),...,a(0)')

dt=dataset({coef','coefficients'});
export(dt,'file','coefficients.txt');    
dosya adı: veri.txt
polinom derecesi: 3



------------------------------------------------------------------------------------------------------