How to plot smooth curve in matlab

조회 수: 128 (최근 30일)
Awat
Awat 2016년 10월 24일
편집: MathWorks Support Team 2023년 3월 2일
x=[0 0.025 0.05 0.075 0.1 0.125 0.15 0.175 0.2 0.225 0.25 0.275 0.3 0.325 0.35 0.375 0.4 0.425 0.45 0.475 0.5 0.525 0.55 0.575 0.6 0.625 0.65 0.675 0.7 0.725 0.75 0.775 0.8 0.825 0.85 0.875 0.9 0.925 0.95 0.975 1 ]
y=[1.422 1.427 1.431 1.396 1.396 1.377 1.377 1.358 1.357 1.338 1.338 1.319 1.318 1.301 1.301 1.288 1.287 1.278 1.278 1.274 1.274 1.275 1.276 1.282 1.282 1.294 1.294 1.309 1.310 1.328 1.328 1.348 1.348 1.367 1.367 1.386 1.386 1.413 1.413 1.039 1.025]
  댓글 수: 2
KSSV
KSSV 2016년 10월 24일
What you want to do with it?
Awat
Awat 2016년 10월 24일
I plot the data but this graph not smooth curve. I want to the smooth curve using Matlab.

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2016년 10월 24일
편집: MathWorks Support Team 2023년 3월 2일
UPDATE:
Starting in R2017a, you can smooth noisy data using built in MATLAB functionality:
clc; clear all ;
x=[0 0.025 0.05 0.075 0.1 0.125 0.15 0.175 0.2 0.225 0.25 0.275 0.3 0.325 0.35 0.375 0.4 0.425 0.45 0.475 0.5 0.525 0.55 0.575 0.6 0.625 0.65 0.675 0.7 0.725 0.75 0.775 0.8 0.825 0.85 0.875 0.9 0.925 0.95 0.975 1 ] ;
y=[1.422 1.427 1.431 1.396 1.396 1.377 1.377 1.358 1.357 1.338 1.338 1.319 1.318 1.301 1.301 1.288 1.287 1.278 1.278 1.274 1.274 1.275 1.276 1.282 1.282 1.294 1.294 1.309 1.310 1.328 1.328 1.348 1.348 1.367 1.367 1.386 1.386 1.413 1.413 1.039 1.025] ;
yi = smooth(y) ;
plot(x,y,'r')
hold on
plot(x,yi,'b') ;
  댓글 수: 4
Shaleena Manafudeen
Shaleena Manafudeen 2021년 3월 18일
I tried to execute the same program in Matlab R2019b and obtained error as follows:-
Error in smooth (line 5)
yi = smooth(y) ;
John Nkor
John Nkor 2021년 4월 23일
@Shaleena Manafudeen The error might suggest that you do not have the "Curve Fitting Toolbox" installed on as an add-ons app. To do this click on the apps tab > get more apps. Once the add-on Explore window opens, search for Curve Fitting Toolbox and install.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Nandana Rajeev
Nandana Rajeev 2019년 6월 25일
how can i plot neutrino ocsillation probability

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by