필터 지우기
필터 지우기

Equation of the Line in command window

조회 수: 4 (최근 30일)
Ashley Megow
Ashley Megow 2020년 10월 8일
댓글: Star Strider 2020년 10월 8일
I have a graph, with an equation, but i need to display that equation into the command window.

채택된 답변

Star Strider
Star Strider 2020년 10월 8일
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
Ashley Megow
Ashley Megow 2020년 10월 8일
Thank you
Star Strider
Star Strider 2020년 10월 8일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by