H = sigwin.chebwin(Length) returns a Dolph-Chebyshev window object H of length Length with relative sidelobe attenuation of 100 dB. Length requires a positive integer. Entering a positive noninteger value for Length rounds the length to the nearest integer.
All variables of all data types in MATLAB are multidimensional arrays. A vector is a one-dimensional array and a matrix is a two-dimensional array.
We have already discussed vectors and matrices. In this chapter, we will discuss multidimensional arrays. However, before that, let us discuss some special types of arrays.
Special Arrays in MATLAB
In this section, we will discuss some functions that create some special arrays. For all these functions, a single argument creates a square array, double arguments create rectangular array.
The zeros() function creates an array of all zeros −
For example −
MATLAB will execute the above statement and return the following result −
The ones() function creates an array of all ones −
For example −
MATLAB will execute the above statement and return the following result −
The eye() function creates an identity matrix.
For example −
MATLAB will execute the above statement and return the following result −
The rand() function creates an array of uniformly distributed random numbers on (0,1) −
For example −
MATLAB will execute the above statement and return the following result −
A Magic Square
A magic square is a square that produces the same sum, when its elements are added row-wise, column-wise or diagonally.
The magic() function creates a magic square array. It takes a singular argument that gives the size of the square. The argument must be a scalar greater than or equal to 3.
MATLAB will execute the above statement and return the following result −
Multidimensional Arrays
An array having more than two dimensions is called a multidimensional array in MATLAB. Multidimensional arrays in MATLAB are an extension of the normal two-dimensional matrix.
Generally to generate a multidimensional array, we first create a two-dimensional array and extend it.
For example, let's create a two-dimensional array a.
MATLAB will execute the above statement and return the following result −
The array a is a 3-by-3 array; we can add a third dimension to a, by providing the values like −
MATLAB will execute the above statement and return the following result −
We can also create multidimensional arrays using the ones(), zeros() or the rand() functions.
For example,
MATLAB will execute the above statement and return the following result −
We can also use the cat() function to build multidimensional arrays. It concatenates a list of arrays along a specified dimension −
Syntax for the cat() function is −
Where,
Example
Create a script file and type the following code into it −
When you run the file, it displays −
Array Functions
MATLAB provides the following functions to sort, rotate, permute, reshape, or shift array contents.
Examples
The following examples illustrate some of the functions mentioned above.
Length, Dimension and Number of elements −
Create a script file and type the following code into it −
When you run the file, it displays the following result −
Circular Shifting of the Array Elements −
Create a script file and type the following code into it −
When you run the file, it displays the following result −
Sorting Arrays
Create a script file and type the following code into it −
When you run the file, it displays the following result −
Cell Array
Cell arrays are arrays of indexed cells where each cell can store an array of a different dimensions and data types.
The cell function is used for creating a cell array. Syntax for the cell function is −
Where,
Example
Create a script file and type the following code into it −
When you run the file, it displays the following result −
Accessing Data in Cell Arrays
There are two ways to refer to the elements of a cell array −
When you enclose the indices in first bracket, it refers to the set of cells.
Cell array indices in smooth parentheses refer to sets of cells.
For example −
MATLAB will execute the above statement and return the following result −
You can also access the contents of cells by indexing with curly braces.
For example −
MATLAB will execute the above statement and return the following result −
. 110 Downloads.AbstractWe present a synthesis technique for circular arrays of antennas that allows to determine an array pattern having side lobes of assigned level and one main beam whose width does not exceed a prescribed threshold. The method develops in two steps. At first it generates, by means of a suitable Chebyshev polynomial, a reference pattern satisfying the conditions imposed by the synthesis problem.
Subsequently, it determines the solution as the array pattern minimizing the mean-square distance from the reference pattern. Numerical examples show the effectiveness of the method.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |