# perturbedArray

Apply perturbations to phased array

## Syntax

``arrayp = perturbedArray(array)``
``[arrayp,offsets] = perturbedArray(array)``

## Description

example

````arrayp = perturbedArray(array)` creates a perturbed array `arrayp` from an original `array`. Use the `perturbations` function to apply one or perturbations to the `array`. Then create the perturbed array `arrayp` using the `perturbedArray` object function. The array perturbation are described in the perturbation table created by the `perturbations` object function. You can call this function many times to create a new perturbed array.```
````[arrayp,offsets] = perturbedArray(array)` also returns the perturbation `offsets` used to create the perturbed array`arrayp`.```

## Examples

collapse all

Create an 11-element uniform linear array (ULA). The array operates at 300 MHz and its elements are spaced one-half wavelength apart. Perturb the element positions by 1/20th of a wavelength. A second perturbation sets an element failure rate of 10$%$.

```freq = 300.0e6; lambda = physconst('LightSpeed')/freq; d = lambda/2; array = phased.ULA(11,ElementSpacing=d/2);```

Display the appled perturbations.

```rng(2001) perturbations(array,'ElementPosition','Normal',0,lambda/20); perturbations(array,'ElementFailure','RandomFail',0.1)```
```ans=4×3 table Property Type Value ___________________ ______________ ________________________ {'ElementPosition'} {'Normal' } {[ 0]} {[0.0500]} {'TaperMagnitude' } {'None' } {[ NaN]} {[ NaN]} {'TaperPhase' } {'None' } {[ NaN]} {[ NaN]} {'ElementFailure' } {'RandomFail'} {[0.1000]} {[ NaN]} ```

Create the perturbed array. Show that the array is a conformal array.

`arrayp = perturbedArray(array)`
```arrayp = phased.ConformalArray with properties: Element: [1×1 phased.IsotropicAntennaElement] ElementPosition: [3×11 double] ElementNormal: [2×11 double] Taper: [11×1 double] ```

Find the perturbations themselves using the `offsets` output.

`[arrayp,offsets] = perturbedArray(array);`

Display the element position perturbations.

`offsets(1)`
```ans = struct with fields: Property: 'ElementPosition' Offset: [3×11 double] PerturbedValue: [3×11 double] ```
`offsets(1).Offset`
```ans = 3×11 -0.0372 0.0107 0.0092 -0.0774 0.0332 -0.1940 -0.0382 0.0454 0.0774 0.0633 0.0844 -0.0177 -0.0745 0.1042 0.0210 -0.0359 -0.0391 0.0281 -0.0229 0.0281 0.0049 -0.0281 0.0048 0.0758 0.0528 -0.0372 -0.0066 0.0030 0.0323 -0.1047 -0.0887 -0.0085 0.0124 ```
`offsets(1).PerturbedValue`
```ans = 3×11 -0.0372 0.0107 0.0092 -0.0774 0.0332 -0.1940 -0.0382 0.0454 0.0774 0.0633 0.0844 -1.2668 -1.0738 -0.6452 -0.4786 -0.2858 -0.0391 0.2780 0.4768 0.7776 1.0042 1.2210 0.0048 0.0758 0.0528 -0.0372 -0.0066 0.0030 0.0323 -0.1047 -0.0887 -0.0085 0.0124 ```

Display the failed elements.

`offsets(2)`
```ans = struct with fields: Property: 'ElementFailure' Offset: [11×1 double] PerturbedValue: [11×1 double] ```
`offsets(2).Offset`
```ans = 11×1 1 1 1 1 1 1 1 0 1 1 ⋮ ```
`offsets(2).PerturbedValue`
```ans = 11×1 1 1 1 1 1 1 1 0 1 1 ⋮ ```

## Input Arguments

collapse all

Phased array, specified as a Phased Array System Toolbox System object.

## Output Arguments

collapse all

Phased array, returned as a `phased.ConformalArray` or a `phased.HeterogeneousConformalArray` System object. `arrayp` is a heterogeneous conformal array if the input unperturbed array is a any heterogeneous array.

Perturbation offsets used to create the perturbed array, returned as an array of `structs`. Each `struct` describes one of the applied perturbations. The fields of each `struct` are:

 `Property` Perturbed property of array `Offset` Numeric array containing the offset or change in the property values. `PerturbedValue` Numeric array containing the newly perturbed property values.

Data Types: `struct`

## Version History

Introduced in R2022a