Difference between revisions of "QuickCompareSieves"

From BanghamLab
Jump to navigation Jump to search
(Created page with " function quickCompareSieves(X, scale, types ) <span style="color: Green">%quickCompareSieves(X, scale )</span> <span style="color: Green">% </span> <span sty...")
 
 
Line 1: Line 1:
function quickCompareSieves(X, scale, types )
+
[[Types of 1D sieve|Return]]<br><br>
 +
 
 +
 
 +
 
 +
 
 +
function quickCompareSieves(X, scale, types )
 
     <span style="color: Green">%quickCompareSieves(X, scale )</span>
 
     <span style="color: Green">%quickCompareSieves(X, scale )</span>
 
     <span style="color: Green">%  </span>
 
     <span style="color: Green">%  </span>

Latest revision as of 16:34, 7 August 2014

Return



function quickCompareSieves(X, scale, types )

    %quickCompareSieves(X, scale )
    %   
    %X, data
    %scale, scale at which different sieves will be compared
    %types, 'o' etc.
    
    if nargin<1
        X=[1 1 1 1 10 1 1 1 1 2 2 1 1 1 1 1 5 5 5 5 5 1 1 1 5 5 5 5 1 1 1 1 1];
    end
    if nargin<2
        scale=5;
    end
    if nargin<3
        types={'o','c','m','n','v'};
    end
    X=X+randn(size(X))*0.1*max(X(:));
    subplot(2,1,1);cla
    plot(X)
    title('X')
    colours='rmbck';
    for i=1:length(types)
        type=types{i};
        subplot(2,1,2)
        y=siv1_alt(X,scale,type);
        if i==1
            cla
            plot(X,'ok')
            hold on
        end
        plot(y,'-','color',colours(i));
    end
    title(sprintf('scale=%d o'c(red,magenta)m'n(blue, cyan),v (black)',scale));
    
end