{"id":"9bcb7a66-2731-4a3e-b759-148cd70d40ef","shortId":"fawvMW","kind":"skill","title":"matlab-live-script","tagline":"Create MATLAB plain text Live Scripts (.m files) following specific formatting rules. Use when generating MATLAB scripts, educational MATLAB content, Live Scripts, or when the user requests .m files with rich text formatting.","description":"# MATLAB Plain Text Live Script Generator\n\nThis skill provides comprehensive guidelines for creating properly formatted MATLAB plain text Live Scripts. These scripts combine executable MATLAB code with rich text documentation in a single .m file.\n\n## When to Use This Skill\n\n- Creating new MATLAB Live Scripts in plain text format\n- Generating educational MATLAB content with explanations\n- When the user requests .m files with documentation\n- Converting code examples into Live Script format\n- Creating tutorial or example scripts\n\n## Critical Rules\n\n### File Format\n- **ALWAYS** use the .m suffix for plain text Live Scripts\n- **NEVER** create .mlx scripts (binary format)\n- **MUST** close every script with the required appendix\n\n### Required Appendix\nEvery Live Script must end with this exact formatting:\n\n```matlab\n%[appendix]{\"version\":\"1.0\"}\n%---\n%[metadata:view]\n%   data: {\"layout\":\"inline\"}\n%---\n```\n\n### Reading Live Scripts (Token Optimization)\nWhen reading a Live Script file to pass back to the language model, you can save significant token count by ignoring everything below the appendix marker (which begins with `%[appendix]`). This optimization avoids passing large embedded images that are stored in the appendix section. All working code and text content appears before the appendix, so no functional information is lost.\n\n## Formatting Rules\n\n### Section Headers\n**CORRECT format:**\n```matlab\n%%\n%[text] ## Section Title\n```\n\n**INCORRECT format (DO NOT USE):**\n```matlab\n%% Section Title\n```\n\n### Rich Text\n- Normal text uses `%[text]` prefix\n- Text intended for a single paragraph should appear on a single line\n- Use Markdown formatting after `%[text]`\n- **DO NOT** leave blank lines in the file\n\n### Bulleted Lists\nBulleted lists must have a backslash on the last item:\n\n```matlab\n%[text] - bullet 1\n%[text] - bullet 2\n%[text] - bullet 3 \\\n```\n\n\n### Tables\n\n```matlab\n%[text:table]\n%[text] | Column A | Column B |\n%[text] | --- | --- |\n%[text] | Value 1 | Value 2 |\n%[text] | Value 3 | Value 4 |\n%[text:table]\n```\n\n\n### LaTeX Equations\nFormat equations with double backslashes:\n\n```matlab\n%[text] $ e = \\\\sum_{\\\\alpha=0}^\\\\infty \\\\alpha^n/n! $\n```\n\nNote: All backslashes in LaTeX must be doubled.\n\n### Comments for Readers\n**DO NOT** use fprintf for reader comments:\n```matlab\nfprintf('This is a comment')  % WRONG\n```\n\n**Instead use rich text:**\n```matlab\n%[text] This is a comment  % CORRECT\n```\n\n## Code Guidelines\n\n### Figures and Plots\n- Use **implicit figure creation** (just call plot, histogram, etc.)\n- **DO NOT** use the `figure` command to create new figures\n- Put no more than one plot per section (unless using tiled layouts)\n- Only use tiled plots when especially important to the illustration\n\n### Script Initialization\n- **DO NOT** start scripts with `close all` or `clear` commands\n- Let MATLAB handle workspace management\n\n## Complete Example\n\n```matlab\n%[text] # Sinusoidal Signals\n%[text] Examples of sinusoidal signal in MATLAB.\n%[text] - sine waves\n%[text] - cosine waves \\\nx = linspace(0,8*pi);\n%%\n%[text] ## Sine Wave\nplot(x,sin(x))\ntitle('Sine Wave')\nxlabel('x (radians)')\nylabel('sin(x)')\ngrid on\n%%\n%[text] ## Cosine Wave\nplot(x,cos(x))\ntitle('Cosine Wave')\nxlabel('x (radians)')\nylabel('cos(x)')\ngrid on\n%[text]\n\n%[appendix]{\"version\":\"1.0\"}\n%---\n%[metadata:view]\n%   data: {\"layout\":\"inline\"}\n%---\n```\n\n## Structure Pattern\n\nA typical Live Script follows this pattern:\n\n1. **Title and Introduction**\n   ```matlab\n   %[text] # Main Title\n   %[text] Brief description of what this script does.\n   ```\n\n2. **Setup Code** (if needed)\n   ```matlab\n   variable = value;\n   data = load('file.mat');\n   ```\n\n3. **Sections with Explanations**\n   ```matlab\n   %%\n   %[text] ## Section Name\n   %[text] Explanation of what this section does.\n   code_goes_here();\n   plot(results)\n   ```\n\n4. **Required Appendix**\n   ```matlab\n   %[appendix]{\"version\":\"1.0\"}\n   %---\n   %[metadata:view]\n   %   data: {\"layout\":\"inline\"}\n   %---\n   ```\n\n## Common Patterns\n\n### Mathematical Explanations with Equations\n```matlab\n%[text] ## Theory\n%[text] The discrete Fourier transform is defined as:\n%[text] $ X(k) = \\\\sum_{n=0}^{N-1} x(n)e^{-j2\\\\pi kn/N} $\n```\n\n### Code with Inline Comments\n```matlab\n%%\n%[text] ## Data Processing\n%[text] First, we load and filter the data.\ndata = load('measurements.mat');\nfiltered = lowpass(data, 0.5);  % Apply lowpass filter\n%[text] Then we visualize the results.\nplot(filtered)\ntitle('Filtered Data')\n```\n\n### Multiple Related Plots (Tiled Layout)\nOnly when necessary for comparison:\n```matlab\n%%\n%[text] ## Comparison of Methods\ntiledlayout(1,2)\nnexttile\nplot(method1)\ntitle('Method 1')\nnexttile\nplot(method2)\ntitle('Method 2')\n```\n\n## Checklist\n\nBefore finishing a Live Script, verify:\n- [ ] File has .m extension\n- [ ] Sections use `%%` followed by `%[text] ##`\n- [ ] No blank lines in the file\n- [ ] Bulleted lists end with backslash\n- [ ] LaTeX uses double backslashes\n- [ ] No `figure` commands\n- [ ] No `close all` or `clear` at start\n- [ ] Appendix is present and correctly formatted\n- [ ] No `fprintf` for comments (use `%[text]` instead)\n\n## Troubleshooting\n\n**Issue**: Script doesn't display rich text properly\n- **Solution**: Ensure `%[text]` is at the start of each text line\n\n**Issue**: Equations not rendering\n- **Solution**: Check that all backslashes are doubled in LaTeX\n\n**Issue**: Sections not appearing correctly\n- **Solution**: Use `%%` on its own line, then `%[text] ##` on the next line\n\n**Issue**: Script won't save with outputs\n- **Solution**: Verify appendix is exactly as specified, with proper indentation","tags":["matlab","live","script","skills","agent-skill","agent-skills","agentic-ai","agents","claude","claude-api","claude-code","claude-desktop"],"capabilities":["skill","source-matlab","skill-matlab-live-script","topic-agent-skill","topic-agent-skills","topic-agentic-ai","topic-agents","topic-claude","topic-claude-api","topic-claude-code","topic-claude-desktop","topic-claude-skills","topic-matlab","topic-matlab-skills"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/matlab/skills/matlab-live-script","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add matlab/skills","source_repo":"https://github.com/matlab/skills","install_from":"skills.sh"}},"qualityScore":"0.482","qualityRationale":"deterministic score 0.48 from registry signals: · indexed on github topic:agent-skills · 65 github stars · SKILL.md body (5,600 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:55:57.421Z","embedding":null,"createdAt":"2026-04-18T22:14:22.900Z","updatedAt":"2026-04-22T00:55:57.421Z","lastSeenAt":"2026-04-22T00:55:57.421Z","tsv":"'-1':596 '0':332,456,594 '0.5':625 '1':291,310,513,656,663 '1.0':155,498,566 '2':294,312,529,657,669 '3':297,315,540 '4':317,560 '8':457 'alpha':331,334 'alway':117 'appear':216,258,760 'appendix':140,142,153,190,195,208,219,496,562,564,711,783 'appli':626 'avoid':198 'b':306 'back':174 'backslash':283,326,338,696,700,752 'begin':193 'binari':131 'blank':271,687 'brief':522 'bullet':276,278,290,293,296,692 'call':382 'check':749 'checklist':670 'clear':428,708 'close':134,425,705 'code':63,102,212,372,531,555,603 'column':303,305 'combin':60 'command':391,429,703 'comment':344,353,359,370,606,720 'common':572 'comparison':649,652 'complet':435 'comprehens':47 'content':24,90,215 'convert':101 'correct':230,371,715,761 'cos':482,491 'cosin':452,478,485 'count':184 'creat':5,50,78,108,128,393 'creation':380 'critic':113 'data':158,501,537,569,609,618,619,624,639 'defin':587 'descript':523 'discret':583 'display':729 'document':67,100 'doesn':727 'doubl':325,343,699,754 'e':329,599 'educ':22,88 'embed':201 'end':147,694 'ensur':734 'equat':321,323,577,745 'especi':413 'etc':385 'everi':135,143 'everyth':187 'exact':150,785 'exampl':103,111,436,442 'execut':61 'explan':92,543,549,575 'extens':680 'figur':374,379,390,395,702 'file':12,33,72,98,115,171,275,677,691 'file.mat':539 'filter':616,622,628,636,638 'finish':672 'first':612 'follow':13,510,683 'format':15,37,52,86,107,116,132,151,226,231,237,265,322,716 'fourier':584 'fprintf':350,355,718 'function':222 'generat':19,43,87 'goe':556 'grid':475,493 'guidelin':48,373 'handl':432 'header':229 'histogram':384 'ignor':186 'illustr':417 'imag':202 'implicit':378 'import':414 'incorrect':236 'indent':790 'inform':223 'infti':333 'initi':419 'inlin':160,503,571,605 'instead':361,723 'intend':252 'introduct':516 'issu':725,744,757,774 'item':287 'j2':600 'k':591 'kn/n':602 'languag':177 'larg':200 'last':286 'latex':320,340,697,756 'layout':159,407,502,570,644 'leav':270 'let':430 'line':262,272,688,743,767,773 'linspac':455 'list':277,279,693 'live':3,9,25,41,56,81,105,125,144,162,169,508,674 'load':538,614,620 'lost':225 'lowpass':623,627 'm':11,32,71,97,120,679 'main':519 'manag':434 'markdown':264 'marker':191 'mathemat':574 'matlab':2,6,20,23,38,53,62,80,89,152,232,241,288,299,327,354,365,431,437,447,517,534,544,563,578,607,650 'matlab-live-script':1 'measurements.mat':621 'metadata':156,499,567 'method':654,662,668 'method1':660 'method2':666 'mlx':129 'model':178 'multipl':640 'must':133,146,280,341 'n':593,595,598 'n/n':335 'name':547 'necessari':647 'need':533 'never':127 'new':79,394 'next':772 'nexttil':658,664 'normal':246 'note':336 'one':400 'optim':165,197 'output':780 'paragraph':256 'pass':173,199 'pattern':505,512,573 'per':402 'pi':458,601 'plain':7,39,54,84,123 'plot':376,383,401,411,462,480,558,635,642,659,665 'prefix':250 'present':713 'process':610 'proper':51,732,789 'provid':46 'put':396 'radian':471,489 'read':161,167 'reader':346,352 'relat':641 'render':747 'request':31,96 'requir':139,141,561 'result':559,634 'rich':35,65,244,363,730 'rule':16,114,227 'save':181,778 'script':4,10,21,26,42,57,59,82,106,112,126,130,136,145,163,170,418,423,509,527,675,726,775 'section':209,228,234,242,403,541,546,553,681,758 'setup':530 'signal':440,445 'signific':182 'sin':464,473 'sine':449,460,467 'singl':70,255,261 'sinusoid':439,444 'skill':45,77 'skill-matlab-live-script' 'solut':733,748,762,781 'source-matlab' 'specif':14 'specifi':787 'start':422,710,739 'store':205 'structur':504 'suffix':121 'sum':330,592 'tabl':298,301,319 'text':8,36,40,55,66,85,124,214,233,245,247,249,251,267,289,292,295,300,302,307,308,313,318,328,364,366,438,441,448,451,459,477,495,518,521,545,548,579,581,589,608,611,629,651,685,722,731,735,742,769 'theori':580 'tile':406,410,643 'tiledlayout':655 'titl':235,243,466,484,514,520,637,661,667 'token':164,183 'topic-agent-skill' 'topic-agent-skills' 'topic-agentic-ai' 'topic-agents' 'topic-claude' 'topic-claude-api' 'topic-claude-code' 'topic-claude-desktop' 'topic-claude-skills' 'topic-matlab' 'topic-matlab-skills' 'transform':585 'troubleshoot':724 'tutori':109 'typic':507 'unless':404 'use':17,75,118,240,248,263,349,362,377,388,405,409,682,698,721,763 'user':30,95 'valu':309,311,314,316,536 'variabl':535 'verifi':676,782 'version':154,497,565 'view':157,500,568 'visual':632 'wave':450,453,461,468,479,486 'won':776 'work':211 'workspac':433 'wrong':360 'x':454,463,465,470,474,481,483,488,492,590,597 'xlabel':469,487 'ylabel':472,490","prices":[{"id":"aca6d972-bc62-4d09-aaeb-4454ffc0d1b6","listingId":"9bcb7a66-2731-4a3e-b759-148cd70d40ef","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"matlab","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:14:22.900Z"}],"sources":[{"listingId":"9bcb7a66-2731-4a3e-b759-148cd70d40ef","source":"github","sourceId":"matlab/skills/matlab-live-script","sourceUrl":"https://github.com/matlab/skills/tree/main/skills/matlab-live-script","isPrimary":false,"firstSeenAt":"2026-04-18T22:14:22.900Z","lastSeenAt":"2026-04-22T00:55:57.421Z"}],"details":{"listingId":"9bcb7a66-2731-4a3e-b759-148cd70d40ef","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"matlab","slug":"matlab-live-script","github":{"repo":"matlab/skills","stars":65,"topics":["agent-skill","agent-skills","agentic-ai","agents","claude","claude-api","claude-code","claude-desktop","claude-skills","matlab","matlab-skills"],"license":"other","html_url":"https://github.com/matlab/skills","pushed_at":"2026-03-20T00:56:44Z","description":"A collection of Agent Skills for MATLAB development. Skills are specialized instruction sets that extend a coding agent's capabilities for specific tasks, automatically activating when needed.","skill_md_sha":"5589c8871f5d42a60c1060df57cff04e42a8c252","skill_md_path":"skills/matlab-live-script/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/matlab/skills/tree/main/skills/matlab-live-script"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"matlab-live-script","license":"MathWorks BSD-3-Clause (see LICENSE)","description":"Create MATLAB plain text Live Scripts (.m files) following specific formatting rules. Use when generating MATLAB scripts, educational MATLAB content, Live Scripts, or when the user requests .m files with rich text formatting."},"skills_sh_url":"https://skills.sh/matlab/skills/matlab-live-script"},"updatedAt":"2026-04-22T00:55:57.421Z"}}