Question

In: Advanced Math

6. Used for loop, create a table that convert angle values from degrees to radians, from...

6. Used for loop, create a table that convert angle values from degrees to radians, from 0 to 180 degrees, in increments of 4.


7. Apply the same operation using the vectorization

Solutions

Expert Solution


%%Matlab code Using for loop to create a table that convert angle values from degrees to radians
clear all
close all
%Answering question 6.
fprintf('Answering question 6. ')
c=0;    %counter for 'for' loop
fprintf('Table for degree to radian conversion using for loop. ')
fprintf(' Degree Rad ')
%loop for degree to rad conversion
for i=1:4:181
    c=c+1;    %counter increament
    %angle in degree with increament 4
    angle_deg(c)=i-1;
    %angle for deg to rad conversion
    angle_rad(c)=angle_deg(c)*(pi/180);
    %printing the table
    fprintf(' %3.0f %f ',angle_deg(c),angle_rad(c))
end

%Answering question 7.
fprintf('Answering question 7. ')
fprintf('Table for degree to radian conversion using vectorization. ')
fprintf(' Degree Rad ')
%vectorization form for angle in degree
angl_deg=0:4:180;
%converted angle into rad
angl_rad=angl_deg*(pi/180);
%prnting the result
anggl=[angl_deg' angl_rad'];
fprintf(' %3.0f %f ',anggl.')

%%%%%%%%%%%%%% End of Code %%%%%%%%%%%%%


Related Solutions

Find the angle θ between the vectors in radians and in degrees. u = cos π...
Find the angle θ between the vectors in radians and in degrees. u = cos π 3 i + sin π 3 j, v = cos 3π 4 i + sin 3π 4 j (a) radians (b) degrees
Convert 6∘ to radians, correct to 4 decimal places. 6∘= ____________ rad (4 dec. places). Convert...
Convert 6∘ to radians, correct to 4 decimal places. 6∘= ____________ rad (4 dec. places). Convert 4.75 rad to degrees, correct to 4 decimal places. 4.75 rad = ____________ degrees (4 dec. places).   Question b: (2 points) Determine the length of an arc of a circle with radius 6 metres that subtends a central angle of 300∘ to two decimal places. Arc length, s= ____________ m. c A circular wheel of radius 0.55 metres is spinning at a rate of...
The number 206265 can be used to convert between arcseconds (") and radians (1 radian =...
The number 206265 can be used to convert between arcseconds (") and radians (1 radian = 2062652"). This number, however, is also the conversion between an Astronomical Unit (AU) and a parsec (pc); 1 pc = 206265 AU. Please explain in detail, with a diagram, why these numbers are the same
1. a. Determine the angle (in radians) between the vectors 〈4, −5, 6〉 and 〈−2, 2,...
1. a. Determine the angle (in radians) between the vectors 〈4, −5, 6〉 and 〈−2, 2, 3〉. b. Find the vector projection of 〈1, 2, 4〉 onto 〈1, 1, 1〉. c. Compute the cross product 〈2, 3, 4〉 × 〈1, 0, −1〉.
(1 point) Suppose a pendulum with length L (meters) has angle θ (radians) from the vertical....
(1 point) Suppose a pendulum with length L (meters) has angle θ (radians) from the vertical. It can be shown that θ as a function of time satisfies the differential equation: ((d^2)θ)/(dt^2))+(g/L)sinθ=0 where g=9.8/sec is the acceleration due to gravity. For small values of θ we can use the approximation sin(θ)∼θ, and with that substitution, the differential equation becomes linear. A. Determine the equation of motion of a pendulum with length 0.5 meters and initial angle 0.5 radians and initial...
A ball is launched at an angle of 33.4 degrees up from the horizontal, with a...
A ball is launched at an angle of 33.4 degrees up from the horizontal, with a muzzle velocity of 6.5 meters per second, from a launch point which is 1 meters above the floor. How far horizontally (in meters) from the launcher will it land on the floor? Use 9.82 meters per second for “g”.
A shell is fired from a gun at an angle of 30 degrees to the horizon....
A shell is fired from a gun at an angle of 30 degrees to the horizon. The initial velocity of the shell is 10 m/s. What velocity will this shell have at a height of 2m? (Solve this problem by using kinematic equations)
A projectile is fixed at an upward angle of 38.0 degrees from the top of a...
A projectile is fixed at an upward angle of 38.0 degrees from the top of a 105m high cliff speed of 165m/s. What is it’s speed when it strikes the ground? Please show all work.
A projectile is fired at an upward angle of 380 degrees from the top of a...
A projectile is fired at an upward angle of 380 degrees from the top of a 105-m-high cliff with a speed of 165m/s. What is its speed when it strikes the ground below ?
A stone is thrown from the top of a building at an angle of -20.0 degrees...
A stone is thrown from the top of a building at an angle of -20.0 degrees relative to the horizontal with an initial velocity of 30.0 m/s. The building is 65.0 m tall. 1. Determine how long the stone is in the air 2. Determine the speed of the stone right before it hits the ground. 3. determine the angle of velocity with respect to the x-axis at impact. 4. Determine where the stone strikes the ground.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT