Hello!
I have a series of data and using the custom equation, I could fit the data on the theoritical equation. I would like to see the graph and fit curve in log scale but I don't know I to change the x values in log scale. Coyuld you please let me know how to do it? Haev a nice day!
Hye Rim

 채택된 답변

Arnaud Miege
Arnaud Miege 2011년 5월 26일

2 개 추천

From the curve fitting tool, once you're done with the fitting, click on File -> Generate Code to generate the MATLAB code for your fit. You can then run that code with whatever data you want, but more to the point you can also modify it. Find the part of the code where the plotting is done, and replace the plot command by semilogx, as Laura suggested.

댓글 수: 6

Hye Rim
Hye Rim 2011년 7월 29일
Arnaud,
Thanks very much for your help. It was very helpful for the trouble shooting ! :)
Bumping this very old thread.
This no longer works (not sure if it's the new curve fitting toolbar or something else). When I replace plot with semilogx i get this:
Error using semilogx
Conversion to double from cfit is not possible.
Error in temp (line 70)
h = semilogx( fitresult{1}, xData, yData );
Anyone got a fix?
Ali
Ali 2014년 8월 26일
same here as above comment.
after the plot command
set(gca,'XScale','log')
should do the job. I am using Matlab R2014b and the above works nicely.
armin farshbaf
armin farshbaf 2017년 6월 10일
this way you could only get at base 10 logarithm, do u have any idea for base 2 ?!
Igor Gitelman
Igor Gitelman 2021년 7월 31일
편집: Igor Gitelman 2021년 7월 31일
just take
log2(x)
from yor data - x.

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

추가 답변 (1개)

Laura Proctor
Laura Proctor 2011년 5월 26일

0 개 추천

I think you're looking for the function SEMILOGX.

카테고리

도움말 센터File Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

질문:

2011년 5월 26일

편집:

2021년 7월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by