what is the problem
3 ビュー (過去 30 日間)
古いコメントを表示
x=0:0.1:6;
fx=exp(x)*sin^2*(x);
plot(x,fx,'linewidth', 1.5)
xlabel('x','fontweight','bold','Fontsize',15)
ylabel('fx','fontweight','bold','Fontsize',15)
set(gca,'fontsize',15)
set(gcf,'color','w')
title('fx vs x')
axis square
0 件のコメント
採用された回答
Star Strider
2021 年 4 月 7 日
Two problems, actually.
Use element-wise muultiplication and exponentian operators:
fx=exp(x)*sin^2*(x);
↑ ← HERE
and use the correct call to the sin function and use element-wise exponentiation operator:
fx=exp(x)*sin(x)^2;
↑ ← HERE
producing the correct expression:
fx=exp(x).*sin(x).^2;
0 件のコメント
その他の回答 (2 件)
naddin Jr. Julius Peter
2021 年 4 月 22 日
x=0:0.1:6;
fx=exp(x)*sin^2*(x);
plot(x,fx,'linewidth', 1.5)
xlabel('x','fontweight','bold','Fontsize',15)
ylabel('fx','fontweight','bold','Fontsize',15)
set(gca,'fontsize',15)
set(gcf,'color','w')
title('fx vs x')
axis square
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!