필터 지우기
필터 지우기

Using read write data meory block using indirect addressing - SIMULINK

조회 수: 3 (최근 30일)
Michael
Michael 2024년 2월 20일
댓글: Fangjun Jiang 2024년 2월 26일
I need a storage array data memory - block - effectively circular buffer -- write 1 entry at a time -- but I have to continually calculate the mean
Currently, I have set up a data memory block - initialized with 1: 1024 and have hardcoded a read memory block accessing all 1024 -- which I iuse to calculate a mean - No real issue (I think)
For simplisticity -- I have a constand writing into a write data memory block
I can adjust the write data memory block to write into any hard coded element of the data memory block e.g. A(1) A(50) etc
but I want to use the data memory block as a circular arry -- so I want to use A(posn) where posn is a variable that is changing over time
I can't find how to make this work any where on the web -- just how to write one element into the block
it is so simplistic that I must be missing something obvious
Trying to avoid globals - but if thats a solution -- not getting that right either :-(

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2024년 2월 21일
  댓글 수: 2
Michael
Michael 2024년 2월 25일
Thanks
Not heard of buffering before -- however I have things already in meory and want to use as a buffer, rather than trying to make a buffer -- I could use that -- but not here
The assignment stream sounds like I have to pull everything out of the buffer - change 1 things as I put things back in
Found a comment else where that the overhead of the way that was impliment in simulink would kill me
That answer also suggested -- don;'t do it -- use a mathlab function -- so that is what I did
Thanks anyway
Fangjun Jiang
Fangjun Jiang 2024년 2월 26일
If you are open to use the MATLAB Function block, I would agree that is the best approach for your task.

댓글을 달려면 로그인하십시오.

카테고리

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

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by