Simulink - MATLAB- I have a matlab function block in Simulink with an if-statement, only one of the two actions of this if statement is executed, why? -
i have following function in simulink block. takes input value of xi , of xihat, , assess whether xihat should updated or not. want output whether there update, therefore variable update takes value 1 if xihat updated , -1 if not. when run simulink programme, expected values xihat (when plotted, data similar xi stairs kind of appearance). value of -1 of simulation time. not coherent fact value of xihat updated. have included disp('yes') show when if statement executed. in short, when condition positive definite, xihat should updated , should assigned 1 , former executed. how possible?
i have tried run exact same function same data in matlab script , runs , coherent xihat. have attached image of subsystem in block located.
i tried change variable name, change order of statements, output conditions etc , nothing seems help.
simulink subsystem matlab block.:

Comments
Post a Comment