Coding practice question, printed out a question sheet and not sure how this would be done.

1 visualización (últimos 30 días)
Assume that you have a vector, X, with 150 elements. Write the single line MatLab command that will delete every third element; that is it deletes elements 3, 6, 9 and so on.
How would this be coded and look like?

Respuestas (1)

David Fletcher
David Fletcher el 27 de Abr. de 2021
X(3:3:150)=[]

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by