How to get matrix element A{1,2} at indices 1,2 from matrix A =@(x,y)

4 vues (au cours des 30 derniers jours)
Ole
Ole le 3 Mar 2021
Commenté : Ole le 3 Mar 2021
How to get element with index 1,2 from matrix defined as function.
A =@(x,y) [x 1*x 2*x 3*x; y 5 6 7; 1 1 1 1; 2 3 4 5]
A(3,1) % evaluates the matrix for x=3 y =1
% How to get element at indices 1,2 A(3,1){1,2}=3 meaning 1*x = 3
  2 commentaires
Stephen23
Stephen23 le 3 Mar 2021
A = @(x,y) [x,1*x,2*x,3*x;y,5,6,7;1,1,1,1;2,3,4,5];
M = A(3,1);
M(1,2)
ans = 3
Ole
Ole le 3 Mar 2021
thank you.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by