Coding an if statement within MATLAB function
이전 댓글 표시
Hello,
I am coding a logarithmic quantizer using the MATLAB function block in Simulink. The quantizer has an input u and an output
, according to the following equations:
, if -
, if
and 
, if Given:
, u = positive slope ramp signal.
I tried coding the problem myself as follows, but kept receiving the error message: "Variable 'y' is not fully defined on some execution paths.", where y is the quantizer output (
). I am able to code the above functions for j = 1 for example, but not for j = the set of integers.
My question is, how can I use a while loop within the MATLAB function such that
so that I don't receive the error message above?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!