how to get element of a matrix that defined as a function?

 Accepted Answer

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)

More Answers (0)

Categories

Asked:

on 16 Dec 2019

Edited:

on 16 Dec 2019

Community Treasure Hunt

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

Start Hunting!