Calculation not having the desired array size
Show older comments
I am trying to calcumate the Acceleration using a rotational matrix, during the loop the left side is a 3x14074 (good), but the right is (3x3) which I don't want. How can I fix this so the right side has a matching size? Thanks
% Acc and AngV are sensor data sets and have sizes of 14074x3
% qF is 3x3x14074
g = [0,0,9.81];
xn = zeros(3, length(Acc));
fuse = imufilter('SampleRate',100,'DecimationFactor',1);
q = fuse(Acc, AngV);
qF = quat2rotm(q);
for i=1:length(AngV)
xn(1:3,:) = qF(:,:,i) .* Acc(i,:)' - g; % This is where the error arises
end
vi = xn .* dt;
ri = .5 * xn .* (dt^2);
I've tried every combination of transforms and reordering that I could think of, everything gives 3x3 or 3x1. Somehow I used to have this work for me, then I woke up and bam, its broken.
Error:
Unable to perform assignment because the size of the left side is 3-by-14074 and the size of the right side is 3-by-3.
Error in RunKalman (line 27)
xn(1:3, :) = qF(:, :, i)' .* Acc(i, :)' - g;
Accepted Answer
More Answers (0)
Categories
Find more on Phased Array Design and Analysis 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!