tailieunhanh - Learning MATLAB Version 6 (Release 12) phần 7

Dòng đầu tiên của văn bản trợ giúp là dòng H1, mà MATLAB hiển thị khi bạn sử dụng lệnh lookfor hoặc yêu cầu giúp đỡ trên một thư mục. Phần còn lại của tập tin được thực thi mã MATLAB Bạn có thể xem các tập tin với | 7 Symbolic Math Toolbox Here are some examples. Expression Variable Returned by findsym xAn x sin a t b t besselj nu z z w y v z y exp i theta theta log alpha x1 x1 y 4 3 i 6 j y sqrt pi alpha alpha Creating Symbolic Math Functions There are two ways to create functions Use symbolic expressions Create an M-file Using Symbolic Expressions The sequence of commands syms x y z r sqrt xA2 yA2 zA2 t atan y x f sin x y x y generates the symbolic expressions r t and f. You can use diff int subs and other Symbolic Math Toolbox functions to manipulate such expressions. 7-14 Getting Started Creating an M-File M-files permit a more general use of functions. Suppose for example you want to create the sinc function sin x x. To do this create an M-file in the @sym directory. function z sinc x SINC The symbolic sinc function sin x x. This function accepts a sym as the input argument. if isequal x sym 0 z 1 else z sin x x end You can extend such examples to functions of several variables. See the MATLAB topic Programming and Data Types in Using MATLAB for a more detailed discussion on object-oriented programming. 7-15 7 Symbolic Math Toolbox Calculus The Symbolic Math Toolbox provides functions to do the basic operations of calculus differentiation limits integration summation and Taylor series expansion. The following sections outline these functions. Differentiation Let s create a symbolic expression. syms a x f sin a x Then diff f differentiates f with respect to its symbolic variable in this case x as determined by findsym. ans cos a x a To differentiate with respect to the variable a type diff f a which returns df da ans cos a x x To calculate the second derivatives with respect to x and a respectively type diff f 2 or diff f x 2 which return ans -sin a x aA2 .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.