MATLAB Function ブロックの使い方について
Show older comments
以下のFunctionをMATLABFunctionとして実装したいと考えています。
このとき計算の結果をyとして出力したいと思うのですが出力yの値が反映されずエラーが出てしまいます。
どのようにすれば解決しますか
エラー内容
関数または変数 'y' が未定義です。ローカル変数への 1 番目の代入は、そのクラスを特定します。
function y = A (u,a,b)
al = u; % input signal [V]
s = a; % bit
F = b; % [V]
L_v = F/2;
for m=1:1:s
if m == 1
Vth = 0;
y(1) = ( sign(al) + 1 ) / 2;
end
if m ~= 1
y(m) = ( sign (al - m ) + 1 ) / 2 ;
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Author Block Algorithms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!