Multiply image with vector

1 次查看(过去 30 天)
Hello is there a function in Matlab where I could multiply an NxM image with a vector ?
I would do something like this :
>> vec = [1,2,3];
>> vec = reshape(vec,[1,1,3]);
>> img = [1,1;1,1];
>> imgrgb = dimmulty(3,vec,img);//imgrgb is a 2x2x3 image
What I am searching is the dimmulty function !

采纳的回答

Sean de Wolski
Sean de Wolski 2014-9-3
编辑:Sean de Wolski 2014-9-3
bsxfun does exactly that :)
>> bsxfun(@times,vec,img)
(I use this really frequently for applying operations to RGB images)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by