Substracting a number from certain section of the array
이전 댓글 표시
I have a number series 8654 elements having data in format (degree) as follows (just an example):
A = [ 1.002 2.003 3.004 4.005 339.006 341.007 342.008 343.009 1.002 2.003 3.004 4.005];
I am currently using the following code to make elements in the above array having values more than 300 substracted by 360;
if (A(:,1) > 300)
A(:,2)= 360-A(:,1);
else
A(:,2) = A(:,1);
end
to make a new array in second coloumn which looks like
A = [ 1.002 2.003 3.004 4.005 21 19 18 17 1.002 2.003 3.004 4.005];
But I am getting the same array as A = [ 1.002 2.003 3.004 4.005 339.006 341.007 342.008 343.009 1.002 2.003 3.004 4.005];
I dont know which place I am going wrong !! Guidance required !!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!