In attacking each problem you need to have a logical plan and lay out steps that you want to follow, here we have some suggestion for a plan of attack that might work for many problems:
Step 1: Problem analysis. The context of the proposed investigation must be established to provide the proper motivation for the design of a computer program. The designer must fully recognize the need and must develop an understanding of the nature of the problem to be solved.
Step 2: Problem statement. Develop a detailed statement of the mathematical problem to be solved with a computer program.
Step 3: Processing scheme. Define the inputs required and the outputs to be produced by the program.
Step 4: Algorithm. Design the step-by-step procedure using the top-down design process that decomposes the overall problem into subordinate problems. The subtasks to solve the latter are refined by designing an itemized list of steps to be programmed. This list of tasks is the structure plan; it is written in pseudocode, i.e. a combination of English, mathematics and anticipated MATLAB commands. The goal is to design a plan that is understandable and easily translated into a computer language.
Step 5: Program algorithm. Translate or convert the algorithm into a computer language (e.g. MATLAB) and debug the syntax errors until the tool executes successfully.
Step 6: Evaluation. Test all of the options and conduct a validation study of the computer program, e.g. compare results with other programs that do similar tasks, compare with experimental data if appropriate, and compare with theoretical predictions based on theoretical methodology related to the problems to be solved by the computer program. The objective is to determine that the subtasks and the overall program are correct and accurate. The additional debugging in this step is to find and correct logical errors (e.g. mistyping of expressions by putting a + sign where a − sign was supposed to be placed), and run-time errors that may occur after the program successfully executes (e.g. cases where division by 0 unintentionally occurs).
Step 7: Application. Solve the problems the program was designed to solve. If the program is well designed and useful it could be saved in your work directory (i.e. in your user-developed toolbox) for future use.
Program Design & Algorithm Development
Write a program to convert a Fahrenheit temperature to Celsius.
F = input('Please input the temperature in F: ');
C = (5/9)*(F-32)
Write a script for the general solution of the quadratic equation ax2+bx+c = 0. Your script should be able to handle all possible values of the data a, b, and c. Try it out on the following values of a, b and c:
(a) 1, 1, 1 (complex roots);
(b) 2, 4, 2 (equal roots of -1.0);
(c) 2, 2, −12 (roots of 2.0 and -3.0).
a = input('please enter a for the quadratic equation ax ∧ 2+b ∧ x+c = 0 :');
b = input('please enter b for the quadratic equation ax ∧ 2+b ∧ x+c = 0 :');
c = input('please enter c for the quadratic equation ax ∧ 2+b ∧ x+c = 0 :');
*These practice questions are only helpful when you work on them offline on a piece of paper and then use the solution steps function to check your answer.
Program Design & Algorithm Development
Lecture Slides are screen-captured images of important points in the lecture. Students can download and print out these lecture slide images to do practice problems as well as take notes while watching the lecture.
Educator.com recommends MATLAB and Simulink to use with our MATLAB course. MATLAB - Solve numerical problems quickly, so you can focus on coursework and projects rather than programming. Simulink - Model, simulate, and analyze dynamic systems. Target hardware support - Run Simulink models on Arduino, LEGO MINDSTORMS NXT, Raspberry Pi, and other hardware. 10 add-on products for math, statistics, and optimization; controls; signal and image processing; and test and measurement. The package includes a software activation key with instructions to download and install Student Version from www.mathworks.com