how to extract elements that are not succesive

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..

Réponses (2)

Y([1, 3, 6])
or
Y(round(5*(1:3)/2-5/3))
Image Analyst
Image Analyst le 25 Août 2023

0 votes

Here's help: Invest 2 hours of your time here:
You will learn things like that plus more.

2 commentaires

민주
민주 le 30 Août 2023
The question above was actually the question that I had during studying that cource lol🤣 thanks for your recomendation anyway
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. 😁

Connectez-vous pour commenter.

Catégories

En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange

Produits

Question posée :

le 25 Août 2023

Commenté :

le 30 Août 2023

Community Treasure Hunt

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

Start Hunting!

Translated by