I'm self learning matlab and I wanted to plot a graph. I think I have missed an important fact regarding multiplication in matlab. How can I multiply something like the following?
>> x=0:0.01:11;
>> y=(x-1)*(x-2);
Error using *
Inner matrix dimensions must agree.

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 8 Jan. 2015
Bearbeitet: Azzi Abdelmalek am 8 Jan. 2015

1 Stimme

Use the product .*
x=0:0.01:11;
y=(x-1).*(x-2)

1 Kommentar

Sachi
Sachi am 8 Jan. 2015
Bearbeitet: Sachi am 8 Jan. 2015
So what's the difference? How do I know when to use ".*" and when to use "*"?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 8 Jan. 2015

Bearbeitet:

am 8 Jan. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by