i have code that input of this code is defined function whit syms order, i want code recognizes type Definition f. in fact is f handle function or syms function or inline function?

 採用された回答

John D'Errico
John D'Errico 2015 年 7 月 2 日

0 投票

f = inline('x');
w= whos('f')
w =
name: 'f'
size: [1 1]
bytes: 1130
class: 'inline'
global: 0
sparse: 0
complex: 0
nesting: [1x1 struct]
persistent: 0
f = @(x) x.^2;
w= whos('f')
w =
name: 'f'
size: [1 1]
bytes: 32
class: 'function_handle'
global: 0
sparse: 0
complex: 0
nesting: [1x1 struct]
persistent: 0
Look at w.class from the output of whos.

2 件のコメント

Walter Roberson
Walter Roberson 2015 年 7 月 2 日
Or just look at class(f)
John D'Errico
John D'Errico 2015 年 7 月 5 日
Of course. LOL

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by