Unrecognized function or variable 'x'.

3 ビュー (過去 30 日間)
Emiliyan Stefanov
Emiliyan Stefanov 2021 年 12 月 4 日
回答済み: the cyclist 2021 年 12 月 4 日
function y=f(x) %error message Input argument x might be unused
m = linspace(0,Inf,100);
x = linspace(-2.*pi,2.*pi);
y= int(x.^2 .* exp(-(x/2)), 0, m) - 8;

回答 (1 件)

the cyclist
the cyclist 2021 年 12 月 4 日
Because you have the code
x = linspace(-2.*pi,2.*pi);
the value of x that comes in via the input is never used. That is why you see a warning message.

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by