Problem about plotting 2D about multiple of functions

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.

 채택된 답변

Mischa Kim
Mischa Kim 2016년 12월 6일
편집: Mischa Kim 2016년 12월 6일
Amin, use instead
y = floor(sin(x)) .* floor(x); % notice the period before the *
This allows you to do element-wise multiplication.

댓글 수: 1

Thanks for answer. I have another question. when I draw a graph like my graph in my question It's like this. my problem is that the circle that I showed is only one point and there is no line between this point and my graph but Matlab joint this points with a line to my graph. Is it possible to change this property? Thanks again.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

태그

질문:

2016년 12월 6일

댓글:

2016년 12월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by