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?

采纳的回答

Image Analyst
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 个)

类别

Help CenterFile 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!

Translated by