Why my program always get '0' at initialization?
显示 更早的评论
function out=gett(A)
if A(1)==0
out=1;
else
out=0;
end
A(1)
end
My M-file Integrator block :initial condition=-2
Why my program always get '0' at initialization?
but workspace is correct output.
How should I avoid this case?



%
回答(1 个)
Azzi Abdelmalek
2013-1-26
编辑:Azzi Abdelmalek
2013-1-26
Your Matlab function is not an integrator, your output signal is 0 or 1
if A(1)==0
out=1;
else
out=0;
end
3 个评论
YEH
2013-1-26
Azzi Abdelmalek
2013-1-26
You are displaying the output of the matlab function. According to your code it is 0 or 1
YEH
2013-1-27
类别
在 帮助中心 和 File Exchange 中查找有关 Debugging and Analysis 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!