Prompts for writing clean, efficient MATLAB® code with proper error handling, optimization, and testing.
Analyze and optimize MATLAB code for better performance using vectorization, preallocation, and built-in functions. Perfect for speeding up slow code and reducing execution time.
Tags: matlab performance optimization vectorization profiling
Release: All releases
Add comprehensive error handling and input validation to MATLAB functions. Includes arguments blocks, validateattributes, try-catch blocks, and meaningful error messages.
Tags: matlab error-handling validation robustness arguments
Release: R2019b+ (for arguments block), earlier releases without arguments block
Write comprehensive unit tests using the matlab.unittest framework. Includes test classes, assertions, fixtures, parameterized tests, and coverage goals.
Tags: matlab testing unit-tests matlab-test verification unittest
Release: R2013a+ (matlab.unittest framework)
Create property-based tests that verify function behavior across input ranges. Tests mathematical properties, invariants, and boundary conditions with random inputs.
Tags: matlab testing property-based-testing verification invariants
Release: All releases
- Code Generation - For production-ready code
- Live Scripts & Documentation - For documentation and examples
Have a prompt for MATLAB programming? See CONTRIBUTING.md for guidelines.