How to insert calculation values in to a zero matrix

2 vues (au cours des 30 derniers jours)
Benjamin Pu
Benjamin Pu le 28 Août 2020
Commenté : Benjamin Pu le 28 Août 2020
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!

Réponses (1)

Alan Stevens
Alan Stevens le 28 Août 2020
Z = Dr(:,3)
should do it.
  3 commentaires
madhan ravi
madhan ravi le 28 Août 2020
i suggest you to do the MATLAB Onramp Course.
Benjamin Pu
Benjamin Pu le 28 Août 2020
Will do. Thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur Operators and Elementary Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by