Just as we used a for loop to create a table for converting degrees to radians i
ID: 3774564 • Letter: J
Question
Just as we used a for loop to create a table for converting degrees to radians in Example 9-2, we can use a while loop for the same purpose State the Problem Create a table that converts degrees to radians, from 0 to 360 degrees, in increments of 10 degrees. Describe the Input and Output Input An array of angle values in degrees Output A table of angle values in both degrees and radians Develop a Hand Example For 10 degrees, radians = (10)pi/180 = 0.1745 Develop a MATLAB Solution First develop a flowchart (Figure 9.6) to help you plan your code.Explanation / Answer
Matlab code
for k=1:36
degree(k,:)=k*10;
radian=degree.*(pi/180);
end
T=table(degree,radian)
degree radian
______ _______
10 0.17453
20 0.34907
30 0.5236
40 0.69813
50 0.87266
60 1.0472
70 1.2217
80 1.3963
90 1.5708
100 1.7453
110 1.9199
120 2.0944
130 2.2689
140 2.4435
150 2.618
160 2.7925
170 2.9671
180 3.1416
190 3.3161
200 3.4907
210 3.6652
220 3.8397
230 4.0143
240 4.1888
250 4.3633
260 4.5379
270 4.7124
280 4.8869
290 5.0615
300 5.236
310 5.4105
320 5.5851
330 5.7596
340 5.9341
350 6.1087
360 6.2832
>>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.