← ClaudeAtlas

matlab-symbolic-mathlisted

Generate correct MATLAB code using the Symbolic Math Toolbox. Use when the user asks for symbolic computations, analytical solutions, symbolic differentiation/integration, equation solving, or converting symbolic results to numeric MATLAB functions. Also use when converting differential equations to transfer functions or state-space form.
matlab/agent-skills-playground · ★ 124 · AI & Automation · score 77
Install: claude install-skill matlab/agent-skills-playground
# MATLAB Symbolic Math Toolbox This skill provides guidelines, correct syntax, and common patterns for generating MATLAB® code that uses Symbolic Math Toolbox. ## When to Use This Skill - Creating or manipulating symbolic variables, expressions, and functions - Performing symbolic differentiation, integration, limits, or summation - Simplifying, factoring, expanding, or collecting symbolic expressions - Computing Laplace, Fourier, or Z-transforms and their inverses - Deriving transfer functions or state-space equations from differential equations - Displaying or plotting symbolic expressions - Using variable precision arithmetic (VPA) - Generating MATLAB functions, Simulink function blocks, Simscape equations, and C code from symbolic expressions ## Critical Rules ### 1. NEVER Pass Strings or Character Vectors to Symbolic Functions **WRONG (deprecated — warns today, errors in a future release; the single `=` in `solve` errors now):** ```matlab solve('x^2 + 2*x - 3 = 0') dsolve('Dy = -a*y') ``` **CORRECT:** ```matlab syms x solve(x^2 + 2*x - 3 == 0, x) syms y(t) a dsolve(diff(y,t) == -a*y) ``` ### 2. Use `syms` for Interactive Work, `sym` for Functions and Constants - **`syms x y z`** — Creates fresh symbolic variables and clears any prior assumptions. Use for interactive scripts and Live Scripts. - **`x = sym('x')`** — Refers to a symbolic variable. Inherits existing assumptions. Required inside MATLAB functions (not scripts) because `syms` dynamically creates works