select certain matrix elements

2 views (last 30 days)
zilai si
zilai si on 15 Oct 2019
Edited: Fabio Freschi on 15 Oct 2019
hello,everyone
i just want to ask how to select eg the 1-10 and 20-30 rows elements in the first column.
like A(1:10 and 20:30,1)

Accepted Answer

Fabio Freschi
Fabio Freschi on 15 Oct 2019
Edited: Fabio Freschi on 15 Oct 2019
You can simply concatenate your ranges using square brackets:
A([1:10 20:30],1)

More Answers (0)

Categories

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

Products

Community Treasure Hunt

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

Start Hunting!