
Keep output value from a switch block constant for the rest of the simulation time at time when switch output first one?
    6 次查看(过去 30 天)
  
       显示 更早的评论
    
I want to store MPPT_Enable value when it becomes 1 for the 1st time and keep the value one(1) for the rest of the simulation. How can i do that? Thank you all.

0 个评论
回答(1 个)
  Rajanya
 2025-1-31
        You can achieve the same with a combination of a 'OR' and a 'Memory/Delay' block. 
If the 'Memory' block is connected in feedback to one of the inputs of the 'OR' block, once the output of the 'OR' block becomes high(1), this value is stored by the 'Memory' block. In the next time step, regardless of the other input, the 'OR' block will continue to output a high value because it receives the stored high value from the 'Memory' block as one of its inputs. Consequently, once set to high, the output of the 'OR' block remains high as this goes on in a cycle.
The connection is shown as follows:

Hope this answers your question. Thanks!
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

