How to plot the line of best fit?
이전 댓글 표시
%Project Design %Yellow Band Displacemnt=[0 4 8 12 16 20 24 28 32]; Force = [0 .23 .36 .43 .52 .64 .78 .85 .92]; plot(Displacemnt, Force, 'x') title ('Displacement vs Force'); xlabel('Displacement'); ylabel('Force'); grid zoom on
댓글 수: 3
Khalil
2013년 4월 29일
Khalil
2013년 4월 29일
Shashank Prasanna
2013년 4월 29일
Please format your code using the Code button when you post
채택된 답변
추가 답변 (1개)
wasif saeed
2017년 6월 3일
1 개 추천
is this possible that we can display slope equation on graph .. i have 251 plot of data by a loop than i draw best fit line from every graph now i need intercept and gradient of each graph on plotting.
댓글 수: 1
Image Analyst
2017년 6월 3일
Yes. Use sprintf() to create a string with the equation in it. Then use text() to place that text onto the graph/plot wherever you want it.
카테고리
도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!