how p(:,j) differs from p(j,:)?

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 27 de Dic. de 2012
Editada: Azzi Abdelmalek el 27 de Dic. de 2012

0 votos

p=[1 2;3 4;5 6]
check this
p(:,2)
p(3,:)
p(:,2) means all lines, column number 2, p(3,:) means all columns, line number 3

1 comentario

Hajar ALSHOUFI
Hajar ALSHOUFI el 4 de Sept. de 2019
if we have n points =21
I saw a code the author wrote:
p(ny,:) where p is some matrix, how can we understad it, I know the first one refers to rows and the second for columns but how can we understand it what rows is he speaking about

Iniciar sesión para comentar.

Más respuestas (1)

Wayne King
Wayne King el 27 de Dic. de 2012
Editada: Wayne King el 27 de Dic. de 2012

0 votos

p(:,j) takes all the rows and the j-th column of p
p(j,:) takes the j-th row and all the columns of p
So
p = [1 2; 3 4];
j = 1;
p(j,:)
p(:,j)

Etiquetas

Preguntada:

el 27 de Dic. de 2012

Comentada:

el 4 de Sept. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by