Best way to buffer vector data in Simulink for processing over a time window
I’m working with a lidar-equipped robot, and every 0.2 seconds it provides an array of 360 values corresponding to the return intensity received at each angle. For my application, I need to do some statistical analysis on the data over a user-defined time-window. For offline processing in MATLAB, I’ve just been appending each new array of scan values to a matrix, so that I have a 360-column "Intensities" matrix which grows over time, and I can select the time-window for processing by selecting the appropriate rows from the matrix.
intensitiesMatrix(i,:) = new_scandata_array;
Now I’m trying to transition my code to Simulink (particularly because I want to use Stateflow for certain aspects of my application) and I want to do the same kind of data buffering so I can perform windowed processing on the data in real-time. For some reason I’m having a hard time figuring out the best way to collect my successive scan vectors into a form that I can then process, as I did in my regular MATLAB approach. I’ve looked a bit at Data Stores; is that the right approach? Or is there a good way to do this with matrices as I was doing in MATLAB?I’m working with a lidar-equipped robot, and every 0.2 seconds it provides an array of 360 values corresponding to the return intensity received at each angle. For my application, I need to do some statistical analysis on the data over a user-defined time-window. For offline processing in MATLAB, I’ve just been appending each new array of scan values to a matrix, so that I have a 360-column "Intensities" matrix which grows over time, and I can select the time-window for processing by selecting the appropriate rows from the matrix.
intensitiesMatrix(i,:) = new_scandata_array;
Now I’m trying to transition my code to Simulink (particularly because I want to use Stateflow for certain aspects of my application) and I want to do the same kind of data buffering so I can perform windowed processing on the data in real-time. For some reason I’m having a hard time figuring out the best way to collect my successive scan vectors into a form that I can then process, as I did in my regular MATLAB approach. I’ve looked a bit at Data Stores; is that the right approach? Or is there a good way to do this with matrices as I was doing in MATLAB? I’m working with a lidar-equipped robot, and every 0.2 seconds it provides an array of 360 values corresponding to the return intensity received at each angle. For my application, I need to do some statistical analysis on the data over a user-defined time-window. For offline processing in MATLAB, I’ve just been appending each new array of scan values to a matrix, so that I have a 360-column "Intensities" matrix which grows over time, and I can select the time-window for processing by selecting the appropriate rows from the matrix.
intensitiesMatrix(i,:) = new_scandata_array;
Now I’m trying to transition my code to Simulink (particularly because I want to use Stateflow for certain aspects of my application) and I want to do the same kind of data buffering so I can perform windowed processing on the data in real-time. For some reason I’m having a hard time figuring out the best way to collect my successive scan vectors into a form that I can then process, as I did in my regular MATLAB approach. I’ve looked a bit at Data Stores; is that the right approach? Or is there a good way to do this with matrices as I was doing in MATLAB? simulink data processing MATLAB Answers — New Questions