All pastes #27405 Raw Edit

Untitled

public text v1 · immutable
#27405 ·published 2005-11-02 14:52 UTC
rendered paste body
X = 200:100:900;
xrwma = [{'kx-'}, {'bo-'}, {'m*:'}, {'rv--'}];

Y = erwthma31(100);
        
    figure
    hold on
    for N = 3:1:6
        [P, S, MU] = polyfit(X, Y, N);
        %[Y, DELTA] = polyval(P, X, S);      % extra
        fprintf('polynomial coefficient:\n'); P
        fprintf('sfalma proseggishs:\n'); S.normr
        plot(X, S.normr, char(xrwma(N-2)));
        %plot(X, DELTA, char(xrwma(N-2)));
        %legend('N = 3', 'N = 4', 'N = 5', 'N = 6', 'Location', 'NorthWest');
    end
    legend('N = 3', 'N = 4', 'N = 5', 'N = 6', 'Location', 'NorthWest');
    xlabel('mege8os eisodoy');
    ylabel('sfalma S.normr');
    title('A + b*c(anastrofos)');
    hold off




----------
The legend show N=3, 4, 5 and 6 in kx- only, can't find out how to make it show ths N's separately