MATLAB Answers

Create vector with values from the same source

1 ビュー (過去 30 日間)
Thiago Nogueira
Thiago Nogueira 2020 年 7 月 12 日
回答済み: Chaitanya Mallela 2020 年 10 月 22 日
Would it possible, in Simulink, to for example, record all the values coming out of a truth table until a certain value is detected and create a vector with all those values?
Example
A truth table can either output 1, 2, 3 or 4
Create a vector with all the numbers that it outputs different then 4 like [1 2 2 3 1 3 2]
Then when 4 is detected it stops inputing values.
Thanks very much for the help

  0 件のコメント

サインインしてコメントする。

回答 (1 件)

Chaitanya Mallela
Chaitanya Mallela 2020 年 10 月 22 日
Yes, it would be possible if you are transmitting the truth table data serially using buffer block and conditionally logging the data using enabled subsystem and by using Stop Simulation block once the threshold is reached which will stop the simulation or disabling the subsystem till the simulation ends.Below is the simulink model with 10 elements taken from constant block and threshold value set at 8. The enabled subsystem contain a simple wire connecting input and output.

  0 件のコメント

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by