我試圖乘以矩陣的第一列。我曾嘗試這樣的代碼:矢量矩陣乘法
A = imread('cameraman.tif');
x0 = A(:,1);
y = A*x0;
,但我得到了以下錯誤:
Error using * MTIMES is not fully supported for integer classes. At least one input must be scalar. To compute elementwise TIMES, use TIMES (.*) instead.
,當我我的代碼更改爲:y = A.*x0;
我再次得到:
Error using .* Matrix dimensions must agree.
當我使用whos
命令,我得到這個: A是一個256x256矩陣和x0是一個256x1矩陣。我不知道我的代碼有什麼問題。