Skip to content

Instantly share code, notes, and snippets.

View yanndebray's full-sized avatar
🤖
vibing

Yann Debray yanndebray

🤖
vibing
View GitHub Profile

Codex Agent Instructions for MATLAB Toolbox Design

Objective

This repository documents best practices for building MATLAB® toolboxes. The AGENTS.md file outlines a set of actionable instructions for a Codex‑powered agent responsible for generating and maintaining a toolbox that conforms to these practices. The goal is to ensure that any automatically generated toolbox is easy for users to install, understand, and contribute to, and that it follows MathWorks’ guidelines for structure, packaging, testing, and release.


1. Root folder configuration

function MassSpringDamperSimulator()
% Mass Spring Damper Simulator (1-DOF)
% Interactive simulation with base excitation
% Replicates the web-based simulator functionality
% Create figure
fig = figure('Name', 'Mass Spring Damper Simulator (1-DOF)', ...
'NumberTitle', 'off', ...
'Position', [100, 100, 1400, 800], ...
'Color', [0.95, 0.95, 0.98]);
% % Install uv
!curl -LsSf https://astral.sh/uv/install.sh | sh
% % Set up uv
% 1) Point PATH to where uv was installed
setenv('PATH', getenv('HOME')+"/.local/bin:"+getenv('PATH'));
% Sanity checks
system('which uv'); % should print ~/.local/bin/uv
system('uv --version');
system('python --version');
session = pyrun("import fastf1; session = fastf1.get_session(2023, 1, 'R'); session.load(telemetry=False, weather=False)","session")
drv = session.drivers;
%% Figure / axes (dark theme similar to FastF1)
figure('Color',[0.08 0.09 0.10],'Position',[100 100 900 500]);
ax = axes('Parent', gcf);
set(ax,'Color',[0.08 0.09 0.10],'XColor',[0.85 0.88 0.90], ...
'YColor',[0.85 0.88 0.90],'Box','off','LineWidth',1);
hold(ax,'on'); grid(ax,'on'); ax.GridColor=[0.25 0.28 0.30];
%[text] # demucs with uv onlinedemucs
%[text:tableOfContents]{"heading":"**Table of Contents**"}
%[text]
%%
%[text] ### Install uv
!curl -LsSf https://astral.sh/uv/install.sh | sh %[output:09e95903]
%%
%[text] ### Set up uv
% 1) Point PATH to where uv was installed
setenv('PATH', [getenv('HOME') '/.local/bin:' getenv('PATH')]);
#!/usr/bin/env python3
"""
Create a PowerPoint deck from a folder of images, widescreen (16:9).
Usage:
python make_ppt.py --images slides/ --out slides.pptx
"""
import argparse
from pathlib import Path
#!/usr/bin/env python3
"""
Extract distinct slides from a presentation video.
Usage:
python extract_slides.py --video input.mp4 --out slides/ --interval 10 --threshold 6
Args:
--video Path to the input video file.
--out Output folder for saved images (created if missing).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
wget https://www.mathworks.com/mpm/glnxa64/mpm && \
chmod +x mpm && \
./mpm install --release=R2025a --destination=/opt/matlab --products=MATLAB Parallel_Computing_Toolbox Deep_Learning_Toolbox Statistics_and_Machine_Learning_Toolbox && \
ln -fs /opt/matlab/bin/matlab /usr/local/bin/matlab && \
MATLAB_DEPS_URL="https://raw.githubusercontent.com/mathworks-ref-arch/container-images/main/matlab-deps/r2025a/ubuntu22.04/base-dependencies.txt" && \
MATLAB_DEPENDENCIES=base-dependencies.txt && \
wget ${MATLAB_DEPS_URL} -O ${MATLAB_DEPENDENCIES} && \
xargs -a ${MATLAB_DEPENDENCIES} -r apt-get install --no-install-recommends -y && \