inline.inline at 47

1 view (last 30 days)
Hello people,
Can someone explain what's kind of error is this:
inline.inline at 47 Input must be a string.
P.S. I use diff function in my code.

Accepted Answer

Walter Roberson
Walter Roberson on 4 Mar 2012
syms x
fun = sym( get(handles.edit4,'String') );
f = matlabFunction(fun, x);
dfun = diff( fun, x );
df = matlabFunction(dfun, x);

More Answers (1)

Wayne King
Wayne King on 4 Mar 2012
The kind of error you are reporting comes from trying to input a non-string input in inline()
For example:
t = 10;
g = inline(t^2);
Are you trying to do symbolic differentiation?
Wayne King
Wayne King on 4 Mar 2012
Hi, No, because diff(y) here is going to return a double-precision vector, which results in the error I showed you above.

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!