How can I copy all elements, which > 4 to vector V?

1 view (last 30 days)
I have a M = magic(5) matrix. How can I copy all elements, which > 4 to vector V?

Accepted Answer

Abhinav
Abhinav on 17 Jan 2023
M = magic(5);
V=M(M>4)

More Answers (0)

Categories

Find more on Interpolation 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!