display of variables using @

조회 수: 5 (최근 30일)
632541
632541 2021년 2월 14일
답변: Walter Roberson 2021년 2월 14일
I have a variable in for loop , V.
V defined as,
V=@(x ) 5.*sign(r.^2 +x.^2);
where r=0.1;
How to display the V in command window? IS it possible?
Or any other ways to know the changes in V?

답변 (1개)

Walter Roberson
Walter Roberson 2021년 2월 14일
disp(v)
But it will just display the formula, and will not display the r value that was saved in the function handle. To see the r value you need to use functions(v) and extract the information from the structure returned.

카테고리

Help CenterFile Exchange에서 Function Creation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by