if i have two function
the first function use variables "p" and "r" and result s as follow
function [label,s] = LSC(data,k)if (~exist('opts','var'))opts = [];endN=5; p =20; r = 10;maxIter = 100;numRep = 10;mode = 'kmeans';nSmp=size(data,1);% Landmark selection
if strcmp(mode,'kmeans') kmMaxIter = 5; if isfield(opts,'kmMaxIter') kmMaxIter = opts.kmMaxIter; end kmNumRep = 1; if isfield(opts,'kmNumRep') kmNumRep = opts.kmNumRep; end [dump,marks]=litekmeans(data,p,'MaxIter',kmMaxIter,'Replicates',kmNumRep); clear kmMaxIter kmNumRepelseif strcmp(mode,'random') indSmp = randperm(nSmp); marks = data(indSmp(1:p),:); clear indSmpelse error('mode does not support!');end..[label,s] = kmedo(U',k);end
the second function is
function Accuracy=yarbb(data,x)for i=1:100rng('default')*[cluster_labels,s] = LSC(adj,x);*coordinates=data;Av=[coordinates; fliplr(coordinates)];linindices = sub2ind(size(s), Av(:, 1), Av(:, 2))';remain=setdiff(1:numel(s), linindices);sim=s(remain);similarity=unique(sim);...auc= (ndash + 0.5 * nddash)/(ndash+nddash+nn);endAccuracy = mean(auc)
we note that the second function call the first function in line 4,so i want to variables "p" ,"r" in first function to take values 2:10 and each time calculate accuracy(second function)i.e calculate first function at p=2,r=2 then calculate second function then in second time p=3,r=2 and calculate second function and so on.
Best Answer