I am getting error matrix demension does not agree

RGB =imread('mammogram.jpg');
hsv=rgb2hsv(RGB);
imshow(hsv);
i= 1:20:120;
r1=0.1;
r2=0.85;
s=0.8;
wgray=1-s^(r1*(255/i)^r2);
in line 5 i want to input value of i from 1 to 120 with diffference of 20
thanks

 Accepted Answer

wgray = 1 - s.^(r1*(255./i).^r2);

3 Comments

Thanks so much sir... I exactly got want i want thanks once again
if i want to enter the value os s from 0.0 to 1.0 then wgray???
s = 0:0.05:1; %for example
wgray = 1 - bsxfun(@power, s(:), (r1*(255./(i(:).')).^r2) );
The result would be length(s) by length(i)

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!