필터 지우기
필터 지우기

how to run the m-file several times

조회 수: 1 (최근 30일)
muhammad ismat
muhammad ismat 2015년 10월 21일
편집: Thorsten 2015년 10월 21일
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

답변 (1개)

Thorsten
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');

카테고리

Help CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by