Install
openclaw skills install matlabAvoid common MATLAB mistakes — indexing traps, matrix vs element-wise ops, and vectorization pitfalls.
openclaw skills install matlabA(1), not A(0)end keyword for last index — A(end), A(end-1), works in any dimensionA(5) accesses 5th element column-major orderA(A > 0) gives 1D result regardless of A's shape* is matrix multiplication — .* for element-wise/ solves A*x = B — ./ for element-wise division^ is matrix power — .^ for element-wise power[1 2 3] or [1, 2, 3] — shape is 1×3[1; 2; 3] — shape is 3×1' (conjugate) or .' (non-conjugate) — for complex, they differ* between row and column gives scalar or matrix — depending on orderA = zeros(1000, 1)zeros, ones, nan for preallocation — specify size upfrontcell(n, m) — preallocate cells tooA + b works if dimensions compatible[1;2;3] + [10 20] gives 3×2bsxfun — legacy code may still use itNaN ~= NaN is true — use isnan() to checksum([1 NaN 3]) is NaN'omitnan' flag — sum(A, 'omitnan'), mean(A, 'omitnan'){} for cell arrays — hold mixed types, different sizes() indexing returns cell — C(1) is 1×1 cell{} indexing extracts content — C{1} is the actual valueC{:} — useful for function arguments= for assignment, == for comparison — if x = 5 is error in MATLABclear removes all variables — use clearvars for selective, close all for figuresi and j are imaginary unit — don't use as loop variables, or reassign explicitly"text" vs 'text' — double quotes are string arrays (R2017a+)f = @(x) x^2 — quick inline functions[a, b] = func() — must capture or use ~ to ignorenargin/nargout for optional args — check how many inputs/outputs providedvarargin/varargout for variable args — cell array of extra argumentsdbstop if error — breakpoint on any errorkeyboard in code pauses execution — enter debug mode at that linewhos shows variable sizes — size(A) for specific variable