Having trouble finding a derivative

Im fairly new to matlab and I keep getting the same error message.
When the following is entered: diff cot^2(sin theta)
I get:
Error using sym>convertExpression (line 2256) Conversion to 'sym' returned the MuPAD error: Error: Unexpected 'identifier'. [line 1, col 11]
Error in sym>convertChar (line 2167) s = convertExpression(x);
Error in sym>convertCharWithOption (line 2150) s = convertChar(x);
Error in sym>tomupad (line 1881) S = convertCharWithOption(x,a);
Error in sym (line 108) S.s = tomupad(x,'');
Error in char/diff (line 11) y = diff(sym(f),varargin{:});
Would appreciate any help or guidance thank you.

 採用された回答

Walter Roberson
Walter Roberson 2012 年 12 月 12 日

0 投票

syms theta
diff( cot(sin(theta))^2, theta)

3 件のコメント

Frank
Frank 2012 年 12 月 12 日
Awesome thank you!
Tam Ho
Tam Ho 2017 年 12 月 29 日
I ran this code:
syms theta %create symbolic variable theta
assume(theta,'real') %theta is real
f = fit_v2; %calling our fitted polynomials
g = diff(f,theta);
g0=solve(g,theta);
double(g0);
I get this error:
Error in sym (line 215)
S.s = tomupad(x);
Error in sym/privResolveArgs (line 988)
argout{k} = sym(arg);
Error in sym/diff (line 21)
args = privResolveArgs(S,varargin{:});
Error in code (line 54)
g = diff(f,theta);
Walter Roberson
Walter Roberson 2017 年 12 月 29 日
What is fit_v2 ?

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by