フィルターのクリア

Problem identifying a symbolic variable as a double

2 ビュー (過去 30 日間)
Dina Irofti
Dina Irofti 2014 年 6 月 3 日
回答済み: Mischa Kim 2014 年 6 月 3 日
Hello!
I’m dealing with symbolic toolbox in Matlab. I have this code:
>> syms a b c;
a = b + c;
>> res = subs(a, {b, c}, {1, 1})
res =
2
>> isnumeric(res)
ans =
0
I would like an “isnumeric” function that returns 1 for this situation. I tried vpa and double but the answer is still 0. There is any other function that I can use or should I write it by myself?
Thanks!

回答 (1 件)

Mischa Kim
Mischa Kim 2014 年 6 月 3 日
Dina, did you try
isnumeric(double(res))
Just in case this does not result in a "1", what MATLAB release are you working with?

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by