フィルターのクリア

using numerical values in symbolic expresion

1 回表示 (過去 30 日間)
Luis Isaac
Luis Isaac 2020 年 4 月 24 日
回答済み: Tommy 2020 年 4 月 24 日
Dear
I am very new using symbolic math
I have a funcion of two variables
syms x y
assume (x 'real')
assume (y 'real')
f=log(x/y);
I would like to plot the funcion usin 2.555 for y
y=2.555;
fplot(f,[1,20])
But the is an error because Matlab sais that f is not a single variable function. Of course I misunderstanding something but I don't know
Thanks in advance,

採用された回答

Tommy
Tommy 2020 年 4 月 24 日
Even though you assign a new value to y, the function f is still dependent on two symbolic variables. You can use subs to replace y with 2.555:
syms x y
assume (x, 'real')
assume (y, 'real')
f=log(x/y);
fplot(subs(f,y,2.555),[1,20])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by