フィルターのクリア

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

3 ビュー (過去 30 日間)
reza hamzeh
reza hamzeh 2019 年 12 月 16 日
編集済み: Stephen23 2019 年 12 月 16 日
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
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 件)

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by