Concatenate array using square brackets

1 view (last 30 days)
x = zeros(1,9);
x = [1, x(1:9)];
when i run the second line multiple times, it starts to fill in the array x. I want to ask what is the functionality of the second line, and is there any documentation that describes this syntax ?

Accepted Answer

Voss
Voss on 26 Oct 2022
  4 Comments
Quang Nguyen
Quang Nguyen on 26 Oct 2022
Thank you very much, i really get it now

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!