Question
The "for more practice part" using matlab
If the lengths of two sides of a triangle and the
0 0
Add a comment Improve this question Transcribed image text
Answer #1

with out using function:

run the folloing program

program:

disp( ' calculaion of one side knowing two sides and one angle');


b = input('enter the first side');
c= input('enter the second side');
alpha=input('enter the angle between them');


  
X= (b * b) + (c * c) - (2 * b * c) * (cos(alpha));
a = sqrt(X);
disp('third side is');
disp(a);
  

output:

>> side
calculaion of one side knowing two sides and one angle
enter the first side2.2
enter the second side4.4
enter the angle between them50
third side is
2.3491

with using function:

create two files funside.m and side.m in same directtory and run side.m

program:

disp( ' calculaion of one side knowing two sides and one angle');


b = input('enter the first side');
c= input('enter the second side');
alpha=input('enter the angle between them');
  
a=funside(b,c,alpha);
disp('third side is');
disp(a);

funside function:

function [ a] = funside( b,c,alpha )
%omputes third side with to side and one angle
% Detailed explanation goes here
X= (b * b) + (c * c) - (2 * b * c) * (cos(alpha));
a = sqrt(X);

end

Add a comment
Know the answer?
Add Answer to:
The "for more practice part" using matlab If the lengths of two sides of a triangle...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT