Mostrar comentarios más antiguos
How can we display the regression equation (obtained by camand "fit") in the plot?
Respuesta aceptada
Más respuestas (2)
Richard Willey
el 9 de Feb. de 2012
Try the following
X = linspace(1, 2*pi, 50);
X = X';
Y = sin(X) + randn(50,1);
foo = fit(X,Y, 'sin1');
figure1 = figure;
scatter(X,Y)
hold on
plot(foo)
% Create textbox
annotation(figure1,'textbox',...
[0.147443514644351 0.802739726027397 0.305903765690377 0.0931506849315069],...
'String',{[formula(foo)]},...
'FitBoxToText','off',...
'BackgroundColor',[1 1 1]);
1 comentario
Farz Tak
el 14 de Feb. de 2012
Maria Ghani
el 19 de Oct. de 2022
0 votos
. i need to run regression to get coeffecient between two variables x, y . my data set is daily from 1995 to 2022 . i need monthly coeffecient between two variables . what command should i need to write please anyone help. my dat afile is attached for detail information. x regress y but how i can get for every month ?
thanks in advance
Categorías
Más información sobre Linear Regression en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!