how to get element of a matrix that defined as a function?
8 次查看(过去 30 天)
显示 更早的评论
hi. suppose this matrix function. how can i get its elements ? for example ha(1,1) dosent work.
ha=@(J) [0 J;1 J];
采纳的回答
Stephen23
2019-12-16
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!