Borrar filtros
Borrar filtros

Equation of the Line in command window

4 visualizaciones (últimos 30 días)
Ashley Megow
Ashley Megow el 8 de Oct. de 2020
Comentada: Star Strider el 8 de Oct. de 2020
I have a graph, with an equation, but i need to display that equation into the command window.

Respuesta aceptada

Star Strider
Star Strider el 8 de Oct. de 2020
Try this:
B = [y(:) ones(size(y(:)))] \ x(:);
fprintf('Linear: y = %.4f*x%+.2f', B) % Display In Command Window
text(0, max(ylim), sprintf('Linear: y = %.4f*x%+.2f', B), 'HorizontalAlignment','left', 'VerticalAlignment','top') % Display On Plot
.
  4 comentarios
Ashley Megow
Ashley Megow el 8 de Oct. de 2020
Thank you
Star Strider
Star Strider el 8 de Oct. de 2020
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Large Files and Big Data en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by