フィルターのクリア

Why error function not work?

4 ビュー (過去 30 日間)
Amna El-tawil
Amna El-tawil 2018 年 11 月 15 日
コメント済み: madhan ravi 2018 年 11 月 15 日
The error function doesn't work with me. I do not get any result.
If anyone knows the problem, I will be thankful
for j1=1:3,
yi=w'*x(:,j1); % Network output
y=sign(yi);
if sum(y-d(1,:)') > 0
error=error+1
end
end
  8 件のコメント
Guillaume
Guillaume 2018 年 11 月 15 日
編集済み: Guillaume 2018 年 11 月 15 日
It is very unlikely that the code shown does whatever it is required to do. The whole thing doesn't make sense. Of course, if the code was commented as it should be, we would have an idea of what it was supposed to do (hint!).
Note:
Madhan: size(y) is 4 by 1
Amna: size(y) is 4 by 3
size(y) is always going to be size(w, 2) by 1. It can't have 3 columns since the multiplication in w' * x(:, 1) guarantees it will have one column. It will has as many rows as w has column, which is no whose value was not given. If no is 3 the subtraction will succeed. ni has to be 4 for the multiplication to work.
Also note that naming a variable error is a bad idea. It's already the name of a matlab function.
madhan ravi
madhan ravi 2018 年 11 月 15 日
Perfect explanation @Guillaume

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by