how to get element of a matrix that defined as a function?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
hi. suppose this matrix function. how can i get its elements ? for example ha(1,1) dosent work.
ha=@(J) [0 J;1 J];
1 commentaire
Réponse acceptée
Stephen23
le 16 Déc 2019
That numeric matrix is only created when the function is called, it does not exist beforehand.
So you need to call the function, assign its output to a variable, and then use indexing:
M = ha(5)
M(1,1)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices 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!