i am getting an error " mcc require the program to assign the value to output argument logistic"

Main error coming i command window is given below:
Undefined function or method 'logistic' for input arguments of type 'double'.
Error in ==> TS>feed_forward_signals at 316 V_OUT(row) = logistic(V_OUT(row));
Part of Code is given here:
function logistic=x
if x>100.0
x=1.0;
else if x<-100
x=0.0;
else x=1.0/(1.0+exp(-x));
end
end
end
function [V_OUT]= feed_forward_signals(MAT_INOUT, V_IN, V_OUT, V_BIAS, size1, size2, layer)
for row = 1:size2
V_OUT(row)=0;
for col = 1:size1
V_OUT(row)=V_OUT(row)+MAT_INOUT(row, col)*V_IN(col);
end
V_OUT(row)=V_OUT(row)+V_BIAS(row);
end
if layer==0
V_OUT(row) = exp(V_OUT(row));
end
if layer==1
V_OUT(row) = logistic(V_OUT(row));
end

 採用された回答

Phillip
Phillip 2014 年 11 月 18 日
Hi
Your function definition of logistic is wrong: You have:
function logistic=x
It should rather be something like:
function y = logistic(x)
Hence matlab is not seeing logistic as a valid function.
Regards, Phil

1 件のコメント

vandana
vandana 2014 年 11 月 18 日
編集済み: vandana 2014 年 11 月 18 日
Thank you very much...:)
Hi i have changed my program as and now is is running without error but results are not coming correct. can you please check once. Code after correction
function x=logistic(x)
if x>100.0
x=1.0;
else if x<-100
x=0.0;
else x=1.0/(1.0+exp(-x));
end
end
end
function [V_OUT]= feed_forward_signals(MAT_INOUT, V_IN, V_OUT, V_BIAS, size1, size2, layer)
for row = 1:size2
V_OUT(row)=0;
for col = 1:size1
V_OUT(row)=V_OUT(row)+MAT_INOUT(row, col)*V_IN(col);
end
V_OUT(row)=V_OUT(row)+V_BIAS(row);
end
if layer==0
V_OUT(row) = exp(V_OUT(row));
end
if layer==1
V_OUT(row) = logistic(V_OUT(row));
end

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

タグ

質問済み:

2014 年 11 月 18 日

編集済み:

2014 年 11 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by