Need help with storing live data from sensors into array
Show older comments
this is my code. I want to store the incoming data into my array/matrix whichever would do the trick. This keeps overwriting the previous data into the array. I want the data to be added up at the bottom.
I am also getting this problem. "Conversion to cell from uint16 is not possible."
iterate = 0;
while 1
iterate =plus(iterate, 1); %counter
disp(iterate);
Gyro_X = readRegister(MPU9250, GYRO_XOUT_H, 'uint16')
Gyro_Y = readRegister(MPU9250, GYRO_YOUT_H, 'uint16')
Gyro_Z = readRegister(MPU9250, GYRO_ZOUT_H, 'uint16')
pause(1/10);
%Gyro = table(iterate, Gyro_X, Gyro_Y, Gyro_Z);
Gyro = {};
Gyro(i) = [ iterate, Gyro_X, Gyro_Y, Gyro_Z];
end
Accepted Answer
More Answers (1)
ahmed nebli
on 29 Dec 2018
Edited: madhan ravi
on 29 Dec 2018
0 votes
what you need to do is create a vector/matri without defining its size first (e.g.: A=[]; ) then use the command vertcat.
1 Comment
Samuel Louise
on 29 Dec 2018
Categories
Find more on Scopes and Data Logging in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!