i want to multiply input * gex , where input is (60000 *784) and gex is (784 *1000), but when i multiply that i get this error message Error using input Not enough input a
2 ビュー (過去 30 日間)
古いコメントを表示
i want to multiply input * gex , where input is (60000 *784) and gex is (784 *1000), but when i multiply that i get this error message
Error using input
Not enough input arguments.
code :
ThemeCopy
load('w.mat')
Rmin = 1e5
Rmax = 1e6
Gmin = 1.0/Rmax
Gmax = 1.0/Rmin
gex = zeros(size(y));
gin = zeros(size(y));
y=w{1}
for i = 1:numel(y) % numel(y), not length(y)
if y(i)>=0
gex(i) = Gmax*y(i) +Gmin*(1-y(i));
gin(i) = Gmin;
else
gex(i) = Gmin;
gin(i) = -Gmax*y(i) +Gmin*(1+y(i));
end
end
tex = input * gex
0 件のコメント
回答 (1 件)
the cyclist
2022 年 11 月 21 日
The main problem here seems to be that input is a built-in MATLAB function, and your code is trying to call it (and doesn't have enough inputs).
Try renaming your variable to something that is not a MATLAB function name.
1 件のコメント
Walter Roberson
2022 年 11 月 21 日
Ah yes. If you have a variable named input in the .mat file, then MATLAB might not notice that it had been created and might assume that input is still a function later.
That should not, in theory, happen inside a script that is being executed from the top level, but it will happen these days if this is inside a function. If you "poof" a variable into existance by using load without any output assignment, then variable names that happen to match the names of functions might be treated as the function by MATLAB (at least inside functions.)
参考
カテゴリ
Help Center および File Exchange で Time Series Events についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!