0
使用Arduino,NeoGPS和MPU6050我可以在SD卡上记录一些数据。使用索引(或高效解决方案)替代“Cat”替换行或列
在Matlab上,我将MPU6050的加速度从byte值转换为m/s^2。
- 的代码加载Matlab的数据
- 它提取斧AY AZ
- 呼叫从字节转换为米/秒^ 2
- 一个函数,它定义了所有列成为级联
- 它加到了所有列
我有一个土木工程师回地面,所以我不是很PRA与编码有关。
我想知道是否存在一个更有效的解决方案,特别是使用索引?
这里我哑代码
%Open the file
filename= uigetfile ('.csv');
fileID = fopen (filename);
logmpu6050 =csvread(filename);
fclose (fileID);
%Converting acceleration from Byte to m/s^2
[ax,ay,az]=convms(logmpu6050);
%Replacing the old accelaration values with the new
cat1=logmpu6050(:,1:8);
cat2=cat(2,ax,ay,az);
cat3=logmpu6050(:,13:15);
newlogmpu6050= cat(2,cat1,cat2,cat3);
永远感谢您的耐心!