Why is matlab unable to fill my array fully during real time data acquisition

1 view (last 30 days)
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?

Accepted Answer

Image Analyst
Image Analyst on 7 Feb 2015
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.

More Answers (0)

Categories

Find more on Signal Generation, Manipulation, and Analysis in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!