I need matlab code to generate smooth curve for data set
显示 更早的评论
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

采纳的回答
更多回答(1 个)
Thiago Henrique Gomes Lobato
2020-3-1
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 个评论
dpb
2020-3-1
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Interpolation of 2-D Selections in 3-D Grids 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
