display functions and coefficients from the basic fit tool box on a plot
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Is there away to show basic fitting on a plot whenever the code is run? rather then going to tools > basic fitting and manually doing it everytime?? I want to show the function and coeffecients on a plot everytime the code is run and the plots are produced
0 Kommentare
Antworten (2)
Chunru
am 15 Sep. 2021
Bearbeitet: Chunru
am 15 Sep. 2021
xy = [3.25 0.801369;
3.375 0.883622];
x = xy(:, 1);
y = xy(:, 2);
f1 = @(x) 0.6580*x-1.337209;
f2 = @(x) 0.0632*exp(0.7817*x);
f3 = @(x) 0.0379*x.^2.5890;
f1str = char(f1);
f2str = char(f2);
f3str = char(f3);
plot(x, y, 'b');
hold on
fplot(f1, x([1 end])', 'g');
fplot(f2, x([1 end])', 'k');
fplot(f3, x([1 end])', 'r');
legend({'Data', f1str(5:end), f2str(5:end), f3str(5:end)}, 'Location', 'Best')
1 Kommentar
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!