So i want to curve fit special function ?

2 ビュー (過去 30 日間)
fiordi
fiordi 2022 年 12 月 4 日
コメント済み: fiordi 2022 年 12 月 5 日
Hy guys i have this math function , my teacher has give me same values of rssi and d . So his assign me to curve fit this and to find the C and n values.
here is the rssi and d values:
RSSI = [ -42.11, -46.395833333333336, -48.40816326530612, -53.91836734693877, -60.52542372881356, -54.945454545454545, -55.31818181818182, -59.875, -61.36842105263158, -65.38461538461539, -64.6078431372549, -74.02564102564102, -68.86792452830188, -72.1842105263158, -72.96078431372548, -74.375 ,-72.36206896551724, -72.7 ] ;
d = [ 0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.5,2,2.5,3,3.5,4,4.5,5];
My attemp on the matlab app costum curve fit : (So is this correct i have wtite ?)
  2 件のコメント
Torsten
Torsten 2022 年 12 月 4 日
Your custom equation is wrong.
Should be
-10*n*log10(d) + C
instead of
-10*n*log(d) + C
fiordi
fiordi 2022 年 12 月 5 日
thx

サインインしてコメントする。

採用された回答

Matt J
Matt J 2022 年 12 月 4 日
編集済み: Matt J 2022 年 12 月 4 日
Just do an analytical fit,
RSSI = [ -42.11, -46.395833333333336, -48.40816326530612, -53.91836734693877, -60.52542372881356, -54.945454545454545, -55.31818181818182, -59.875, -61.36842105263158, -65.38461538461539, -64.6078431372549, -74.02564102564102, -68.86792452830188, -72.1842105263158, -72.96078431372548, -74.375 ,-72.36206896551724, -72.7 ] ;
d = [ 0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,1.5,2,2.5,3,3.5,4,4.5,5];
p=polyfit(-10*log10(d),RSSI,1)
p = 1×2
2.0067 -61.7833
n=p(1);
C=p(2);
f=@(d) -10*n*log10(d(:))+C;
ds=linspace(0.1,5,1000);
plot(d,RSSI,'o',ds,f(ds))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by