for some reason the vector being outputed is from the start time to the stop time of the simulation
Info
This question is closed. Reopen it to edit or answer.
How do I use simulink for a function then import it into a mat file
2 views (last 30 days)
Show older comments
I want to use simulink to process this equation (y=x.^3+2*x.^2+5*x+6+50*rand). everytime I run the simulink it results with a vector that is way to long. The vector being used for x is just [1 2 3 4]. The vector that is exported to my matfile is really long. This is what my simulink looks like

3 Comments
Shubham Gupta
on 7 Dec 2018
May I know, what is youar start time, stop time and Time-Step ?
If ength of your time matrix is same as the output length then you can adjust the length of the output time matrix, by adjusting start time and stop time, to get the desired length of the Output.
I hope this helps :)
Answers (1)
Shubham Gupta
on 7 Dec 2018
Edited: Shubham Gupta
on 7 Dec 2018
If you want output of 1x4 matrix, which will tell you the polynomial value of each corresponding element of X matrix, then you can simply set start time 0 time step 1 and stop time 0.99. This will allow simulink to run only 1 time i.e. at time = 0 after next 'time step' it will reach stop time and it won't run for time =1. So, you will get desired answer.
Another way is if you don't want to store the output and only want to display, then you can use "Display" block from simulink Library. (In this case you don't have to adjust time parameters.)
0 Comments
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!