필터 지우기
필터 지우기

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 CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by