Hi, I am new to Matlab programming. The graph result should be have a range of x-asix from -1 to 1, but now the graph is from 0 to 1. I want to set the range for x-axis from -1 to 1. May I know anyone can help me?
This is the current program code.
This is my current result:
Thanks in advance!

댓글 수: 3

Walter Roberson
Walter Roberson 2019년 11월 22일
You call interp1 with four numeric values and then the 'spline' method. However interp1 is only defined with at most three numeric values before the method parameter.
KIEN WEI LAI
KIEN WEI LAI 2019년 11월 22일
Hi, may I know how can I edit the Matlab code?
You mean limits of x?
xlim([-1 1])

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

 채택된 답변

the cyclist
the cyclist 2019년 11월 22일

0 개 추천

Here is my best guess at what you should do, to get what you want:
  • Take the x argument out of the call to interp1
  • Change the definition of interp_no_ding to be interp_no_ding = -1:1/50:1

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

태그

질문:

2019년 11월 22일

댓글:

2019년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by