how to extract elements that are not succesive

5 views (last 30 days)
how can I extract elements that are not succesive?
For example, how can I extract 1st, 3nd and 6th elements from 7x1 matrix density?
It would be really helpful if you can help me solve the problem..

Answers (2)

Walter Roberson
Walter Roberson on 25 Aug 2023
Y([1, 3, 6])
or
Y(round(5*(1:3)/2-5/3))

Image Analyst
Image Analyst on 25 Aug 2023
Here's help: Invest 2 hours of your time here:
You will learn things like that plus more.
  2 Comments
민주
민주 on 30 Aug 2023
The question above was actually the question that I had during studying that cource lol🤣 thanks for your recomendation anyway
Image Analyst
Image Analyst on 30 Aug 2023
OK, then they must have told you how to do it in advance, though perhaps with different numbers. In my experience you're taught/told things and then tested afterwards, with situations where the facts/numbers are slightly altered, on things that you've been taught. I don't think they'd ask you something completely out of the blue that you have not yet been taught. Anyway, Walter's answer is correct and I hope you enjoy using MATLAB like the rest of us. 😁

Sign in to comment.

Categories

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