matlab-fit-curve

Fit curves and surfaces interactively using the MATLAB Curve Fitter app.

995|122|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-fit-curve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab-fit-curve
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/ai-and-statistics/matlab-fit-curve
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-fit-curve

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Choosing and refining a curve or surface fit often requires exploring many fit types, excluding outliers, and comparing goodness-of-fit metrics, which is tedious and error-prone when done blindly from the command line. This Skill guides an AI agent through the complete interactive fitting workflow in the MATLAB Curve Fitter app, from data selection to export.

Core Features & Use Cases

  • Interactive fitting workflow: Select fitting and validation data, choose from regression, interpolation, smoothing, and custom equation fit types, adjust fit options, and evaluate results with goodness-of-fit metrics.
  • Outlier handling and comparison: Exclude points interactively or via rules, duplicate fits to compare approaches side by side, and review residuals, prediction bounds, and confidence intervals.
  • Export and sharing: Export fits to the MATLAB workspace, generate MATLAB code, save sessions as .sfit files, and export fits to Simulink lookup tables.
  • Use Case: An engineer with sensor data in workspace variables asks the agent to open Curve Fitter, compare a polynomial and an exponential fit, exclude anomalous readings, and export the chosen fit as a Simulink lookup table.

Quick Start

Ask the agent to open the Curve Fitter app with your x and y workspace variables and fit a polynomial curve to the data.

Frequently Asked Questions about matlab-fit-curve

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fit a curve interactively in MATLAB without writing code?

Open the Curve Fitter app with curveFitter(x, y) on R2022a or later, or cftool(x, y) on earlier releases. Select your data, choose a fit type from the gallery, and the app fits automatically while showing goodness-of-fit metrics.

What fit types are available in the MATLAB Curve Fitter app?

The app offers regression models (Polynomial, Exponential, Fourier, Gaussian, Power, Rational, Sum of Sine, Weibull, Sigmoidal), interpolants, smoothing options (Smoothing Spline, Lowess), and custom linear or nonlinear equations. Availability depends on whether your data is a curve or a surface.

What is the difference between cftool and curveFitter in MATLAB?

cftool is the Curve Fitting Tool available in R2021b and earlier, while curveFitter launches the modern Curve Fitter app in R2022a and later. Programmatic control of the app through an agent is only supported on R2022a and later.

Can the Curve Fitter app export fits to Simulink lookup tables?

Yes, on R2022b and later with Simulink installed, the app exports curve or surface fits as lookup table blocks using explicit breakpoints or even-spacing specifications. R2024a and later also supports the Lookup Table Optimizer with Fixed-Point Designer.

When should I use CLI fit functions instead of the Curve Fitter app?

Use CLI functions like fit() and fittype() when you already know the fit type and options, want to overlay multiple fits on the same axes, or are writing scripts. The app is better for interactive exploration, visual outlier exclusion, and Simulink lookup table export.