Problem about plotting 2D about multiple of functions
1 view (last 30 days)
Show older comments
Hi.
I started Matlab recently. I wanted to draw this graph but Matlab always say this error.
x = 0:pi/100:6*pi;
y = floor(sin(x)) * floor(x);
plot(x,y);
Error using *
Inner matrix dimensions must agree.
Is it possible to help me? I'm sorry for bad English too.
Thanks.
0 Comments
Accepted Answer
Mischa Kim
on 6 Dec 2016
Edited: Mischa Kim
on 6 Dec 2016
Amin, use instead
y = floor(sin(x)) .* floor(x); % notice the period before the *
This allows you to do element-wise multiplication.
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!