Đang chuẩn bị liên kết để tải về tài liệu:
MATLAB Demystified phần 5

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

chúng tôi sẽ cần phải biết các lớp học được sử dụng bởi các trường hợp sử dụng nào như các yêu cầu phát triển và thay đổi sử dụng các trường hợp. Ngay cả sau khi hệ thống hoàn tất, bạn có thể cần một hàng tồn kho của các lớp học được bao gồm trong từng trường hợp sử dụng. Khi hệ thống chuyển sang chế độ bảo trì, | T- 122 MATLAB Demystified Now the suspense is building but many clever readers will deduce the answer is x -3 and wonder why we re bothering with this. Well the reason is that it will make seeing how to use MATLAB for symbolic computing a snap. We can find the solution in one step. All we do is create a variable and assign it the value returned by solve in the following way x solve x 3 0 x -3 Now it isn t necessary to include the right-hand side of the equation. As you can see from the following example MATLAB assumes that when you pass x 8 to solve that you mean x 8 0. To verify this we run this command line x solve x 8 x -8 So enter the equations whichever way you want. I prefer to be as clear as possible with my intentions so would rather use x 8 0 as the argument. It is possible to include multiple symbols in the equation you pass to solve. For instance we might want to have a constant included in an equation like this ax 5 0 If we enter the equation in MATLAB it seems to just assume that we want to solve for x solve a x 5 ans -5 a However there is a second way to call solve. We can tell it what symbol we want it to solve for. This is done using the following syntax solve equation variable CHAPTER 5 Algebraic Equations Symbolic Tools 123 J Like the equation that you pass to solve the variable must be enclosed in single quotes. Returning to the equation ax 5 0 let s tell MATLAB to find a instead. We do this by typing solve a x 5 a MATLAB responds with the output ans -5 x Solving Quadratic Equations The solve command can be used to solve higher order equations to the delight of algebra students everywhere. For those of us who have moved beyond algebra MATLAB offers us a way to check results when quadratic or cubic equations pop up or to save us from the tedium of solving the equations. The procedure used is basically the same as we ve used so far we just use a caret character A to indicate exponentiation. Let s consider the equation x2 - 6x - 12 0 We could solve

TÀI LIỆU LIÊN QUAN