Problem about plotting 2D about multiple of functions

2 ビュー (過去 30 日間)
Amin Bor
Amin Bor 2016 年 12 月 6 日
コメント済み: Amin Bor 2016 年 12 月 7 日
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 件のコメント
Amin Bor
Amin Bor 2016 年 12 月 7 日
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 件)

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by