Won Y. Yang - Applied Numerical Methods Using MATLAB

Здесь есть возможность читать онлайн «Won Y. Yang - Applied Numerical Methods Using MATLAB» — ознакомительный отрывок электронной книги совершенно бесплатно, а после прочтения отрывка купить полную версию. В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Жанр: unrecognised, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Applied Numerical Methods Using MATLAB: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Applied Numerical Methods Using MATLAB»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

This new edition provides an updated approach for students, engineers, and researchers to apply numerical methods for solving problems using MATLAB This accessible book makes use of MATLAB® software to teach the fundamental concepts for applying numerical methods to solve practical engineering and/or science problems. It presents programs in a complete form so that readers can run them instantly with no programming skill, allowing them to focus on understanding the mathematical manipulation process and making interpretations of the results.
Applied Numerical Methods Using MATLAB®, Second Edition Provides examples and problems of solving electronic circuits and neural networks Includes new sections on adaptive filters, recursive least-squares estimation, Bairstow's method for a polynomial equation, and more Explains Mixed Integer Linear Programing (MILP) and DOA (Direction of Arrival) estimation with eigenvectors Aimed at students who do not like and/or do not have time to derive and prove mathematical results
is an excellent text for students who wish to develop their problem-solving capability without being involved in details about the MATLAB codes. It will also be useful to those who want to delve deeper into understanding underlying algorithms and equations.

Applied Numerical Methods Using MATLAB — читать онлайн ознакомительный отрывок

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Applied Numerical Methods Using MATLAB», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

1.1.5 Three Dimensional (3D) Graphic Output

MATLAB has several three‐dimensional (3D) graphic plotting commands such as ‘ plot3()’, ‘ mesh()’, and ‘ contour()’. ‘ plot3()’ plots a two‐dimensional (2D) valued‐function of a scalar‐valued variable; ‘ mesh()’/‘ contour()’ plots a scalar valued‐function of a 2D variable in a mesh/contour‐like style, respectively.

Readers are recommended to use the ‘ help’ command for detailed usage of each command. Try running the above MATLAB script “nm01f04.m” to see what figures will appear ( Figure 1.4).

%nm01f04.m: to plot 3D graphs t=0:pi/50:6*pi; expt= exp(-0.1*t); xt= expt.*cos(t); yt= expt.*sin(t); % dividing the screen into 2x2 sections clf subplot(521), plot3(xt,yt,t), grid on %helix subplot(522), plot3(xt,yt,t), grid on, view([0 0 1]) subplot(523), plot3(t,xt,yt), grid on, view([1 -3 1]) subplot(524), plot3(t,yt,xt), grid on, view([0 -3 0]) x=-2:.1:2; y=-2:.1:2; [X,Y] = meshgrid(x,y); Z =X.̂2 + Y.̂2; subplot(525), mesh(X,Y,Z), grid on %[azimuth,elevation]=[-37.5,30] subplot(526), mesh(X,Y,Z), view([0,20]), grid on pause, view([30,30]) subplot(527), contour(X,Y,Z) subplot(528), contour(X,Y,Z,[.5,2,4.5])

Figure 143D graphs drawn by using plot3 mesh and contour 116 - фото 10

Figure 1.43D graphs drawn by using plot3(), mesh(), and contour().

1.1.6 Mathematical Functions

Mathematical functions and special reserved constants/variables defined in MATLAB are listed in Table 1.3.

Table 1.3Functions and variables inside MATLAB.

Function Remark Function Remark
cos(x) exp(x) Exponential function
sin(x) log(x)| Natural logarithm
tan(x) log10(x) Common logarithm
acos(x) cos −1( x ) abs(x) Absolute value
asin(x) sin −1( x ) angle(x) Phase of a complex number (rad)
atan(x) π /2 ≤ tan −1( x ) ≤ π /2 sqrt(x) Square root
atan2(y,x) π ≤ tan −1( y / x ) ≤ π real(x) Real part
cosh(x) ( e x+ e −x)/2 imag(x) Imaginary part
sinh(x) ( e x− e −x)/2 conj(x) Complex conjugate
tanh(x) ( e x− e −x)/( e x+ e −x) round(x) The nearest integer (round‐off)
acosh(x) cosh −1( x ) fix(x) The nearest integer toward 0
asinh(x) sinh −1( x ) floor(x) The greatest integer ≤ x
atanh(x) tanh −1( x ) ceil(x) The smallest integer ≥ x
max Maximum and its index sign(x) 1 (positive)/0/−1 (negative)
min Minimum and its index mod(y,x) Remainder of y / x
sum Sum rem(y,x) Remainder of y / x
prod Product eval(f) Evaluate an expression
norm Norm feval(f,a) Function evaluation
sort Sort in the ascending order polyval Value of a polynomial function
clock Present time poly Polynomial with given roots
find Index of element(s) satisfying given condition roots Roots of polynomial
flops(0) Reset the flops count to zero tic Start a stopwatch timer
flops Cumulative # of floating point op eration s (no longer available) toc Read the stopwatch timer (elapsed time from tic)
date Present date magic Magic square
Reserved variables with special meaning
i, j картинка 11 pi π
eps Machine epsilon Inf, inf Largest number (∞)
realmax, realmin Largest/smallest positive number NaN Not_a_Number (undetermined)
end The end of for‐loop or if, while, case statement or an array index break Exit while/for loop
nargin # of input arguments nargout # of output arguments
varargin Variable input argument list varargout Variable output argument list

MATLAB also allows us to define our own function and store it in a file named after the function name so that it can be used as if it were a built‐in function. For instance, we can define a scalar‐valued function:

Applied Numerical Methods Using MATLAB - изображение 12

and a vector‐valued function

as follows function yf1x y118x2 function yf49x y1 - фото 13

as follows:

function y=f1(x) y=1./(1+8*x.̂2); function y=f49(x) y(1)= x(1)̂2+4*x(2)̂2 -5; y(2)=2*x(1)̂2-2*x(1)-3*x(2) -2.5;

Once we store these functions as M‐files, each named “f1.m” and “f49.m” after the function names, respectively, we can call and use them as needed inside another M‐file or in the MATLAB Command window.

>f1([0 1]) % several values of a scalar function of a scalar variable ans= 1.0000 0.1111 >f49([0 1]) % a value of a 2D vector function of a vector variable ans= -1.0000 -5.5000 >feval('f1',[0 1]), feval('f49',[0 1]) % equivalently, yields the same ans= 1.0000 0.1111 ans= -1.0000 -5.5000

1 (Q7) With the function f1(x) defined as a scalar function of a scalar variable, we enter a vector as its input argument to obtain a seemingly vector‐valued output. What's going on?

2 (A7) It is just a set of function values [f1(x1) f1(x2) …] obtained at a time for several values [x1 x2 …] of x. In expectation of one‐shot multioperation, it is a good practice to put a dot ( .) just before the arithmetic operators *(multiplication), /(division), and ̂(power) in the function definition so that the element‐by‐element (element‐wise or term‐wise) operation can be done any time.

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Applied Numerical Methods Using MATLAB»

Представляем Вашему вниманию похожие книги на «Applied Numerical Methods Using MATLAB» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Applied Numerical Methods Using MATLAB»

Обсуждение, отзывы о книге «Applied Numerical Methods Using MATLAB» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x