フィルターのクリア

Is there any other way than manually updating the noise parameter such that the algorithm re runs for every parameter and then plots the graph ?

1 回表示 (過去 30 日間)
I have the following code where the noise parameter changes in an interval of 0.01.I want to plot the graph without manually re-entering all the data.x axis will be 0.01-0.10 and y axis will be RMSE
V_test=imnoise(V_test,'gaussian', *0.01*);%changing 0.01 till 0.10
V_test = V_test - mean(V_test(:));
V_test = V_test / sqrt(mean(V_test(:).^2));
V_test = V_test + 0.25;
V_test = V_test * 0.25;
V_test = min(V_test,1);
V_test = max(V_test,0);
H_test=abs(randn(49,472)); %multiplicative step H_test = H_test.*(W_test'*V_test)./(W_test'*W_test*H_test + 1e-9); error=sum((V_test- W_test*H_test).^2)/(sum(V_test).^2); % Errors RMSE = sqrt(error);%store this value
  2 件のコメント
Stephen23
Stephen23 2017 年 11 月 30 日
編集済み: Stephen23 2017 年 11 月 30 日
Do not use error as a variable name. error is a very important inbuilt function.

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

採用された回答

Stephen23
Stephen23 2017 年 11 月 30 日
編集済み: Stephen23 2017 年 12 月 12 日
Use a loop:
vec = 0.01:0.01:0.10; % or whatever step size you need.
out = nan(size(vec));
for k = 1:numel(vec)
V_test = imnoise(V_test,'gaussian', vec(k));
... the rest of your code
out(k) = sqrt(...);
end
  2 件のコメント
kitty varghese
kitty varghese 2017 年 12 月 12 日
U missed ":" in your code i.e V_test = imnoise(V_test,'gaussian', : ) also, when I do this change I'm getting error msg "Undefined function or variable 'imnoise'"
Stephen23
Stephen23 2017 年 12 月 12 日
@kitty Varghese: Why do you think that my answer needs : ? On each iteration you need to provide one value from vec, as my answer shows.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by