How to simplify or expand factors?

7 views (last 30 days)
Sachi
Sachi on 8 Jan 2015
Edited: Sachi on 8 Jan 2015
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.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 8 Jan 2015
Edited: Azzi Abdelmalek on 8 Jan 2015
Use the product .*
x=0:0.01:11;
y=(x-1).*(x-2)
  1 Comment
Sachi
Sachi on 8 Jan 2015
Edited: Sachi on 8 Jan 2015
So what's the difference? How do I know when to use ".*" and when to use "*"?

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Object Properties in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!