how to run the m-file several times
조회 수: 1 (최근 30일)
이전 댓글 표시
if i have karate.txt file us.txt file, s of karate and s for us. i wrote this code to run it on karate and us data sets, it run correctly on a single data set but i want previous code general to all data.
function auc=result(data)
adj=edgeL2adjj(data)
disp('Contents of workspace before loading file:')
whos
disp('Contents of s of karate.mat:')
whos('-file','s of karate.mat')
load('s of karate.mat')
disp('Contents of workspace after loading file:')
whos
f=size(adj,1);
[X,Y] = ndgrid(1:f,1:f);
D = [X(:).' ; Y(:).' ; adj(:).'];
v=D(end,:);
o=f*f;
testlink=(1:o);
[~,~,~,myAuc] = perfcurve(v,s(testlink), 1)
end
댓글 수: 0
답변 (1개)
Thorsten
2015년 10월 21일
편집: Thorsten
2015년 10월 21일
It is not entirely clear to me what you try to achieve. If you want to load s from different mat files, you can do so using
function auc=result(data, matfile)
% your code here
load(matfile, 's');
% your code here
And call it using
auc1 = result(mydata, 'karate.mat');
auc2 = result(mydata, 'us.mat');
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!