I am trying to plot y=x^2sin(x), where x is from 0 to 2pi. I have defined x using the linspace command, but matlab does not agree with the (x.^2) part. Is there a concept I am missing?

9 ビュー (過去 30 日間)
>> x=linspace(0,2*pi);
>> y=(x.^2)*sin(x);
Error using *
Inner matrix dimensions must agree.

採用された回答

Ernesto Martinez
Ernesto Martinez 2019 年 4 月 22 日
y= (x.^2).*sin(x.^-1);

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by