How to load a two-dimensional array using 'From File ' block in Simulink
Show older comments
I am trying to load 2x180 matrix using 'From File ' block and then display it with 'Scope' block in Simulink
the first row of the matrix includes time values [-5.0002 :0.0002: -4.9644 ] and second row includes corresponding amplitude values.
I saved the 'signal_5' (in the attachment) as 7.3 MAT-file format.I arranged the matrix to comply with the following link:
how should I set 'Sample Time' and Simulation Stop time? or any other parameters
Although I tried to do it, I could not display amplitude plot.
4 Comments
stozaki
on 20 Jan 2020
Why is the simulation start time -5.0002? Is there any reason that is not 0?
ser
on 20 Jan 2020
ser
on 24 Jan 2020
Thanks your suggenstion.
Waveform differences are the effect of sampling. The time interval of the data stored in the .mat file is 0.002. In Simulink, the sample rate is 0.002. This seems reasonable when simulating discrete systems.
However, when simulating a continuous system with Simulink, the solver needs to be changed. I attached an example.
When simulating with Simulink, please set an appropriate solver type of configuration set.
This issue is independent of the tool version.
Regards,
stozaki
Accepted Answer
More Answers (0)
Categories
Find more on Scopes and Data Logging in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!