Azzera filtri
Azzera filtri

need help to plot x,y data points with 'o' without line and y_hat smooth graph

2 visualizzazioni (ultimi 30 giorni)
function [m,n] = exp_n(x,y)
X=x;Y=log(y);
Pn=polyfit(X,Y,1);
n=Pnfit_sq(1,1)
m=exp(Pnfit_sq(2))
tau = 1/a*-1
y_hat=c*exp(a*x);
end
%x=[0 .5 1 1.5 2 2.5 3 3.5 4 4.5 5];
%y=[0 -5.27 -8.10 -8.46 -6.38 -1.84 5.15 14.59 26.48 40.83 57.63];
  3 Commenti
KSSV
KSSV il 2 Dic 2020
function y_hat = exp_n(x,y)
X=x;Y=log(y);
Pn=polyfit(X,Y,1);
n=Pnfit_sq(1,1)
m=exp(Pnfit_sq(2))
tau = 1/a*-1
y_hat=c*exp(a*x);
end
plot(x,y_hat,'-o')
%x=[0 .5 1 1.5 2 2.5 3 3.5 4 4.5 5];
%y=[0 -5.27 -8.10 -8.46 -6.38 -1.84 5.15 14.59 26.48 40.83 57.63];

Accedi per commentare.

Risposte (1)

Chirag Nighut
Chirag Nighut il 14 Dic 2020
You can use the plot function and use an option for styling the line plot to show the line as -o
plot(x,y_hat,'-o')
Above line of code should help.
To know more about plot line styles and other options please refer the following link:

Categorie

Scopri di più su Graph and Network Algorithms in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by