Why is matlab unable to fill my array fully during real time data acquisition
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a real time wireless receiver that creates an object in MATLAB.
The object is an array containing 128 numbers from 4 columns. I need to retrieve the values from these four columns and do signal processing on them separately.
I run the code:
let `Obj` be the object which retrieves data in real time then we create four vectors for the four channels separately as follows
for i = 1:128
x_1(i) = Obj(i,1)
x_2(i) = Obj(i,2)
x_3(i) = Obj(i,3)
x_4(i) = Obj(i,4)
end for
Where `x_1`...`x_4` are 128x1 vectors initialized to be zero.
However, the problem is that although `x_1` and `x_2` are completely filled with the data from the `Obj` but `x_3` and `x_4` remains zero except for first few elements. It seems that MATLAB simply jumped over the last two vectors without filling them up.
Why am I getting this problem? Does this have something to do with MATLAB's JIT compiler? Is the memory transaction time (between retrieving from the `Obj` and writing to the vector) and that causes some problems in MATLAB?
댓글 수: 0
채택된 답변
Image Analyst
2015년 2월 7일
Before the loop starts, put this on a line:
Obj
Then set a breakpoint and look in the command window and see what the values are for column 3 and 4. You need to do that to see if it's Obj that's zero, or if it's just skipping the lines of code in the for loop (highly doubtful). I'd bet that the Obj columns are zero before going inside the for loop.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Signal Generation, Manipulation, and Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!