# Getting Input Error With Code

1 view (last 30 days)
Bri Men on 13 May 2021
Commented: Bri Men on 13 May 2021
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);
Bri Men on 13 May 2021

Walter Roberson on 13 May 2021
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
Bri Men on 13 May 2021
thank you!