matlab

Write and execute MATLAB and GNU Octave scripts for numerical computing and visualization.

Updated Oct 7, 2022
One-click install
npx skills add https://github.com/tamagusko/linux-cfg --skill matlab-tamagusko
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: matlab
Source: https://github.com/tamagusko/linux-cfg/tree/main/dotfiles/claude/skills/matlab
Command: npx skills add https://github.com/tamagusko/linux-cfg --skill matlab-tamagusko

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing correct MATLAB or GNU Octave code for matrix operations, data analysis, and scientific visualization requires knowing hundreds of functions and syntax details, and this Skill provides structured guidance and references to produce working scripts quickly. ## Core Features & Use Cases - Numerical Computing Guidance: Covers matrix operations, linear algebra, ODE solving, optimization, statistics, and signal processing with ready-to-adapt code patterns. - Visualization and Data I/O: Provides 2D/3D plotting, figure export, and file import/export recipes for CSV, Excel, MAT files, and images. - MATLAB/Octave Portability: Documents syntax differences and compatibility rules so scripts run in both MATLAB and the free GNU Octave interpreter. - Use Case: A researcher needs to load experiment CSVs, fit a curve, solve a differential equation, and export publication-quality plots; the Skill supplies the exact functions and patterns for each step. ## Quick Start Ask the assistant to write a MATLAB script that loads a CSV file, computes descriptive statistics, and saves a labeled plot as a PNG.

Frequently Asked Questions about matlab

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

FAQPage Schema
How do I run a MATLAB script from the command line?

Run MATLAB scripts non-interactively with matlab -batch "run('script.m')", which executes the script and exits with a proper status code. For GNU Octave, use octave --no-gui script.m or octave --quiet --eval for one-liners.

What is the difference between MATLAB and GNU Octave?

GNU Octave is a free, open-source alternative with high MATLAB compatibility, and most scripts run unmodified. Key differences include Octave-only operators like ++ and +=, missing MATLAB toolboxes, and partial classdef support.

Can MATLAB scripts run in GNU Octave without changes?

Most basic scripts run without modification if you use % comments, 'end' block terminators, single-quoted strings, and avoid toolbox-specific functions. Save MAT files with -v7 format and test in both environments to confirm compatibility.

How do I solve differential equations in MATLAB?

Use ode45 for nonstiff ODEs by passing a function handle, time span, and initial conditions, such as [t, y] = ode45(@(t,y) -2*y, [0 5], 1). Convert higher-order equations into first-order systems, and try ode15s for stiff problems.

Why is my MATLAB loop slow and how do I fix it?

Loops are slow when arrays grow without preallocation or when operations could be vectorized. Preallocate with zeros(1, n) before the loop, and replace element-wise loops with vector operations like y = sin(x) or logical indexing.