- Open the figure window in undocked mode.
- Use tools that are required for your use case.
- Navigate to File --> Generate Code.
- A new file is created with all the code for the updated figure.
- Change the name of the function on the first line from createfigure to something more specific, like censusplot. Save the code file to your current folder with the file name censusplot.m
- Use this function in original file to reproduce the plot with the new data as arguments
- Publish your file
Publish a plot with Tools menu specifications
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm trying to use a linear fit with a my data plot, but when I publish it only plots the data points.
Is there some code that does the same thing as the Tools menu?
댓글 수: 0
답변 (1개)
Aniket
2025년 6월 11일
편집: Aniket
2025년 6월 11일
Yes, the interactive tools (eg. Data Fitting) used in a figure window do not change the code in the original MATLAB file and thus do not reflect in the published file. Please follow below steps to get the updated code:
You can find more details regarding interactive fitting in this documentation: https://www.mathworks.com/help/matlab/data_analysis/interactive-fitting.html
I hope this helps!
댓글 수: 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!