我是MATLAB的初學者。我有我的功能testnetwork
:使用單元陣列並獲取太多輸入參數錯誤
function result = TestNetwork(network, input)
result = input;
b= [-1 -1 -1 -1 ];
% Iterate over all the couches
for i=1:length(network.couches)
result = network.activation(matrix_multiplication_same_dimension(network.couches{i} , vertcat (result , b)));
end
end
,這是我的主要腳本:
% initialis a cell of zeros for example output = zeros_quat(zeros(1, 2)) is %equal to [0 0 0 0] [0 0 0 0]
output = zeros_quat(zeros(10, size(testset,2)));
%
for i = 1:size(testset, 2)
%testset is a cell of arrays size (81 * 180)
output {:,i} = TestNetwork(network, testset{:,i});
end
end
我得到的錯誤too many input arguments
。我不知道問題是什麼。
你的問題是'testset {:,i}'。這將產生一個由180個元素組成的以逗號分隔的列表。這意味着你試圖用180 + 1輸入來提供你的功能。我不知道'testset {:,i}'實際上應該是什麼,所以我不能評論你想要做什麼。另外,一旦解決了'testset {:,i}'問題,'output {:,i}'會給你一個錯誤。 – rayryeng
@rayryeng正是我想加載181因爲couche.netwok是一個矩陣和matrix_multiplication_same_dimension乘以2矩陣 –
.....呃,什麼? – rayryeng