2017-03-20 4 views
0

실험에서 매개 변수를 변경하고 각각 실행시 X,Yperfcurve에서 저장해야합니다. 불행히도, 그들은 매번 다른 크기입니다.여러 ROC 곡선 플로팅

for ii=1:length(myparams) 
    %some previous calculations 
    [X,Y,T,abc] = perfcurve(true, scores, 1); 
    X_all(ii, :) = X; 
    Y_all(ii, :) = Y; 
end 
Plot(X_all, Y_all) 

나는이 작업을 좀하고 싶습니다,하지만 난 루프를 통해 XY마다 저장하는 방법을 알아낼 수 없습니다.

답변

3

등 길이가 다른 저장 벡터는 cell array으로 쉽게 구현됩니다. 여기

문제의 적응 :

X_all = cell([1 length(myparams)]); 
Y_all = cell([1 length(myparams)]); 

for ii=1:length(myparams) 
    %some previous calculations 
    [X,Y,T,abc] = perfcurve(true, scores, 1); 
    X_all{ii} = X; 
    Y_all{ii} = Y; 
end 

figure, hold on 
for ii=1:length(myparams) 
    plot(X_all{ii}, Y_all{ii}); 
end 
관련 문제