calc_sides - data nicely formatted fprintf'For a right...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function [a,b] = calc_sides(c,theta) % given the hypotenuse and angle of a right % triangle, calculate other two sides of % triangle a = c * cos(theta); b = c * sin(theta); end function print_values(a,b,c,theta) % given the three sides and one angle of a right triangle, output the
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: data, nicely % formatted. fprintf('For a right triangle with hypotenuse %.1f\n',c); fprintf('and an angle of %.2f between side a & the hypotenuse\n',theta); fprintf('side a is %.2f and side b is %.2f\n',a,b); end...
View Full Document

Ask a homework question - tutors are online