Effacer les filtres
Effacer les filtres

How i display matrix ?

148 vues (au cours des 30 derniers jours)
ARJUN K P
ARJUN K P le 16 Sep 2015
my matrix is the form:
Ki = [25 35, 56 41,85 78]
i want print the like 35 or 41 or 78

Réponse acceptée

Star Strider
Star Strider le 16 Sep 2015
Firsgt, you need to change the commas to semicolons, then display the second column:
Ki = [25 35; 56 41; 85 78]
Display = Ki(:,2)
  2 commentaires
ARJUN K P
ARJUN K P le 16 Sep 2015
not for all values... 35 only or 41 only or 78 only
Star Strider
Star Strider le 16 Sep 2015
Then you have to specify the row as well:
E12 = Ki(1,2) % Display ‘35’
E12 = Ki(2,2) % Display ‘41’
E12 = Ki(3,2) % Display ‘78’

Connectez-vous pour commenter.

Plus de réponses (2)

Thorsten
Thorsten le 16 Sep 2015
  2 commentaires
ARJUN K P
ARJUN K P le 16 Sep 2015
not for all values... 35 only or 41 only or 78 only
Thorsten
Thorsten le 16 Sep 2015
disp(Ki(2))
disp(Ki(4))
disp(Ki(6))

Connectez-vous pour commenter.


Pranav Bansal
Pranav Bansal le 4 Nov 2019
Ki = [25 35, 56 41,85 78]
disp(Ki(:,2))

Catégories

En savoir plus sur Matrices and Arrays 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