How to simplify or expand factors?

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

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 Get Started with MATLAB in Help Center and File Exchange

Tags

Asked:

on 8 Jan 2015

Edited:

on 8 Jan 2015

Community Treasure Hunt

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

Start Hunting!