Calculate mean of a matrix with different indices
Show older comments
Hi,
I have a loop as below.
RCAr = []
for k = 1:length(RCA);
...
...
afstand = thisData(1:a,1);
lengte = size(dx);
lengte = round(lengte);
for i = 1:lengte-1
P1 = [dx(i), dy(i), dz(i)];
P2 = [dx(i+1), dy(i+1), dz(i+1)];
angleradian(i) = acos((P2(2)-P1(2)) / norm(P2-P1));
distance(i) = norm(P1 - P2);
end
angleradian2(:,1) = angleradian;
distance2(:,1) = distance;
RCAr(:,k) = angleradian2; %this point is not working
plot(afstand,angleradian2, '-')
hold on
end
I want to make a matrix of k columns with all the angleradians. But the indices of angleradian does not have the same length. How can I fix this?
I want to calculate the mean of each row and stdev of each row of that matrix.
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!