matlab/matlab-agentic-toolkit / skills-catalog/matlab-app-building/matlab-build-app
matlab-build-app
UnverifiedBuild MATLAB apps from requirements to working code. Asks discovery questions (or skips them when the path is known), recommends UIFigure or UIHTML architecture, identifies layout archetype (Dashboard, Explorer, Tabbed, Wizard, Canvas), produces an implementation plan, and executes the build. For UIFigure apps, optionally serializes as App Designer (.mlapp or plain-text .m + .xml). Use when a user wants to build a MATLAB app, create a GUI, make an interactive tool, build a uifigure app, build a uihtml app, build an App Designer app, build a .mlapp app, build a plain-text App Designer app, or asks which approach to use. Also use when user describes spatial layout needs: dashboard, control panel, sidebar, tabs, wizard, stepper, canvas, workspace.
references/uifigure/mvvm-testing.md
View on GitHub# Testing the ViewModel
One of MVVM's key benefits — test UI logic without creating any UI. The ViewModel is a plain handle class with observable properties and command methods, so it can be exercised entirely from test code.
## Complete Test Example
```matlab
function tests = testMainViewModel()
tests = functiontests(localfunctions);
end
function testProcessCommand(testCase)
model = AppName.Models.DataModel();
model.RawData = [1 2 3 4 5];
vm = AppName.ViewModels.MainViewModel(model);
vm.processCommand("quadratic");
verifyEqual(testCase, model.ProcessedData, [1 4 9 16 25]);
verifyEqual(testCase, vm.StatusMessage, "Complete");
verifyFalse(testCase, vm.IsProcessing);
verifyTrue(testCase, vm.CanProcess);
end
function testProcessCommandError(testCase)
model = AppName.Models.DataModel();
vm = AppName.ViewModels.MainViewModel(model);
vm.processCommand("linear");
verifySubstring(testCase, vm.StatusMessage, "Error");
end
function testCanProcessUpdates(testCase)
model = AppName.Models.DataModel();
vm = AppName.ViewModels.MainViewModel(model);
verifyFalse(testCase, vm.CanProcess);
model.RawData = [1 2 3];
verifyTrue(testCase, vm.CanProcess);
end
```
Run with `runtests('testMainViewModel')`. No figure window needed.
## Test Patterns
### Testing computed state
```matlab
function testComputedStateReactsToModel(testCase)
model = AppName.Models.DataModel();
vm = AppName.ViewModels.MainViewModel(model);
% Initially no data → can't process
verifyFalse(testCase, vm.CanProcess);
% Load data → can process
model.RawData = rand(1, 10);
verifyTrue(testCase, vm.CanProcess);
end
```
### Testing async commands
```matlab
function testAsyncCommandSetsProcessingState(testCase)
model = AppName.Models.DataModel();
model.RawData = [1 2 3];
vm = AppName.ViewModels.MainViewModel(model);
vm.processAsyncCommand("linear");
% Immediately after calling, should be processing
verifyTrue(testCase, vm.IsProcessing);
verifyEqual(testCase, vm.StatusMessage, "Processing...");
% Wait for background task
pause(2);
verifyFalse(testCase, vm.IsProcessing);
verifyEqual(testCase, vm.StatusMessage, "Complete");
end
```
### Testing Model isolation
```matlab
function testModelHasNoViewReferences(testCase)
model = AppName.Models.DataModel();
mc = metaclass(model);
% Verify no property holds a View or ViewModel reference
for i = 1:numel(mc.PropertyList)
p = mc.PropertyList(i);
if ~p.Dependent && ~p.Constant
val = model.(p.Name);
verifyFalse(testCase, isa(val, 'AppName.Views.MainView'));
verifyFalse(testCase, isa(val, 'AppName.ViewModels.MainViewModel'));
end
end
end
```
----
Copyright 2026 The MathWorks, Inc.
----
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation). | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK). | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |