Borrar filtros
Borrar filtros

How to copy columns in a matrix.

2 visualizaciones (últimos 30 días)
sreesoumya cheppalli
sreesoumya cheppalli el 16 de Feb. de 2020
Comentada: sreesoumya cheppalli el 17 de Feb. de 2020
Suppose I have a matrix of 13*13 and I would like to copy column 1 of this matrix to column 2 of the same matrix , how can I carry out this copying operation?
Thank you in advance.

Respuestas (1)

Bhaskar R
Bhaskar R el 16 de Feb. de 2020
Editada: Bhaskar R el 16 de Feb. de 2020
1)
res = circshift(mat, [0 -1]); % mat assumed as your matrix
2)
mat = [zeros(size(mat, 1),1), mat] % Append zeros as first column,
  1 comentario
sreesoumya cheppalli
sreesoumya cheppalli el 17 de Feb. de 2020
Thank you for the answer, but I would like to copy the elements of first column to the second without any changes in the first column (both the columns belong to same matrix) . I don't want to create a new matrix.

Iniciar sesión para comentar.

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by