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 Comments

See the documentation on Matrix Indexing for details.
Is this as homework assignment?
A= V(5)
Simply write this!:)

Sign in to comment.

 Accepted Answer

Is this what you are looking for ?
MyVector=rand(100,1);
MyData=MyVector(5);

More Answers (0)

Categories

Asked:

on 23 Jun 2020

Commented:

SCE
on 27 Feb 2024

Community Treasure Hunt

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

Start Hunting!