Я думаю, что проблема с размерами, а не с аргументами.Следующий код работает для меня:
% you can switch it with your own image after you see it works
I = imread('cameraman.tif');
A = im2double(I);
% scalar*matrix works in matlab commandline,
% but needs to be defined when it comes to equations
x1=2.1*eye(size(A));
b=A*x1;
opts.UT = true;
opts.TRANSA = false;
A1 = linsolve(x1,b,opts);
figure; imshow(A1);
[edit] для @SKM и @gary, вот подробное решение (для случая RGB):
% example for RGB image
Img= im2double( imread('peppers.png') );
Dim = size(Img, 3);
% transform the original image,
% by multiplying every color channel by different scalar.
% that is going to be a very red image...
a = [1 0.5 0.2];
aMat = []; newImg = [];
for Ind=1:Dim
aMat(:, :, Ind) = a(Ind)*eye( size(Img, 1), size(Img, 2) );
newImg(:, :, Ind) = a(Ind)*squeeze(Img(:, :, Ind));
end
% recontructing original image
recontrcutedImg=[];
for Ind=1:Dim
recontrcutedImg(:, :, Ind) = linsolve( aMat(:, :, Ind), newImg(:, :, Ind) );
end
% show the images
figure;
subplot(1, 3, 1); imagesc(Img); title('original');
subplot(1, 3, 2); imagesc(newImg); title('changed image');
subplot(1, 3, 3); imagesc(recontrcutedImg); title('reconstructed image');