mtimes error when multiply a constant with a matrix

1 view (last 30 days)
[maxF loc]=max(F(:));
[row col]=size(F);
%create a matrix max
G=(128-maxF).*ones(row,col);
??? Error using ==> times
Integers can only be combined with
integers of the same class, or scalar
doubles.
Error in ==> Mor at 24
G=(128-maxF).*ones(row,col);
help me

Accepted Answer

Walter Roberson
Walter Roberson on 21 Oct 2013
G=(128-double(maxF)).*ones(row,col);

More Answers (0)

Community Treasure Hunt

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

Start Hunting!