I need matlab code to generate smooth curve for data set
Show older comments
x1 =[ 450 600 1500 3000 6000];
y1 =[ 1.8 1.0 0.43 0.3 0.22];
x2 =[ 750 1000 2500 5000 10000];
y2 =[ 3.6 2 0.86 0.6 0.44];
x3=[ 900 1200 3000 6000 12000];
y3 =[ 5.4 3.6 1.29 0.9 0.66];
plot(x1,y1);
hold on;
plot(x2,y2);
hold on;
plot(x3,y3);
title('operation current vs operation time');
xlabel('operation current(A)');
ylabel ('operation time(s)');
grid on;
i used curve fitting tool but cant plot all 3 curves in same grap

Accepted Answer
More Answers (1)
Thiago Henrique Gomes Lobato
on 1 Mar 2020
if you look at the result you will see the fit function for each curve. In your actual image the "f(x)=a*x^b+c" with the coefficients below. You literally just need to plot this function with a given x interval. An example:
x1=400:6200;
y1 = a1*x1.^b1+c1; % Just copy the coefficient values from the result box for each curve
plot(x1,y1)
1 Comment
dpb
on 1 Mar 2020
But, there are only 4 significant digits in the display and one has to manually write the expression besides...not at all pleasant task.
There is a Generate Code option under the File menu that will write the above code (and a lot more that typically isn't needed) that can then use to get the actual coefficients in the model.
There's a Save Session function as well, but all one can do with it is to reload the data back into the tool.
Categories
Find more on Smoothing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!