i am writing a matlab function to produce a matching gray scale image. code is working in command line when i run it line by line but not running as a function and giving errors
too many input argumentsError in imagesc (line 18) hh = image(varargin{1},'CDataMapping','scaled');Error in image (line 19)imagesc(j);
i am new to matlab and unable to understand.
function code is:
function image(grayLevel)I = [255,255,0,0;255,255,0,0;0,0,255,255;0,0,255,255];j = repmat(I,64); i = 16; m = 32; while (i<256) while(i<=m) for k = 1:256 j(i,k) = grayLevel; end i = i+1; end i = i +16; m = i+16; end imagesc(j); end
any help or suggestions?
Best Answer