Skip to Main Content
Programming in MATLAB ®: A Problem-Solving Approach by Pearson
book

Programming in MATLAB ®: A Problem-Solving Approach by Pearson

by Ram N. Patel, Ankush Mittal
May 2024
Intermediate to advanced content levelIntermediate to advanced
433 pages
13h 7m
English
Pearson India
Content preview from Programming in MATLAB ®: A Problem-Solving Approach by Pearson
308
Ñ
Advanced Concepts in MATLAB
Example 11.2
Solve the following equations for x and y:
x
2
- 2 * x - 2 * x * y + 4 * y = 0
x^2 - 6 * x + 5 = 0
Solution
>> syms x y s
>> s = solve(x^2 - 2 * x - 2 * y * x + 4 * y, x^2 - 6 * x + 5)
s =
x: [2x1 sym]
y: [2x1 sym]
>> s.x
ans =
[1]
[5]
>> s.y
ans =
[1/2]
[5/2]
11.2.8 Solving Differential Equations
The function dsolve computes symbolic solutions to ordinary differential equations. The syntax
of dsolve is somewhat different than most other functions in MATLAB. Arguments to dsolve
must be character strings representing equations, that is, strings containing an equal sign (=).
This is different from the syntax of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Applied Numerical Methods Using MATLAB, 2nd Edition

Applied Numerical Methods Using MATLAB, 2nd Edition

Won Y. Yang, Wenwu Cao, Jaekwon Kim, Kyung W. Park, Ho-Hyun Park, Jingon Joung, Jong-Suk Ro, Han L. Lee, Cheol-Ho Hong, Taeho Im
MATLAB Recipes: A Problem-Solution Approach

MATLAB Recipes: A Problem-Solution Approach

Michael Paluszek, Stephanie Thomas
Practical MATLAB Deep Learning: A Projects-Based Approach

Practical MATLAB Deep Learning: A Projects-Based Approach

Michael Paluszek, Stephanie Thomas, Eric Ham

Publisher Resources

ISBN: 9781306983440Publisher Website