Start learning today, and be successful in your academic & professional career. Start Today!

Loading video...

**Select Language**中文 (简)- Link to Educator.com
- About
- FAQ

Enter your Sign on user name and password.

Start learning today, and be successful in your academic & professional career. Start Today!

Loading video...

## Discussion

## Study Guides

## Practice Questions

## Download Lecture Slides

## Table of Contents

## Related Books

- 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.

Write a program to convert a Fahrenheit temperature to Celsius.

function converFC

F = input('Please input the temperature in F: ');

C = (5/9)*(F-32)

end

F = input('Please input the temperature in F: ');

C = (5/9)*(F-32)

end

Write a script for the general solution of the quadratic equation ax^{2}+b^{x}+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) 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).

function quadcalc

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 :');

delta = b^{∧} 2-4*a*c;

x1 = (-b + sqrt(delta))/(2*a)

x2 = (-b - sqrt(delta))/(2*a)

end

a = input('please enter a for the quadratic equation ax

b = input('please enter b for the quadratic equation ax

c = input('please enter c for the quadratic equation ax

delta = b

x1 = (-b + sqrt(delta))/(2*a)

x2 = (-b - sqrt(delta))/(2*a)

end

*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.

Answer

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.

- Intro 0:00
- Problem Analysis 0:36
- Problem Statement
- Processing Scheme
- Algorithm
- Program Algorithm
- Evaluation
- Application
- Example: Projectile 3:54
- Example Executed in MATLAB
- Txmax
- Xmax
- Computing Speed and Angle Direction of Projectile
- Velocity
- Computing Time and Horizontal Distance at Max. Altitude 15:05
- Display Altitude
- Num2str
- Plot
- Figure

I. Introduction | ||
---|---|---|

MATLAB Essentials, Part 1 | 8:36 | |

MATLAB Essentials, Part 2 | 7:39 | |

II. MATLAB Fundamentals | ||

Introduction to Programs | 6:42 | |

Arrays & Matrices | 7:06 | |

Operator, Expression & Statements | 13:26 | |

Repeating With For | 14:21 | |

Decisions, Part 1 | 14:35 | |

Decisions, Part 2 | 8:53 | |

Last Notes on MATLAB Introduction | 9:47 | |

III. Logical Vectors | ||

Logical Vectors, Part 1 | 11:23 | |

Logical Vectors, Part 2 | 11:40 | |

IV. Program Design | ||

Program Design & Algorithm Development | 19:36 | |

V. Graphics | ||

Graphics, Part 1 | 9:14 | |

Graphics, Part 2 | 17:20 | |

Graphics, Part 3 | 18:37 | |

VI. Loops | ||

Loops | 10:38 | |

While | 17:01 | |

VII. Project | ||

Projectile Problem | 16:33 | |

VIII. Function M-Files | ||

Function M-Files, Part 1 | 12:55 | |

Function M-Files, Part 2 | 14:14 | |

Function M-Files, Part 3 | 11:54 | |

IX. Graphics Continued | ||

More on Graphics | 11:13 | |

Graphical User Interface, Part 1 | 7:25 | |

Graphical User Interface, Part 2 | 9:33 | |

X. Dynamical Systems | ||

Dynamical Systems | 12:45 | |

XI. Simulation | ||

Examples of Simulation | 10:45 | |

XII. Numerical Methods | ||

Numerical Methods | 22:20 | |

XIII. Simulink | ||

Simulink | 9:37 |

## Start Learning Now

Our free lessons will get you started (Adobe Flash

Sign up for Educator.com^{®}required).Get immediate access to our entire library.

## Membership Overview

Unlimited access to our entire library of courses.Learn at your own pace... anytime, anywhere!