Greetings and welcome to Bern’s section on the basic computation programming for engineers. In this first article that I have wrote for this special section on my blog, I would like to talk about constructing a simple computer language code using the Matlab for a common mathematical question. If you are my JKKP classmates, I am sure that you have the question for the assignment given by Dr Meor with you. If you are not, here is the question stipulated:
QUESTION:
The area of a triangle having side lengths a, b and c is:
Area = √(s(s-a)(s-b)(s-c)) - where; s = (a+b+c)/2
Write a computer code (Matlab) to prompt user for the three sides of a triangle and then compute and print the area using the relationship above. You are expected to submit the algorithm, flowchart and the computer (Matlab) code.
NOTE: I will leave it to you to solve the algorithm and the flowchart.