tailieunhanh - Essential MATLAB for Engineers and Scientists PHẦN 3

Các MATLAB tài liệu chính thức đề cập đến tất cả các biến mảng, dù là giá trị đơn (vô hướng) hay nhiều giá trị (vector, ma trận). Nói cách khác, vô hướng là một mảng 1x1, tức là một mảng với một hàng và một cột duy nhất, tất nhiên, là một mảng của một mục. | 2 MATLAB fundamentals case 2 disp That s a 21 otherwise disp Must be3 end Multiple expressions can be handled in a single case statement by enclosing the case expression in a cell array see Chapter 11 d floor 10 rand switch d case 2 4 s 8 disp Even case 1 3 5 7 9 see3 otherwise see3 end Complex numbers If you are not familiarwith complex numbers you can safely omit this section. However it is useful to know what they are since the square root of a negative number may comeup as amistake if youare trying to workonlywithrea numbers. It s very easy to gaadlacomplex numbers in MATLAB. The special values i and j stand for r-L Try sqrt -1 to see how MATLAB represents complex numbers. The symbol i maytessed to assign complex values . z 2 3 1 represents the complex number 2 3 real part 2 imaginary part 3 . You can also input a complex value like this . enter 2 3 1 in response to t9e input prompt remember no semicolon . The imaginary part of a complex number may also be entered without an asterisk . 31. 69 Essential MATLAB for Engineers and Scientists All the arithmetic operators and most functions work with complex numbers . sqrt 2 3 1 exp i pi . There are some functionsthat arespecifictocomplex numbers. If z is a complex number real z imag z conj z and abs z all have the obvious meanings. A complex numbermayne represented in polar coordinates . z re f . angle z returns 0 between -TĨ and TT . it returns atan2 imag z real z . abs z returns the magnitude r. Since eie gives theunitcircle a neat way of plotting a circle. Try the following circle exp 2 1 1 360 pi 360 plot circle axis equal Note If y is complex the statement plot y is equivalent to plot real y imag y The statement mxis eqnoir js neceeeary to make circles look round it changes what is known as the aspect ratio of the monitor axis noml Jgieesfteaefauicpouecorutio. If you are using carefelnpf to eme ierj Xor other variables the new values will .

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.