```
A=2;
for x=0:2:4
A=[A, A*x];
end
A
```

I'd appreciate any help! The for loop condition as well as the 3rd line and how they work together I can't quite piece together

- Linux(Redhat 4.8) Paths for Run-Time Deployment using Matlab
- How to plot data from a .mat file in Matlab
- Tidying up a list
- Can't integrate a function
- Create a Etch A sketch in Matlab app designer using buttons
- How to efficiently replace a vector of ids by a vector of corresponding numerical values
- MATLAB round function - how does it round .5 up or down?
- Error using load in Matlab for .mat file. File may be corrupt. What are other explanations for this?
- How to use DateTime or FileTime date types in Matlab
- Problem with Polynomials
- How to get result of DISP as return parameter into a variable?
- Metropolis algorithm in MATLAB -->> error with function handles
- Corner Cases, Unexpected and Unusual MATLAB
- What does '/ operator do in MATLAB?
- How to correctly save a large amount of data in matlab?

- Woocommerce Different Products Different Currency
- Rails render js file but can't execute it
- My rotated TextView is cut off. What i have to do?
- Store object created by gson in greenDao
- Clicking on array of images to add them to Konva stage
- How to sort a Google Charts DataTable or DataView using a function?
- 2 column layout looping through MVC model c#
- Integrating SVN with TFS
- Rails - after_initialize or initializer
- xcode open url in second view controller based on button pressed in first view controller

```
A=2;
for x=0:2:4
A=[A, A*x];
end
A
```

I'd appreciate any help! The for loop condition as well as the 3rd line and how they work together I can't quite piece together

- matlab rgb values dilemma
- Reading or loading images from file synchronously in MATLAB
- How to detect equal rows of a matrix compare with another matrix with a 10 per cent of margin?
- Reading images from file in MATLAB
- improfile's write equivalent
- MATLAB: How to run a different file than the one being edited?
- How to make step response of exp function in Matlab?
- How to check if a figure is opened and how to close it?
- How do I roll out a Matlab app for others to use?
- How to rotate X Labels in MATLAB R2014a using edit tool?
- How to set some custom variables on Matlab startup
- Reading input m-file in a main m-file
- Custom Rlocus Plot in MATLAB
- Is there any way to silence the 'hold' function in Matlab
- How can I display all CPT of a DBN in the Bayes Net Toolbox (MATLAB - BNT)?

So, here comes the walktrough.

`A`

is an array of length`1`

, with`2`

as the only element.Have a look at the Examples section of the

`for`

help. You create an "iteration variable"`x`

, which iterates through an array with the values`[0, 2, 4]`

. See also the Examples section of the`:`

operator help.Concatenate array

`A`

with the value of`A*x`

(multiplying an array with a scalar results in an array of the same length, in which each element is multiplied by the given scalar), and re-assign the result to`A`

. See also the help on Concatenating Matrices.`A = [2]`

.`x = 0`

:`A = [[2], [2] * 0]`

, i.e.`A = [2, 0]`

.`x = 2`

:`A = [[2, 0], [2, 0] * 2]`

, i.e.`A = [2, 0, 4, 0]`

.`x = 4`

:`A = [[2, 0, 4, 0], [2, 0, 4, 0] * 4]`

, i.e.`A = [2, 0, 4, 0, 8, 0, 16, 0]`

.End of

`for`

loop.Output content of

`A`

by implicitly calling the`display`

function by omitting the semicolon at the end of the line, see here for explanation.