Matlab polyfit

%RandomAccess J0237_2 reference
%BasketballPass,BQSqare, BlowingBubbles,RaceHorses,
close all;
clear all;

RD = [
1507.09 40.64
755.76  36.89
376.83  33.56
196.96  30.77
1610.73  37.97
631.13  34.63
284.29  31.81
141.13  29.12
1634.23  38.18
749.48  34.79
353.55  31.62
166.08  28.72
1193.66  39.44
587.38  35.73
288.11  32.34
144.13  29.56
];

RD_s(1,1:4,1:2) = RD(1:4,:);
RD_s(2,1:4,1:2) = RD(5:8,:);
RD_s(3,1:4,1:2) = RD(9:12,:);
RD_s(4,1:4,1:2) = RD(13:16,:);

n = 4;
colorset = {{'rx','r-'},{'bo','b-'},{'gd','g-'},{'c+','c-'}};

for seq_id = 1:1:n
    x = RD_s(seq_id,:,1); %rate
    y = RD_s(seq_id,:,2); %distortion
    fx = polyfit(x,y,2);
    yvalue = polyval(fx,x);
    x1 = 0:20:max(x);
    y1 = polyval(fx,x1);
    %y2 = fx(1)*x1.^2 + fx(2)*x1 + fx(3); %polyval(fx,x1);
    %figure(seq_id);
    plot(x,y,colorset{1,seq_id}{1,1},x1,y1,colorset{1,seq_id}{1,2});
    hold on
    grid on;
end

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值