How to insert calculation values in to a zero matrix

Dr is the result matrix (4 by 4) and I want to insert only the third non-zero column into a new matrix like Z.
Dr =
0 0 -0.0618 0
0 0 -0.0618 0
0 0 0.9884 0
0 0 0.9884 0
Z = [-0.0618;-0.0618;0.9884;0.9884]
I've been tried a lot of ways but none of them works. Therefore, any advises are very welcome. Thanks!

Respuestas (1)

Z = Dr(:,3)
should do it.

3 comentarios

It worked perfectly. Thank you so much, Alan!!!!!!
i suggest you to do the MATLAB Onramp Course.
Will do. Thanks

Iniciar sesión para comentar.

Categorías

Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 28 de Ag. de 2020

Comentada:

el 28 de Ag. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by