How do I extract the exponent from a semilogy plot?
조회 수: 2 (최근 30일)
이전 댓글 표시
If I use semilogy to plot some data such that the plot appears as a straight line, how can I extract the exponent of this line? Can I use polyfit to get this or is there a different way?
댓글 수: 0
채택된 답변
Stephan
2019년 2월 26일
편집: Stephan
2019년 2월 26일
Hi,
i think you should use lsqcurvefit (requires Optimization Toolbox) or fit (requires Curve Fitting Toolbox) - depending on the toolboxes you have access to. I would expect an exponential function if there is a straight line in the semilogy plot. Due to this polyfit is not the correct choice. I recommend to work through this examples:
lsqcurvefit:
fit:
In case of lsqcurvefit the resulting elements of solutiuon x contain the needed exponent. In case of fit you get the values with the coeffvalues function.Therefore see also Fit Postprocessing.
Best regards
Stephan
댓글 수: 4
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!