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!