Ekruten
Ekruten

Reputation: 87

Get specific row from matrix in Scilab

For example, I've created a matrix

a = [1, 2, 3; 4, 5, 6; 7, 8, 9]

and I want to extract the second row in variable r, so after that

r = [4, 5, 6].

How I can do that?

Upvotes: 1

Views: 5238

Answers (2)

Poiana Apuana
Poiana Apuana

Reputation: 1446

To get the second row use

r = a(2,:);

Upvotes: 3

Alex Turbin
Alex Turbin

Reputation: 2702

r = a(2,$);

A very good tutorial may be found here: http://hkumath.hku.hk/~nkt/Scilab/IntroToScilab.html

Upvotes: 0

Related Questions