Problem about plotting 2D about multiple of functions
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Amin Bor
am 6 Dez. 2016
Kommentiert: Amin Bor
am 7 Dez. 2016
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 Kommentare
Akzeptierte Antwort
Mischa Kim
am 6 Dez. 2016
Bearbeitet: Mischa Kim
am 6 Dez. 2016
Amin, use instead
y = floor(sin(x)) .* floor(x); % notice the period before the *
This allows you to do element-wise multiplication.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
