Semilog plot in curve fitting tool

조회 수: 20 (최근 30일)
Robert Demyanovich
Robert Demyanovich 2021년 11월 13일
답변: Pavan Guntha 2021년 11월 16일
I am new to using the curve fitting tool. I have some data that I want to fit a curve to. I have clicked on the curve fitting icon in Matlab and the form titled "Curve Fitting Tool" pops up. I've selected the vector containing the x data and the vector containing the y data. I then entered my custom equation and results are put into the "Results" box. Adjacent to the "Results" box is the graph. What I would like to be able to do is to have the graph show as a semilog plot (x values on log scale, y values on linear scale). I can't figure out how to do that.
Note that I am not ready to implement this into my MatLab code. I want to play around with equations first.

채택된 답변

Pavan Guntha
Pavan Guntha 2021년 11월 16일
Hello Robert,
There isn't any direct option to plot the data in a semilog plot using Curve Fitting Toolbox. The workaround is as follows:
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. Then you could vary the axes properties such that 'x' values get plotted on a log scale. The following example illustrates this process:
Consider the 'x' and 'y' data as:
xData = linspace(1,10000,20);
yData = [1:20];
You can click on Generate Code as shown below:
In the generated, after the plot command, you could place the following command to change the x-axis to log scale:
Hope this helps!

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by