MATLAB: Error using ==> times

error

what does it mean that error below. can anyone explain to me. i can not understand the error. thanks
??? Error using ==> times
Integers can only be combined with
integers of the same class, or
scalar doubles.

Best Answer

You can do this:
m = int32(1:3);
n = m .* 2; % integer class times scalar double
You can't do this:
m = int32(1:3);
n = m .* [4:6]; % integer class times same size double
So if you need to do the latter, you can do it like this:
m = int32(1:3);
n = m .* int32([4:6]); % integer class times same size same class