ploting function and its derivative error
3 ビュー (過去 30 日間)
古いコメントを表示
I want to run this code but I am getting error conversion to double from sym is not possible please help
clear all
close all
syms x y z t
f=log(x)+sin(x);
y=diff(f,x,1);
z=diff(f,x,4);
t=diff(f,x,5);
x=0:1;
plot(f,x);
hold on
plot(y,x);
hold on
plot(z,x);
hold on
plot(t,x);
hold off
title('multiple plots of function and its higher order derivatives');
xlabel('x');
ylabel('y');
axis square
grid;
0 件のコメント
回答 (1 件)
Star Strider
2021 年 3 月 9 日
syms x y z t
f=log(x)+sin(x);
y=diff(f,x,1);
z=diff(f,x,4);
t=diff(f,x,5);
x=0:1;
figure
fplot(f,x);
hold on
fplot(y,x);
fplot(z,x);
fplot(t,x);
hold off
title('multiple plots of function and its higher order derivatives');
xlabel('x');
ylabel('y');
axis square
grid
xlim([0 1E-3]) % <- AADDED (Optional)
.
0 件のコメント
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!