Semilog plot in curve fitting tool

55 ビュー (過去 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 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by