フィルターのクリア

Plot function with different parameter

2 ビュー (過去 30 日間)
Grega Mocnik
Grega Mocnik 2017 年 12 月 19 日
編集済み: Adam 2017 年 12 月 19 日
I have a problem with plot calculated function with various parameter. My code is:
N = 22.5;
f = 868;
d_ref = 1;
floor_PLF = [0, 9, 19, 24];
floor_n = [0, 1, 2, 3];
dist_step = 0.5;
dist_max = 50;
IPL = zeros(4 ,300);
FSPL = 20 * log10(d_ref) + 20 * log10(f) - 28;
test = floor_PLF(3);
figure;
for counter = 1:length(floor_n)
d = 0 : dist_step : dist_max;
f_PLF = floor_PLF(counter);
f_n = floor_n(counter);
floorPL = f_PLF .* f_n;
IPL = FSPL + N *log10(d/d_ref) + (floorPL(counter));
plot(d, IPL, '.'); hold on;
end
I get error: index exceeds matrix dimensions. in statement where I have IPL = FSPL .... And my code plot just one function, the first one.
I would like plot different function with different parameter from floor_PLF and floor_n array.
  1 件のコメント
Adam
Adam 2017 年 12 月 19 日
編集済み: Adam 2017 年 12 月 19 日
floorPL
appears to be scalar and there is no need to index into it with 'counter' since it is calculated within that loop each time.
IPL = FSPL + N *log10(d/d_ref) + (floorPL);
looks like it would work at a glance.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by