フィルターのクリア

Getting Input Error With Code

1 回表示 (過去 30 日間)
Bri Men
Bri Men 2021 年 5 月 13 日
コメント済み: Bri Men 2021 年 5 月 13 日
I am trying to run the following code and keep running into the error: Not enough input arguments. Not sure what the issue is?
This is the code:
function [targlinear] = targlin(n)
targlinear = zeros(n,n);
for i = 1:n-1
for j = (i+1):n
targlinear(i,j) = abs(i-j);
targlinear(j,i) = targlinear(i,j);
end
end
DissMale = abs(.50 - Crime_Male);
DissFemale = abs(.50 - Crime_Female);
[R,C] = size(DissMale);
[R,C] = size(DissFemale);
[outperm, rawindex, allperms, index, coord, diff] = ...
uniscalqa(DissMale, targlin(R), randperm(R), 2);
uniscalqa(DissFemale, targlin(R), randperm(R), 2);
coord
outperm
figure;
[linearlength] = linearplot(coord,ouztperm);
  3 件のコメント
Bri Men
Bri Men 2021 年 5 月 13 日
The direct error is: "Targlin requires more input arguments to run: enter input arguments by typing them in now." and I called out the function by typing it into the script window. Not sure if this is what you mean?
Bri Men
Bri Men 2021 年 5 月 13 日

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2021 年 5 月 13 日
You need to rearrange your code.
DissMale = abs(.50 - Crime_Male);
DissFemale = abs(.50 - Crime_Female);
[R,C] = size(DissMale);
[R,C] = size(DissFemale);
[outperm, rawindex, allperms, index, coord, diff] = ...
uniscalqa(DissMale, targlin(R), randperm(R), 2);
uniscalqa(DissFemale, targlin(R), randperm(R), 2);
coord
outperm
figure;
[linearlength] = linearplot(coord,ouztperm);
function [targlinear] = targlin(n)
targlinear = zeros(n,n);
for i = 1:n-1
for j = (i+1):n
targlinear(i,j) = abs(i-j);
targlinear(j,i) = targlinear(i,j);
end
end
end
  1 件のコメント
Bri Men
Bri Men 2021 年 5 月 13 日
thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by