필터 지우기
필터 지우기

How can i obtain a nice curve ?

조회 수: 1 (최근 30일)
Mallouli Marwa
Mallouli Marwa 2017년 1월 14일
댓글: Star Strider 2017년 1월 15일
Hi
How can i obtain a nice curve (like attached curve or logarithmic scale), when my program is
x= [1e3; 1e4; 1e5; 1e6; 1e7];
p=[7.87E-07 1.77E-06 1.72E-06 4.44E-07 5.03E-08];
plot(x,p)

채택된 답변

Star Strider
Star Strider 2017년 1월 14일
편집: Star Strider 2017년 1월 14일
See if this does what you want:
x= [1e3; 1e4; 1e5; 1e6; 1e7];
p=[7.87E-07 1.77E-06 1.72E-06 4.44E-07 5.03E-08];
figure(1)
loglog(x,p)
grid
xlabel('Load Resistance [\Omega]')
ylabel('Peak Power [mW/g^{2}]')
EDIT Forgot the square brackets ‘[]’ in ylabel.
  댓글 수: 4
Mallouli Marwa
Mallouli Marwa 2017년 1월 15일
How can i use spline to loglog(x,p) ?
Star Strider
Star Strider 2017년 1월 15일
You can use interp1 with the 'spline' and loglog options to create the interpolation vector, but it will not produce the curve you want. I already did that without success.
Your best option is to provide a diagram or mathematical model of the system you are measuring, and do a (probably nonlinear) fit to it. (I might be able to develop an equation for the model in the diagram if it has fewer than 5 parameters.)

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

추가 답변 (1개)

John D'Errico
John D'Errico 2017년 1월 14일
loglog(x,p)
grid on
It seems a decent enough curve to me. You could use a spline to interpolate, or just a low order polynomial, as fit to the logs of your data. Anytime you have data that spans many orders of magnitude, it is a hint to use logs.
  댓글 수: 1
Mallouli Marwa
Mallouli Marwa 2017년 1월 15일
How can i interpolate to obtain a nice curve ?

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

카테고리

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