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!
