MATLAB Answers

# histogram of angles in a loop

7 views (last 30 days)
SINDU GOKULAPATI on 8 May 2021
Edited: SINDU GOKULAPATI on 10 May 2021
for i=1:n
for j=1:n
angle = transpose(rnorm{i})*rnorm{j};
if angle < cosd(20)
here for every 'i' i want histogram wrt to angles
end
end
end
i need to transform the above code in such a way that for each 'i' histogram(angles) [gap of 0.5 upto 20] has to be stored
rnorm is a 3*1 matrix
urs help is highly appretiated thanks
##### 0 CommentsShowHide -1 older comments

Sign in to comment.

### Answers (1)

VBBV on 8 May 2021
%if true
matrix(i,:)= [i;j;angle];
Did you use increment this way to store matrix
##### 1 CommentShowHide None
SINDU GOKULAPATI on 8 May 2021
that way only one value of angle will be store
i want all angles which satisfy the condition (<cosd(20)) to be stored
so that i can get histogram of angles for each 'i'

Sign in to comment.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!