Semilog plot in curve fitting tool

20 次查看(过去 30 天)
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