Install any skill in seconds. Free to start, no credit card required.
Get Started Free →MATLAB and GNU Octave numerical computing for matrix operations, data analysis, visualization, and scientific computing. Use when writing MATLAB/Octave scripts for linear algebra, signal processing, image processing, differential equations, optimization, statistics, or creating scientific visualizations. Also use when the user needs help with MATLAB syntax, functions, or wants to convert between MATLAB and Python code. Scripts can be executed with MATLAB or the open-source GNU Octave interpreter
.claude/skills/lingxling-matlab/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-14 | ✗→✓ | ▲ Improved | 140% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 91% | 0% |
| case-21 | ✓→✗ | ▼ Worse | 202% | 0% |
| case-22 | ✓→✗ | ▼ Worse | 127% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 241% | 0% |
MATLAB is a numerical computing environment optimized for matrix operations and scientific computing. GNU Octave is a free, open-source alternative with high MATLAB compatibility.
Running MATLAB scripts:
bash# MATLAB (commercial) matlab -nodisplay -nosplash -r "run('script.m'); exit;" # GNU Octave (free, open-source) octave script.m
Install GNU Octave:
bash# macOS brew install octave # Ubuntu/Debian sudo apt install octave # Windows - download from https://octave.org/download
MATLAB operates fundamentally on matrices and arrays:
matlab% Create matrices A = [1 2 3; 4 5 6; 7 8 9]; % 3x3 matrix v = 1:10; % Row vector 1 to 10 v = linspace(0, 1, 100); % 100 points from 0 to 1 % Special matrices I = eye(3); % Identity matrix Z = zeros(3, 4); % 3x4 zero matrix O = ones(2, 3); % 2x3 ones matrix R = rand(3, 3); % Random uniform N = randn(3, 3); % Random normal % Matrix operations B = A'; % Transpose C = A * B; % Matrix multiplication D = A .* B; % Element-wise multiplication E = A \ b; % Solve linear system Ax = b F = inv(A); % Matrix inverse
For complete matrix operations, see references/matrices-arrays.md.
matlab% Eigenvalues and eigenvectors [V, D] = eig(A); % V: eigenvectors, D: diagonal eigenvalues % Singular value decomposition [U, S, V] = svd(A); % Matrix decompositions [L, U] = lu(A); % LU decomposition [Q, R] = qr(A); % QR decomposition R = chol(A); % Cholesky (symmetric positive definite) % Solve linear systems x = A \ b; % Preferred method x = linsolve(A, b); % With options x = inv(A) * b; % Less efficient
For comprehensive linear algebra, see references/mathematics.md.
matlab% 2D Plots x = 0:0.1:2*pi; y = sin(x); plot(x, y, 'b-', 'LineWidth', 2); xlabel('x'); ylabel('sin(x)'); title('Sine Wave'); grid on; % Multiple plots hold on; plot(x, cos(x), 'r--'); legend('sin', 'cos'); hold off; % 3D Surface [X, Y] = meshgrid(-2:0.1:2, -2:0.1:2); Z = X.^2 + Y.^2; surf(X, Y, Z); colorbar; % Save figures saveas(gcf, 'plot.png'); print('-dpdf', 'plot.pdf');
For complete visualization guide, see references/graphics-visualization.md.
matlab% Read tabular data T = readtable('data.csv'); M = readmatrix('data.csv'); % Write data writetable(T, 'output.csv'); writematrix(M, 'output.csv'); % MAT files (MATLAB native) save('data.mat', 'A', 'B', 'C'); % Save variables load('data.mat'); % Load all S = load('data.mat', 'A'); % Load specific % Images img = imread('image.png'); imwrite(img, 'output.jpg');
For complete I/O guide, see references/data-import-export.md.
matlab% Conditionals if x > 0 disp('positive'); elseif x < 0 disp('negative'); else disp('zero'); end % Loops for i = 1:10 disp(i); end while x > 0 x = x - 1; end % Functions (in separate .m file or same file) function y = myfunction(x, n) y = x.^n; end % Anonymous functions f = @(x) x.^2 + 2*x + 1; result = f(5); % 36
For complete programming guide, see references/programming.md.
matlab% Descriptive statistics m = mean(data); s = std(data); v = var(data); med = median(data); [minVal, minIdx] = min(data); [maxVal, maxIdx] = max(data); % Correlation R = corrcoef(X, Y); C = cov(X, Y); % Linear regression p = polyfit(x, y, 1); % Linear fit y_fit = polyval(p, x); % Moving statistics y_smooth = movmean(y, 5); % 5-point moving average
For statistics reference, see references/mathematics.md.
matlab% ODE solving % dy/dt = -2y, y(0) = 1 f = @(t, y) -2*y; [t, y] = ode45(f, [0 5], 1); plot(t, y); % Higher-order: y'' + 2y' + y = 0 % Convert to system: y1' = y2, y2' = -2*y2 - y1 f = @(t, y) [y(2); -2*y(2) - y(1)]; [t, y] = ode45(f, [0 10], [1; 0]);
For ODE solvers guide, see references/mathematics.md.
matlab% FFT Y = fft(signal); f = (0:length(Y)-1) * fs / length(Y); plot(f, abs(Y)); % Filtering b = fir1(50, 0.3); % FIR filter design y_filtered = filter(b, 1, signal); % Convolution y = conv(x, h, 'same');
For signal processing, see references/mathematics.md.
matlab% Load data data = readtable('experiment.csv'); % Clean data data = rmmissing(data); % Remove missing values % Analyze grouped = groupsummary(data, 'Category', 'mean', 'Value'); % Visualize figure; bar(grouped.Category, grouped.mean_Value); xlabel('Category'); ylabel('Mean Value'); title('Results by Category'); % Save writetable(grouped, 'results.csv'); saveas(gcf, 'results.png');
matlab% Parameters L = 1; N = 100; T = 10; dt = 0.01; x = linspace(0, L, N); dx = x(2) - x(1); % Initial condition u = sin(pi * x); % Time stepping (heat equation) for t = 0:dt:T u_new = u; for i = 2:N-1 u_new(i) = u(i) + dt/(dx^2) * (u(i+1) - 2*u(i) + u(i-1)); end u = u_new; end plot(x, u);
matlab% Process multiple files files = dir('data/*.csv'); results = cell(length(files), 1); for i = 1:length(files) data = readtable(fullfile(files(i).folder, files(i).name)); results{i} = analyze(data); % Custom analysis function end % Combine results all_results = vertcat(results{:});
GNU Octave is highly compatible with MATLAB. Most scripts work without modification. Key differences:
# or % for comments (MATLAB only %)++, --, += operatorspkg load for Octave packagesFor complete compatibility guide, see references/octave-compatibility.md.
matlab % Slow for i = 1:1000 y(i) = sin(x(i)); end
% Fast y = sin(x);
matlab % Slow for i = 1:1000 y(i) = i^2; end
% Fast y = zeros(1, 1000); for i = 1:1000 y(i) = i^2; end
matlab % Numeric data M = readmatrix('numbers.csv');
% Mixed data with headers T = readtable('mixed.csv');
matlab function y = myfunction(x) %MYFUNCTION Brief description % Y = MYFUNCTION(X) detailed description % % Example: % y = myfunction(5); y = x.^2; end
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 8,583 | 8,589 | +0% | 1 | 1 | 0% | 1,413 | 3,845 | +172% | 0 | 0 | — |
case-02 | pass→pass | 9,505 | 7,270 | -24% | 1 | 1 | 0% | 1,185 | 4,046 | +241% | 0 | 0 | — |
case-08 | pass→pass | 7,895 | 7,187 | -9% | 1 | 1 | 0% | 1,533 | 3,961 | +158% | 0 | 0 | — |
case-03 | pass→pass | 7,180 | 6,163 | -14% | 1 | 1 | 0% | 1,421 | 3,865 | +172% | 0 | 0 | — |
case-04 | pass→pass | 5,937 | 4,518 | -24% | 1 | 1 | 0% | 974 | 3,580 | +268% | 0 | 0 | — |
case-05 | pass→pass | 8,918 | 8,555 | -4% | 1 | 1 | 0% | 1,994 | 4,600 | +131% | 0 | 0 | — |
case-06 | pass→pass | 8,901 | 5,103 | -43% | 1 | 1 | 0% | 1,314 | 3,515 | +168% | 0 | 0 | — |
case-07 | pass→pass | 11,912 | 6,966 | -42% | 1 | 1 | 0% | 1,874 | 4,171 | +123% | 0 | 0 | — |
case-09 | pass→pass | 9,806 | 7,187 | -27% | 1 | 1 | 0% | 1,321 | 4,056 | +207% | 0 | 0 | — |
case-10 | pass→pass | 12,979 | 7,178 | -45% | 1 | 1 | 0% | 2,266 | 3,982 | +76% | 0 | 0 | — |
case-11 | pass→pass | 8,626 | 7,391 | -14% | 1 | 1 | 0% | 1,656 | 4,056 | +145% | 0 | 0 | — |
case-12 | pass→pass | 8,420 | 3,876 | -54% | 1 | 1 | 0% | 1,128 | 3,505 | +211% | 0 | 0 | — |
case-13 | pass→pass | 14,286 | 10,963 | -23% | 1 | 1 | 0% | 2,687 | 4,803 | +79% | 0 | 0 | — |
case-14 | fail→pass | 11,433 | 14,759 | +29% | 1 | 1 | 0% | 2,037 | 4,889 | +140% | 0 | 0 | — |
case-15 | pass→pass | 19,629 | 18,702 | -5% | 1 | 1 | 0% | 3,441 | 6,120 | +78% | 0 | 0 | — |
case-16 | pass→pass | 11,963 | 8,686 | -27% | 1 | 1 | 0% | 2,044 | 4,310 | +111% | 0 | 0 | — |
case-17 | fail→pass | 13,901 | 6,918 | -50% | 1 | 1 | 0% | 2,100 | 4,010 | +91% | 0 | 0 | — |
case-18 | pass→pass | 7,348 | 8,142 | +11% | 1 | 1 | 0% | 1,314 | 3,932 | +199% | 0 | 0 | — |
case-19 | pass→pass | 9,640 | 3,620 | -62% | 1 | 1 | 0% | 1,390 | 3,433 | +147% | 0 | 0 | — |
case-20 | pass→pass | 8,268 | 6,896 | -17% | 1 | 1 | 0% | 1,557 | 4,136 | +166% | 0 | 0 | — |
case-21 | pass→fail | 10,115 | 36,618 | +262% | 1 | 1 | 0% | 1,381 | 4,173 | +202% | 0 | 0 | — |
case-22 | pass→fail | 9,726 | 7,221 | -26% | 1 | 1 | 0% | 1,816 | 4,130 | +127% | 0 | 0 | — |
case-23 | pass→pass | 14,316 | 14,284 | -0% | 1 | 1 | 0% | 2,577 | 5,561 | +116% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of 0 percentage points is the difference between those two pass rates over the 23 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.