How to get V(n+0.5) in matlab OR Simulink?

2 views (last 30 days)
Uzair Amin
Uzair Amin on 13 Sep 2021
Commented: Walter Roberson on 13 Sep 2021
Hello, Imagine a situation in which you are inputing two changing values into a function block from other block in simulink and you want input1(n+0.5),input2(n+0.5) inside the block to process further.
Is there any block to perform this operation or how to perform this behavior in coding inside function block?
Thanks in advance.
  4 Comments
Uzair Amin
Uzair Amin on 13 Sep 2021
Can't I use step fuction with step time = -0.5 and multiplying that with input V(n)
Walter Roberson
Walter Roberson on 13 Sep 2021
If that were able to work at all, you would need a positive step time in order to example input1(n+0.5). You would be forecasting the development of input1 in the future. But can you rely on the forecast?
function yes_no = will_I_lie(n)
persistent last_n_forecast last_yes_no
if n == last_n_forecast
yes_no = ~last_yes_no;
end
future_n = n + 0.5;
future_yes_no = will_I_lie_in_the_future(future_n);
last_n_forecast = future_n;
last_yes_no = future_yes_no;
yes_no = rand() < 0.5;
end
... when time n+0.5 comes around, I will lie if and only if I did not lie when I forecast about time n+0.5 . But I already used the information about the future, and now all my forecasts are messed up because I did not act in the future the way that I forecast I would act in the future...

Sign in to comment.

Answers (0)

Categories

Find more on Simulink 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!