Need help with storing live data from sensors into array
古いコメントを表示
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
採用された回答
その他の回答 (1 件)
ahmed nebli
2018 年 12 月 29 日
編集済み: madhan ravi
2018 年 12 月 29 日
0 投票
what you need to do is create a vector/matri without defining its size first (e.g.: A=[]; ) then use the command vertcat.
カテゴリ
ヘルプ センター および File Exchange で Scopes and Data Logging についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!