Store values in an array from loop
显示 更早的评论
Hello everyone,
I have a vector HDA which is associated to different lists of angles.
For each list (a1, b1, ... etc.) i need to convert all the values in radians and make the circular average together with the standard
deviation with the functions Circ_ang2rad, circ_mean and circ_std.
Then I print the values. Clearly, I don't know how to make a proper loop so if anybody is willing to help I would be most grateful!
It would be also nice to print the result with a 'name' associated to it so that one could understand which result refers to which angle.
a1 = Asn42OH3p(:,1); %List of angles from traiectory for Asn42
b1 = Asp44O4p(:,1); %List of angles from traiectrory for Asp44
...and so on
HDA = [a1 b1 c1 d1 e1 f1 g1];
for X = HDA;
A_rad = circ_ang2rad(X);
A_bar = circ_mean(A_rad);
[s_A s0_A] = circ_std(A_rad);
fprintf('X torsion');
fprintf('\n')
fprintf('Mean resultant vector: \t%.2f \t%.2f\n', circ_rad2ang([A_bar]));
end
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!