How to extract a value from a Row or Column vector?

Im trying to take the 5th value of a randomly generated row or column vector. How would I write the code for that?

2 comentarios

Star Strider
Star Strider el 23 de Jun. de 2020
See the documentation on Matrix Indexing for details.
Is this as homework assignment?
SCE
SCE el 27 de Feb. de 2024
A= V(5)
Simply write this!:)

Iniciar sesión para comentar.

 Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 23 de Jun. de 2020
Is this what you are looking for ?
MyVector=rand(100,1);
MyData=MyVector(5);

2 comentarios

Star Strider
Star Strider el 23 de Jun. de 2020
I suspect this is a homework assignment.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Preguntada:

el 23 de Jun. de 2020

Comentada:

SCE
el 27 de Feb. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by