what does y(:,1) means if y is a matrix ?

20 views (last 30 days)
Axa Baby
Axa Baby on 17 Feb 2016
Answered: Mukhtar Ullah on 15 Aug 2017
trig= -1*Y(:,1);
s= -1*Y(:,2);

Answers (2)

Mukhtar Ullah
Mukhtar Ullah on 15 Aug 2017
If you define a bidimensional array y, and you want to access all its elements on the first column: y(:,1) will do it. If you want to access to all the elements of the fift row: y(5,:) is the syntax you have to use. The colon means: take all the elements along the specified dimension. --Franco 18:36, 29 September 2006 (PDT)

Stephen23
Stephen23 on 17 Feb 2016
Edited: Stephen23 on 17 Feb 2016

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!