-
23
pages
-
English
-
Documents
Description
Matlab Basics Tutorial for Electrical and Electronic Engineering & Electrical and Communication Engineering Students Prepared by P.Leung Revised by I.Jahmeerbacus May 2004 P.L Matlab Tutorial 1.0 Polynomials In Matlab, a polynomial is represented by a vector. To create a polynomial in Matlab, simply enter each coefficient of the polynomial into the vector in descending order. For instance, let's say you have the following polynomial: To enter this into Matlab, just enter it as a vector in the following manner x = [1 3 -15 -2 9] x = 1 3 -15 -2 9 Matlab can interpret a vector of length n+1 as an nth order polynomial. Thus, if your polynomial is missing any coefficients, you must enter zeros in the appropriate place in the vector. For example, would be represented in Matlab as: y = [1 0 0 0 1] 2.0 Matrices In matrix, each row of elements is separated by a semicolon (;) or a return: B = [1 2 3 4;5 6 7 8;9 10 11 12] B = 1 2 3 4 5 6 7 8 9 10 11 12 B = [ 1 2 3 4 5 6 7 8 9 10 11 12] B = 1 2 3 4 5 6 7 8 9 10 11 12 P.L Matrices in Matlab can be manipulated in many ways. For one, you can find the transpose of a matrix using the apostrophe key: C = B' C = 1 5 9 2 6 10 ...
-
Publié par
-
Langue
English