Change the buffer size during a simulation
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ali Ghader
am 16 Aug. 2017
Kommentiert: Walter Roberson
am 19 Aug. 2017
I am trying to log a reading from a sensor for 2 seconds when simulink starts in order to define a suitable size for the buffers/matrices that I am using in signal analysis.
-Would there be a way to change the size of the buffer after the start of the simulation ?
*I tried to pause the simulation and update the parameters and resume but unfortunately it didn't work, it still gives me the same error: ""Cannot change parameter 'Output buffer size (per channel): (N)' of 'RotorBalancing/Subsystem1/Buffer' while simulation is running""
I used this code for this sake:
set_param('RotorBalancing','SimulationCommand','start');
set_param('RotorBalancing','SimulationCommand','pause');
set_param('RotorBalancing/Subsystem1/Buffer','N','1000')
set_param('RotorBalancing/Subsystem1/Buffer2','N','1000')
set_param('RotorBalancing','SimulationCommand','update');
set_param('RotorBalancing','SimulationCommand','continue');
- I tried to enable the buffer after the 2 seconds and I still got the same error.
-In case changing the buffer size won't work. Is there a better option to store the signal and prepare it for signal analysis (FFT) ?
0 Kommentare
Akzeptierte Antwort
Saurabh Gupta
am 18 Aug. 2017
Buffer block dialog parameters can not be modified while the simulation is running or paused. You can observe this by trying to interact with the parameters in Simulink environment, and you will notice that they are edit-disabled.
If you want to post-process the signal, you can always log the signal to a MAT file or the workspace and then, use MATLAB functions for FFT to perform the required analysis. The following documentation lists all the relevant functions in MATLAB.
Hope this helps!
7 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spectral Analysis finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!