Problem, when trying to differentate sin(f(x)), with variable x
Ältere Kommentare anzeigen
Hello!
I would like to try some basic functions in Matlab. I faced two problems, which seems unable to solve for me.
If I type:
a=sin(3*x)
b=diff(a,x)
Then I run it:
a=sin(3*x)(3*x)
b=3*D(sin(3*x))(3*x)
I think it should be:
a=sin(3*x)
b=3*cos(3*x)
Please tell me what is wrong with my little code! Thank you!
Akzeptierte Antwort
Weitere Antworten (5)
Andy
am 26 Apr. 2014
0 Stimmen
Andy
am 26 Apr. 2014
0 Stimmen
Walter Roberson
am 27 Apr. 2014
0 Stimmen
I think maybe you had something in your workspace that was interfering. Did you try clearing all variables, or restarting MATLAB?
Roberto
am 27 Apr. 2014
try clearing the workspace
>> clear all;

Andy
am 27 Apr. 2014
0 Stimmen
1 Kommentar
Azzi Abdelmalek
am 27 Apr. 2014
Don't use clear all, just clear your variables
Kategorien
Mehr zu Special Values finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
