and I have one more question : whether and how the command pi will make this more accurate?
Based the codes:
vect1=[1 2 4 6 3];
n1 = sind(vect1);
disp('the sin of vect1 degrees is:');
disp(n1);
the output is:
0.0175 0.0349 0.0698 0.1045 0.0523
But I saw the information:' For integers n, sind(n*180) is exactly zero, whereas sin(n*pi) reflects the accuracy of the floating point value of pi '
And if I use the command pi, like this:
vect1=[1 2 4 6 3];
n1 = sind(vect1*pi);
disp('the sin of vect1 degrees is:');
disp(n1);
the output is:
0.0548 0.1094 0.2176 0.3231 0.1638
the two output is different ,what is wrong? How can I use the command pi correctly ?