How can i obtain a nice curve ?

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)

 Accepted Answer

Star Strider
Star Strider on 14 Jan 2017
Edited: Star Strider on 14 Jan 2017
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 Comments

How can i interpolate to obtain a nice curve ?
I cannot get any interpolation method, or empirical curve-fitting method, to produce the sort of curve in your ‘desired curve.jpg’ image. It would be possible to fit a model of the process that produced your data to it (providing it has fewer than 5 parameters), and then evaluate the model at multiple points to create a smooth curve, but the nature of your data prevent any other method that I have used from producing the plot you want.
If you have a mathematical description (mathematical model) of the process that created your data, I will see what I can do to fit it and evaluate it. No other options appear to be possible.
How can i use spline to loglog(x,p) ?
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.)

Sign in to comment.

More Answers (1)

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 Comment

How can i interpolate to obtain a nice curve ?

Sign in to comment.

Categories

Tags

Community Treasure Hunt

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

Start Hunting!