필터 지우기
필터 지우기

Reading from large workspace array slows down my Simulink simulation

조회 수: 3 (최근 30일)
Michael
Michael 2019년 5월 22일
답변: Michael 2019년 5월 22일
I have a large workspace array sized ~200x500x4000. This contains data for 4000 uint8 images captured with a camera. If I were to change the size of my workspace array to say 200x500x8 my simulation takes about 30 seconds per image. If I try to run with the full sized 4000 element array it takes over 5 minutes per image.
I have to read this array in a matlab function block in my Simulink model where I parse the data and output a few pixels of data at a time to the rest of the model.
What is the recommended way to deal with large datasets like this? I tried storing my data in a .mat file and using the matfile function to load parts of it at a time but when I try to use the matfile function in my Matlab function block I get an error that matfile is not supported for code generation. I am running in Normal mode, running in Accelerated mode did not result in an improvement.

채택된 답변

Michael
Michael 2019년 5월 22일
Solved. I ended up using a data store block in Simulink to access my large array as a global variable. Running in accelerated mode I was able to get my simulation time down to ~10 seconds per frame
https://www.mathworks.com/help/releases/R2011b/toolbox/simulink/ug/bsds2rv.html#bsdud7d-1

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by