
為什么會彈出這個錯誤?
我想知道為什么缺少輸入引數
我把 x 的運算式寫錯了嗎?
x 的運算式是

我嘗試修改 x 的運算式以及 fplot 的范圍,但我做不到。
my_function=@(x)my_function((-x.^2)-(5.*x)-3 (exp.^x))
my_function =
function_handle with value:
@(x)my_function((-x.^2)-(5.*x)-3 (exp.^x))
>> fplot(my_function,[-5:5])
Error using fplot
Invalid parameter '-5 -4 -...'.
>> fplot(my_function,[-5 5])
Warning: Error updating FunctionLine.
The following error was reported evaluating the
function in FunctionLine update: Not enough input
arguments.
>> fplot(my_function,[-5,5])
Warning: Error updating FunctionLine.
The following error was reported evaluating the
function in FunctionLine update: Not enough input
arguments.
>> fplot(my_function,[-5,5,1])
Error using fplot
Invalid parameter '-5 5 1'.
>> fplot(my_function,(-5,5))
fplot(my_function,(-5,5))
↑
Invalid expression. When calling a function or indexing
a variable, use parentheses. Otherwise, check for
mismatched delimiters.
>> fplot(my_function,[-5,5])
Warning: Error updating FunctionLine.
The following error was reported evaluating the
function in FunctionLine update: Not enough input
arguments.
The issues to be addressed are:
Use the fplot function to plot the function over the range of x from -5 to 5.
uj5u.com熱心網友回復:
exp不是一個值,它是一個函式,并且您沒有提供任何輸入(因此出現錯誤訊息)。exp.^x應該替換為exp(x)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/522620.html
標籤:matlab
