Borrar filtros
Borrar filtros

how can i add column in matrix?

2 visualizaciones (últimos 30 días)
Mira le
Mira le el 22 de Dic. de 2019
Comentada: Mira le el 22 de Dic. de 2019
A is a matrix:
0 9 8 4 6
9 0 8 4 3
0 6 4 8 9
8 0 4 6 9
9 0 8 4 3
0 9 4 8 6
9 0 8 4 6
how to add another column at the end of matrix A?

Respuesta aceptada

Turlough Hughes
Turlough Hughes el 22 de Dic. de 2019
Depends what you want in that column but you could for example add a column of zeros as follows:
A = [A zeros(size(A,1),1)]
  1 comentario
Mira le
Mira le el 22 de Dic. de 2019
I want to add a field of struct

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Types 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