Error using inline. Input must be a string.
6 ビュー (過去 30 日間)
古いコメントを表示
Roberto Antonino Ruggeri
2016 年 2 月 11 日
編集済み: Roberto Antonino Ruggeri
2016 年 2 月 13 日
Hi Everyone. I'm studying the steepest descend method and I have tried to compile this method for a function. The problem is that when I compile, the command window shows "Error using inline (line 51)Input must be a string." and I don't know what to do.
採用された回答
Walter Roberson
2016 年 2 月 11 日
syms X
fprime = matlabFunction( diff(exp(-X)+X.^4', X) );
If you do not have the symbolic toolbox then diff() is entirely the wrong function to use, as diff() on a non-symbolic object X is X(2:end,:) - X(1:end-1,:) -- that is, numeric difference between adjacent elements.
If you do not have the symbolic toolbox then
fprime = @(X) -exp(-X) + 4.*X.^3;
would be the formula.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!