Creating a function with a logical output.
古いコメントを表示
Hi all,
I am quite confused. I have a function say like this:
function [output] = TLU( inputs, weights, threshold )
activationMagnitude = sum(weights.*inputs)
if activationMagnitude > threshold
output = true;
else
output = false;
end
But when I use class(ans) it always shows a char data type - despite me specifying the output as either true or false!
Why is this?
Best regards,
Craig
1 件のコメント
Azzi Abdelmalek
2013 年 2 月 14 日
What ans represent?
採用された回答
その他の回答 (1 件)
José-Luis
2013 年 2 月 14 日
It does return logical for me.
What does
class(TLU(rand, rand, rand))
return? If ans returns something different, you may have overwritten its value before you call to class()
1 件のコメント
Azzi Abdelmalek
2013 年 2 月 14 日
編集済み: Azzi Abdelmalek
2013 年 2 月 14 日
The question is what ans represent?
カテゴリ
ヘルプ センター および File Exchange で Language Support についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!