2D plot of x*sin(1/x)

6 次查看(过去 30 天)
feeroz babu
feeroz babu 2020-12-15
评论: Stephen23 2020-12-15
x = [-1/pi:0.01:1/pi];
y = x*(sin(1/x));
plot(x,y)

采纳的回答

KSSV
KSSV 2020-12-15
编辑:KSSV 2020-12-15
x = [-1/pi:0.01:1/pi];
y = x.*(sin(1./x)); %<------ element by element operation
plot(x,y)

更多回答(1 个)

Walter Roberson
Walter Roberson 2020-12-15
y = x.*(sin(1./x));
In MATLAB the * operator is algebraic matrix multiplication (inner product) and the / operator is matrix division (which is similar to matrix multiplication by pinv() of the array)

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

标签

产品


版本

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by