runmat 0.3.6 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/stdlib.snapshot +0 -0
- package/dist/builtins.d.ts +77 -0
- package/dist/builtins.d.ts.map +1 -0
- package/dist/builtins.js +51 -0
- package/dist/builtins.js.map +1 -0
- package/dist/fs/remote.d.ts.map +1 -1
- package/dist/fs/remote.js +13 -2
- package/dist/fs/remote.js.map +1 -1
- package/dist/generated/builtin-examples-catalog.d.ts +3 -0
- package/dist/generated/builtin-examples-catalog.d.ts.map +1 -0
- package/dist/generated/builtin-examples-catalog.js +4 -0
- package/dist/generated/builtin-examples-catalog.js.map +1 -0
- package/dist/generated/builtins/abs.d.ts +4 -0
- package/dist/generated/builtins/abs.d.ts.map +1 -0
- package/dist/generated/builtins/abs.js +245 -0
- package/dist/generated/builtins/abs.js.map +1 -0
- package/dist/generated/builtins/accept.d.ts +4 -0
- package/dist/generated/builtins/accept.d.ts.map +1 -0
- package/dist/generated/builtins/accept.js +151 -0
- package/dist/generated/builtins/accept.js.map +1 -0
- package/dist/generated/builtins/acos.d.ts +4 -0
- package/dist/generated/builtins/acos.d.ts.map +1 -0
- package/dist/generated/builtins/acos.js +177 -0
- package/dist/generated/builtins/acos.js.map +1 -0
- package/dist/generated/builtins/acosh.d.ts +4 -0
- package/dist/generated/builtins/acosh.d.ts.map +1 -0
- package/dist/generated/builtins/acosh.js +187 -0
- package/dist/generated/builtins/acosh.js.map +1 -0
- package/dist/generated/builtins/addpath.d.ts +4 -0
- package/dist/generated/builtins/addpath.d.ts.map +1 -0
- package/dist/generated/builtins/addpath.js +220 -0
- package/dist/generated/builtins/addpath.js.map +1 -0
- package/dist/generated/builtins/all.d.ts +4 -0
- package/dist/generated/builtins/all.d.ts.map +1 -0
- package/dist/generated/builtins/all.js +207 -0
- package/dist/generated/builtins/all.js.map +1 -0
- package/dist/generated/builtins/and.d.ts +4 -0
- package/dist/generated/builtins/and.d.ts.map +1 -0
- package/dist/generated/builtins/and.js +136 -0
- package/dist/generated/builtins/and.js.map +1 -0
- package/dist/generated/builtins/angle.d.ts +4 -0
- package/dist/generated/builtins/angle.d.ts.map +1 -0
- package/dist/generated/builtins/angle.js +230 -0
- package/dist/generated/builtins/angle.js.map +1 -0
- package/dist/generated/builtins/any.d.ts +4 -0
- package/dist/generated/builtins/any.d.ts.map +1 -0
- package/dist/generated/builtins/any.js +207 -0
- package/dist/generated/builtins/any.js.map +1 -0
- package/dist/generated/builtins/area.d.ts +4 -0
- package/dist/generated/builtins/area.d.ts.map +1 -0
- package/dist/generated/builtins/area.js +104 -0
- package/dist/generated/builtins/area.js.map +1 -0
- package/dist/generated/builtins/argsort.d.ts +4 -0
- package/dist/generated/builtins/argsort.d.ts.map +1 -0
- package/dist/generated/builtins/argsort.js +180 -0
- package/dist/generated/builtins/argsort.js.map +1 -0
- package/dist/generated/builtins/arrayfun.d.ts +4 -0
- package/dist/generated/builtins/arrayfun.d.ts.map +1 -0
- package/dist/generated/builtins/arrayfun.js +138 -0
- package/dist/generated/builtins/arrayfun.js.map +1 -0
- package/dist/generated/builtins/asin.d.ts +4 -0
- package/dist/generated/builtins/asin.d.ts.map +1 -0
- package/dist/generated/builtins/asin.js +185 -0
- package/dist/generated/builtins/asin.js.map +1 -0
- package/dist/generated/builtins/asinh.d.ts +4 -0
- package/dist/generated/builtins/asinh.d.ts.map +1 -0
- package/dist/generated/builtins/asinh.js +187 -0
- package/dist/generated/builtins/asinh.js.map +1 -0
- package/dist/generated/builtins/assert.d.ts +4 -0
- package/dist/generated/builtins/assert.d.ts.map +1 -0
- package/dist/generated/builtins/assert.js +150 -0
- package/dist/generated/builtins/assert.js.map +1 -0
- package/dist/generated/builtins/atan.d.ts +4 -0
- package/dist/generated/builtins/atan.d.ts.map +1 -0
- package/dist/generated/builtins/atan.js +174 -0
- package/dist/generated/builtins/atan.js.map +1 -0
- package/dist/generated/builtins/atan2.d.ts +4 -0
- package/dist/generated/builtins/atan2.d.ts.map +1 -0
- package/dist/generated/builtins/atan2.js +192 -0
- package/dist/generated/builtins/atan2.js.map +1 -0
- package/dist/generated/builtins/atanh.d.ts +4 -0
- package/dist/generated/builtins/atanh.d.ts.map +1 -0
- package/dist/generated/builtins/atanh.js +186 -0
- package/dist/generated/builtins/atanh.js.map +1 -0
- package/dist/generated/builtins/axis.d.ts +4 -0
- package/dist/generated/builtins/axis.d.ts.map +1 -0
- package/dist/generated/builtins/axis.js +69 -0
- package/dist/generated/builtins/axis.js.map +1 -0
- package/dist/generated/builtins/bandwidth.d.ts +4 -0
- package/dist/generated/builtins/bandwidth.d.ts.map +1 -0
- package/dist/generated/builtins/bandwidth.js +175 -0
- package/dist/generated/builtins/bandwidth.js.map +1 -0
- package/dist/generated/builtins/bar.d.ts +4 -0
- package/dist/generated/builtins/bar.d.ts.map +1 -0
- package/dist/generated/builtins/bar.js +95 -0
- package/dist/generated/builtins/bar.js.map +1 -0
- package/dist/generated/builtins/box.d.ts +4 -0
- package/dist/generated/builtins/box.d.ts.map +1 -0
- package/dist/generated/builtins/box.js +60 -0
- package/dist/generated/builtins/box.js.map +1 -0
- package/dist/generated/builtins/cat.d.ts +4 -0
- package/dist/generated/builtins/cat.d.ts.map +1 -0
- package/dist/generated/builtins/cat.js +186 -0
- package/dist/generated/builtins/cat.js.map +1 -0
- package/dist/generated/builtins/cd.d.ts +4 -0
- package/dist/generated/builtins/cd.d.ts.map +1 -0
- package/dist/generated/builtins/cd.js +200 -0
- package/dist/generated/builtins/cd.js.map +1 -0
- package/dist/generated/builtins/ceil.d.ts +4 -0
- package/dist/generated/builtins/ceil.d.ts.map +1 -0
- package/dist/generated/builtins/ceil.js +175 -0
- package/dist/generated/builtins/ceil.js.map +1 -0
- package/dist/generated/builtins/cell.d.ts +4 -0
- package/dist/generated/builtins/cell.d.ts.map +1 -0
- package/dist/generated/builtins/cell.js +152 -0
- package/dist/generated/builtins/cell.js.map +1 -0
- package/dist/generated/builtins/cell2mat.d.ts +4 -0
- package/dist/generated/builtins/cell2mat.d.ts.map +1 -0
- package/dist/generated/builtins/cell2mat.js +142 -0
- package/dist/generated/builtins/cell2mat.js.map +1 -0
- package/dist/generated/builtins/cellfun.d.ts +4 -0
- package/dist/generated/builtins/cellfun.d.ts.map +1 -0
- package/dist/generated/builtins/cellfun.js +170 -0
- package/dist/generated/builtins/cellfun.js.map +1 -0
- package/dist/generated/builtins/cellstr.d.ts +4 -0
- package/dist/generated/builtins/cellstr.d.ts.map +1 -0
- package/dist/generated/builtins/cellstr.js +143 -0
- package/dist/generated/builtins/cellstr.js.map +1 -0
- package/dist/generated/builtins/char.d.ts +4 -0
- package/dist/generated/builtins/char.d.ts.map +1 -0
- package/dist/generated/builtins/char.js +177 -0
- package/dist/generated/builtins/char.js.map +1 -0
- package/dist/generated/builtins/chol.d.ts +4 -0
- package/dist/generated/builtins/chol.d.ts.map +1 -0
- package/dist/generated/builtins/chol.js +160 -0
- package/dist/generated/builtins/chol.js.map +1 -0
- package/dist/generated/builtins/circshift.d.ts +4 -0
- package/dist/generated/builtins/circshift.d.ts.map +1 -0
- package/dist/generated/builtins/circshift.js +223 -0
- package/dist/generated/builtins/circshift.js.map +1 -0
- package/dist/generated/builtins/class.d.ts +4 -0
- package/dist/generated/builtins/class.d.ts.map +1 -0
- package/dist/generated/builtins/class.js +159 -0
- package/dist/generated/builtins/class.js.map +1 -0
- package/dist/generated/builtins/clc.d.ts +4 -0
- package/dist/generated/builtins/clc.d.ts.map +1 -0
- package/dist/generated/builtins/clc.js +110 -0
- package/dist/generated/builtins/clc.js.map +1 -0
- package/dist/generated/builtins/clear.d.ts +4 -0
- package/dist/generated/builtins/clear.d.ts.map +1 -0
- package/dist/generated/builtins/clear.js +127 -0
- package/dist/generated/builtins/clear.js.map +1 -0
- package/dist/generated/builtins/close.d.ts +4 -0
- package/dist/generated/builtins/close.d.ts.map +1 -0
- package/dist/generated/builtins/close.js +145 -0
- package/dist/generated/builtins/close.js.map +1 -0
- package/dist/generated/builtins/colon.d.ts +4 -0
- package/dist/generated/builtins/colon.d.ts.map +1 -0
- package/dist/generated/builtins/colon.js +193 -0
- package/dist/generated/builtins/colon.js.map +1 -0
- package/dist/generated/builtins/colorbar.d.ts +4 -0
- package/dist/generated/builtins/colorbar.d.ts.map +1 -0
- package/dist/generated/builtins/colorbar.js +64 -0
- package/dist/generated/builtins/colorbar.js.map +1 -0
- package/dist/generated/builtins/colormap.d.ts +4 -0
- package/dist/generated/builtins/colormap.d.ts.map +1 -0
- package/dist/generated/builtins/colormap.js +68 -0
- package/dist/generated/builtins/colormap.js.map +1 -0
- package/dist/generated/builtins/compose.d.ts +4 -0
- package/dist/generated/builtins/compose.d.ts.map +1 -0
- package/dist/generated/builtins/compose.js +184 -0
- package/dist/generated/builtins/compose.js.map +1 -0
- package/dist/generated/builtins/cond.d.ts +4 -0
- package/dist/generated/builtins/cond.d.ts.map +1 -0
- package/dist/generated/builtins/cond.js +157 -0
- package/dist/generated/builtins/cond.js.map +1 -0
- package/dist/generated/builtins/conj.d.ts +4 -0
- package/dist/generated/builtins/conj.d.ts.map +1 -0
- package/dist/generated/builtins/conj.js +229 -0
- package/dist/generated/builtins/conj.js.map +1 -0
- package/dist/generated/builtins/containers.Map.d.ts +4 -0
- package/dist/generated/builtins/containers.Map.d.ts.map +1 -0
- package/dist/generated/builtins/containers.Map.js +134 -0
- package/dist/generated/builtins/containers.Map.js.map +1 -0
- package/dist/generated/builtins/contains.d.ts +4 -0
- package/dist/generated/builtins/contains.d.ts.map +1 -0
- package/dist/generated/builtins/contains.js +149 -0
- package/dist/generated/builtins/contains.js.map +1 -0
- package/dist/generated/builtins/contour.d.ts +4 -0
- package/dist/generated/builtins/contour.d.ts.map +1 -0
- package/dist/generated/builtins/contour.js +96 -0
- package/dist/generated/builtins/contour.js.map +1 -0
- package/dist/generated/builtins/contourf.d.ts +4 -0
- package/dist/generated/builtins/contourf.d.ts.map +1 -0
- package/dist/generated/builtins/contourf.js +90 -0
- package/dist/generated/builtins/contourf.js.map +1 -0
- package/dist/generated/builtins/conv.d.ts +4 -0
- package/dist/generated/builtins/conv.d.ts.map +1 -0
- package/dist/generated/builtins/conv.js +177 -0
- package/dist/generated/builtins/conv.js.map +1 -0
- package/dist/generated/builtins/conv2.d.ts +4 -0
- package/dist/generated/builtins/conv2.d.ts.map +1 -0
- package/dist/generated/builtins/conv2.js +152 -0
- package/dist/generated/builtins/conv2.js.map +1 -0
- package/dist/generated/builtins/copyfile.d.ts +4 -0
- package/dist/generated/builtins/copyfile.d.ts.map +1 -0
- package/dist/generated/builtins/copyfile.js +213 -0
- package/dist/generated/builtins/copyfile.js.map +1 -0
- package/dist/generated/builtins/corrcoef.d.ts +4 -0
- package/dist/generated/builtins/corrcoef.d.ts.map +1 -0
- package/dist/generated/builtins/corrcoef.js +159 -0
- package/dist/generated/builtins/corrcoef.js.map +1 -0
- package/dist/generated/builtins/cos.d.ts +4 -0
- package/dist/generated/builtins/cos.d.ts.map +1 -0
- package/dist/generated/builtins/cos.js +180 -0
- package/dist/generated/builtins/cos.js.map +1 -0
- package/dist/generated/builtins/cosh.d.ts +4 -0
- package/dist/generated/builtins/cosh.d.ts.map +1 -0
- package/dist/generated/builtins/cosh.js +180 -0
- package/dist/generated/builtins/cosh.js.map +1 -0
- package/dist/generated/builtins/cov.d.ts +4 -0
- package/dist/generated/builtins/cov.d.ts.map +1 -0
- package/dist/generated/builtins/cov.js +139 -0
- package/dist/generated/builtins/cov.js.map +1 -0
- package/dist/generated/builtins/csvread.d.ts +4 -0
- package/dist/generated/builtins/csvread.d.ts.map +1 -0
- package/dist/generated/builtins/csvread.js +167 -0
- package/dist/generated/builtins/csvread.js.map +1 -0
- package/dist/generated/builtins/csvwrite.d.ts +4 -0
- package/dist/generated/builtins/csvwrite.d.ts.map +1 -0
- package/dist/generated/builtins/csvwrite.js +153 -0
- package/dist/generated/builtins/csvwrite.js.map +1 -0
- package/dist/generated/builtins/ctranspose.d.ts +4 -0
- package/dist/generated/builtins/ctranspose.d.ts.map +1 -0
- package/dist/generated/builtins/ctranspose.js +174 -0
- package/dist/generated/builtins/ctranspose.js.map +1 -0
- package/dist/generated/builtins/cummax.d.ts +4 -0
- package/dist/generated/builtins/cummax.d.ts.map +1 -0
- package/dist/generated/builtins/cummax.js +182 -0
- package/dist/generated/builtins/cummax.js.map +1 -0
- package/dist/generated/builtins/cummin.d.ts +4 -0
- package/dist/generated/builtins/cummin.d.ts.map +1 -0
- package/dist/generated/builtins/cummin.js +181 -0
- package/dist/generated/builtins/cummin.js.map +1 -0
- package/dist/generated/builtins/cumprod.d.ts +4 -0
- package/dist/generated/builtins/cumprod.d.ts.map +1 -0
- package/dist/generated/builtins/cumprod.js +181 -0
- package/dist/generated/builtins/cumprod.js.map +1 -0
- package/dist/generated/builtins/cumsum.d.ts +4 -0
- package/dist/generated/builtins/cumsum.d.ts.map +1 -0
- package/dist/generated/builtins/cumsum.js +189 -0
- package/dist/generated/builtins/cumsum.js.map +1 -0
- package/dist/generated/builtins/deconv.d.ts +4 -0
- package/dist/generated/builtins/deconv.d.ts.map +1 -0
- package/dist/generated/builtins/deconv.js +157 -0
- package/dist/generated/builtins/deconv.js.map +1 -0
- package/dist/generated/builtins/delete.d.ts +4 -0
- package/dist/generated/builtins/delete.d.ts.map +1 -0
- package/dist/generated/builtins/delete.js +214 -0
- package/dist/generated/builtins/delete.js.map +1 -0
- package/dist/generated/builtins/det.d.ts +4 -0
- package/dist/generated/builtins/det.d.ts.map +1 -0
- package/dist/generated/builtins/det.js +175 -0
- package/dist/generated/builtins/det.js.map +1 -0
- package/dist/generated/builtins/diag.d.ts +4 -0
- package/dist/generated/builtins/diag.d.ts.map +1 -0
- package/dist/generated/builtins/diag.js +242 -0
- package/dist/generated/builtins/diag.js.map +1 -0
- package/dist/generated/builtins/diff.d.ts +4 -0
- package/dist/generated/builtins/diff.d.ts.map +1 -0
- package/dist/generated/builtins/diff.js +208 -0
- package/dist/generated/builtins/diff.js.map +1 -0
- package/dist/generated/builtins/dir.d.ts +4 -0
- package/dist/generated/builtins/dir.d.ts.map +1 -0
- package/dist/generated/builtins/dir.js +225 -0
- package/dist/generated/builtins/dir.js.map +1 -0
- package/dist/generated/builtins/disp.d.ts +4 -0
- package/dist/generated/builtins/disp.d.ts.map +1 -0
- package/dist/generated/builtins/disp.js +159 -0
- package/dist/generated/builtins/disp.js.map +1 -0
- package/dist/generated/builtins/dlmread.d.ts +4 -0
- package/dist/generated/builtins/dlmread.d.ts.map +1 -0
- package/dist/generated/builtins/dlmread.js +168 -0
- package/dist/generated/builtins/dlmread.js.map +1 -0
- package/dist/generated/builtins/dlmwrite.d.ts +4 -0
- package/dist/generated/builtins/dlmwrite.d.ts.map +1 -0
- package/dist/generated/builtins/dlmwrite.js +180 -0
- package/dist/generated/builtins/dlmwrite.js.map +1 -0
- package/dist/generated/builtins/dot.d.ts +4 -0
- package/dist/generated/builtins/dot.d.ts.map +1 -0
- package/dist/generated/builtins/dot.js +163 -0
- package/dist/generated/builtins/dot.js.map +1 -0
- package/dist/generated/builtins/double.d.ts +4 -0
- package/dist/generated/builtins/double.d.ts.map +1 -0
- package/dist/generated/builtins/double.js +240 -0
- package/dist/generated/builtins/double.js.map +1 -0
- package/dist/generated/builtins/eig.d.ts +4 -0
- package/dist/generated/builtins/eig.d.ts.map +1 -0
- package/dist/generated/builtins/eig.js +167 -0
- package/dist/generated/builtins/eig.js.map +1 -0
- package/dist/generated/builtins/endsWith.d.ts +4 -0
- package/dist/generated/builtins/endsWith.d.ts.map +1 -0
- package/dist/generated/builtins/endsWith.js +151 -0
- package/dist/generated/builtins/endsWith.js.map +1 -0
- package/dist/generated/builtins/eq.d.ts +4 -0
- package/dist/generated/builtins/eq.d.ts.map +1 -0
- package/dist/generated/builtins/eq.js +154 -0
- package/dist/generated/builtins/eq.js.map +1 -0
- package/dist/generated/builtins/erase.d.ts +4 -0
- package/dist/generated/builtins/erase.d.ts.map +1 -0
- package/dist/generated/builtins/erase.js +176 -0
- package/dist/generated/builtins/erase.js.map +1 -0
- package/dist/generated/builtins/eraseBetween.d.ts +4 -0
- package/dist/generated/builtins/eraseBetween.d.ts.map +1 -0
- package/dist/generated/builtins/eraseBetween.js +174 -0
- package/dist/generated/builtins/eraseBetween.js.map +1 -0
- package/dist/generated/builtins/error.d.ts +4 -0
- package/dist/generated/builtins/error.d.ts.map +1 -0
- package/dist/generated/builtins/error.js +124 -0
- package/dist/generated/builtins/error.js.map +1 -0
- package/dist/generated/builtins/errorbar.d.ts +4 -0
- package/dist/generated/builtins/errorbar.d.ts.map +1 -0
- package/dist/generated/builtins/errorbar.js +95 -0
- package/dist/generated/builtins/errorbar.js.map +1 -0
- package/dist/generated/builtins/exist.d.ts +4 -0
- package/dist/generated/builtins/exist.d.ts.map +1 -0
- package/dist/generated/builtins/exist.js +213 -0
- package/dist/generated/builtins/exist.js.map +1 -0
- package/dist/generated/builtins/exp.d.ts +4 -0
- package/dist/generated/builtins/exp.d.ts.map +1 -0
- package/dist/generated/builtins/exp.js +232 -0
- package/dist/generated/builtins/exp.js.map +1 -0
- package/dist/generated/builtins/expm1.d.ts +4 -0
- package/dist/generated/builtins/expm1.d.ts.map +1 -0
- package/dist/generated/builtins/expm1.js +227 -0
- package/dist/generated/builtins/expm1.js.map +1 -0
- package/dist/generated/builtins/extractBetween.d.ts +4 -0
- package/dist/generated/builtins/extractBetween.d.ts.map +1 -0
- package/dist/generated/builtins/extractBetween.js +182 -0
- package/dist/generated/builtins/extractBetween.js.map +1 -0
- package/dist/generated/builtins/eye.d.ts +4 -0
- package/dist/generated/builtins/eye.d.ts.map +1 -0
- package/dist/generated/builtins/eye.js +197 -0
- package/dist/generated/builtins/eye.js.map +1 -0
- package/dist/generated/builtins/factorial.d.ts +4 -0
- package/dist/generated/builtins/factorial.d.ts.map +1 -0
- package/dist/generated/builtins/factorial.js +242 -0
- package/dist/generated/builtins/factorial.js.map +1 -0
- package/dist/generated/builtins/false.d.ts +4 -0
- package/dist/generated/builtins/false.d.ts.map +1 -0
- package/dist/generated/builtins/false.js +163 -0
- package/dist/generated/builtins/false.js.map +1 -0
- package/dist/generated/builtins/fclose.d.ts +4 -0
- package/dist/generated/builtins/fclose.d.ts.map +1 -0
- package/dist/generated/builtins/fclose.js +159 -0
- package/dist/generated/builtins/fclose.js.map +1 -0
- package/dist/generated/builtins/feof.d.ts +4 -0
- package/dist/generated/builtins/feof.d.ts.map +1 -0
- package/dist/generated/builtins/feof.js +144 -0
- package/dist/generated/builtins/feof.js.map +1 -0
- package/dist/generated/builtins/fft.d.ts +4 -0
- package/dist/generated/builtins/fft.d.ts.map +1 -0
- package/dist/generated/builtins/fft.js +163 -0
- package/dist/generated/builtins/fft.js.map +1 -0
- package/dist/generated/builtins/fft2.d.ts +4 -0
- package/dist/generated/builtins/fft2.d.ts.map +1 -0
- package/dist/generated/builtins/fft2.js +152 -0
- package/dist/generated/builtins/fft2.js.map +1 -0
- package/dist/generated/builtins/fftshift.d.ts +4 -0
- package/dist/generated/builtins/fftshift.d.ts.map +1 -0
- package/dist/generated/builtins/fftshift.js +150 -0
- package/dist/generated/builtins/fftshift.js.map +1 -0
- package/dist/generated/builtins/fgets.d.ts +4 -0
- package/dist/generated/builtins/fgets.d.ts.map +1 -0
- package/dist/generated/builtins/fgets.js +156 -0
- package/dist/generated/builtins/fgets.js.map +1 -0
- package/dist/generated/builtins/fieldnames.d.ts +4 -0
- package/dist/generated/builtins/fieldnames.d.ts.map +1 -0
- package/dist/generated/builtins/fieldnames.js +152 -0
- package/dist/generated/builtins/fieldnames.js.map +1 -0
- package/dist/generated/builtins/fileread.d.ts +4 -0
- package/dist/generated/builtins/fileread.d.ts.map +1 -0
- package/dist/generated/builtins/fileread.js +164 -0
- package/dist/generated/builtins/fileread.js.map +1 -0
- package/dist/generated/builtins/filewrite.d.ts +4 -0
- package/dist/generated/builtins/filewrite.d.ts.map +1 -0
- package/dist/generated/builtins/filewrite.js +161 -0
- package/dist/generated/builtins/filewrite.js.map +1 -0
- package/dist/generated/builtins/fill.d.ts +4 -0
- package/dist/generated/builtins/fill.d.ts.map +1 -0
- package/dist/generated/builtins/fill.js +231 -0
- package/dist/generated/builtins/fill.js.map +1 -0
- package/dist/generated/builtins/filter.d.ts +4 -0
- package/dist/generated/builtins/filter.d.ts.map +1 -0
- package/dist/generated/builtins/filter.js +156 -0
- package/dist/generated/builtins/filter.js.map +1 -0
- package/dist/generated/builtins/filter2.d.ts +4 -0
- package/dist/generated/builtins/filter2.d.ts.map +1 -0
- package/dist/generated/builtins/filter2.js +136 -0
- package/dist/generated/builtins/filter2.js.map +1 -0
- package/dist/generated/builtins/find.d.ts +4 -0
- package/dist/generated/builtins/find.d.ts.map +1 -0
- package/dist/generated/builtins/find.js +150 -0
- package/dist/generated/builtins/find.js.map +1 -0
- package/dist/generated/builtins/fix.d.ts +4 -0
- package/dist/generated/builtins/fix.d.ts.map +1 -0
- package/dist/generated/builtins/fix.js +140 -0
- package/dist/generated/builtins/fix.js.map +1 -0
- package/dist/generated/builtins/flip.d.ts +4 -0
- package/dist/generated/builtins/flip.d.ts.map +1 -0
- package/dist/generated/builtins/flip.js +199 -0
- package/dist/generated/builtins/flip.js.map +1 -0
- package/dist/generated/builtins/fliplr.d.ts +4 -0
- package/dist/generated/builtins/fliplr.d.ts.map +1 -0
- package/dist/generated/builtins/fliplr.js +202 -0
- package/dist/generated/builtins/fliplr.js.map +1 -0
- package/dist/generated/builtins/flipud.d.ts +4 -0
- package/dist/generated/builtins/flipud.d.ts.map +1 -0
- package/dist/generated/builtins/flipud.js +198 -0
- package/dist/generated/builtins/flipud.js.map +1 -0
- package/dist/generated/builtins/floor.d.ts +4 -0
- package/dist/generated/builtins/floor.d.ts.map +1 -0
- package/dist/generated/builtins/floor.js +187 -0
- package/dist/generated/builtins/floor.js.map +1 -0
- package/dist/generated/builtins/fopen.d.ts +4 -0
- package/dist/generated/builtins/fopen.d.ts.map +1 -0
- package/dist/generated/builtins/fopen.js +176 -0
- package/dist/generated/builtins/fopen.js.map +1 -0
- package/dist/generated/builtins/fprintf.d.ts +4 -0
- package/dist/generated/builtins/fprintf.d.ts.map +1 -0
- package/dist/generated/builtins/fprintf.js +181 -0
- package/dist/generated/builtins/fprintf.js.map +1 -0
- package/dist/generated/builtins/fread.d.ts +4 -0
- package/dist/generated/builtins/fread.d.ts.map +1 -0
- package/dist/generated/builtins/fread.js +164 -0
- package/dist/generated/builtins/fread.js.map +1 -0
- package/dist/generated/builtins/frewind.d.ts +4 -0
- package/dist/generated/builtins/frewind.d.ts.map +1 -0
- package/dist/generated/builtins/frewind.js +134 -0
- package/dist/generated/builtins/frewind.js.map +1 -0
- package/dist/generated/builtins/fspecial.d.ts +4 -0
- package/dist/generated/builtins/fspecial.d.ts.map +1 -0
- package/dist/generated/builtins/fspecial.js +145 -0
- package/dist/generated/builtins/fspecial.js.map +1 -0
- package/dist/generated/builtins/fullfile.d.ts +4 -0
- package/dist/generated/builtins/fullfile.d.ts.map +1 -0
- package/dist/generated/builtins/fullfile.js +181 -0
- package/dist/generated/builtins/fullfile.js.map +1 -0
- package/dist/generated/builtins/fwrite.d.ts +4 -0
- package/dist/generated/builtins/fwrite.d.ts.map +1 -0
- package/dist/generated/builtins/fwrite.js +176 -0
- package/dist/generated/builtins/fwrite.js.map +1 -0
- package/dist/generated/builtins/gamma.d.ts +4 -0
- package/dist/generated/builtins/gamma.d.ts.map +1 -0
- package/dist/generated/builtins/gamma.js +229 -0
- package/dist/generated/builtins/gamma.js.map +1 -0
- package/dist/generated/builtins/gather.d.ts +4 -0
- package/dist/generated/builtins/gather.d.ts.map +1 -0
- package/dist/generated/builtins/gather.js +162 -0
- package/dist/generated/builtins/gather.js.map +1 -0
- package/dist/generated/builtins/ge.d.ts +4 -0
- package/dist/generated/builtins/ge.d.ts.map +1 -0
- package/dist/generated/builtins/ge.js +153 -0
- package/dist/generated/builtins/ge.js.map +1 -0
- package/dist/generated/builtins/genpath.d.ts +4 -0
- package/dist/generated/builtins/genpath.d.ts.map +1 -0
- package/dist/generated/builtins/genpath.js +203 -0
- package/dist/generated/builtins/genpath.js.map +1 -0
- package/dist/generated/builtins/get.d.ts +4 -0
- package/dist/generated/builtins/get.d.ts.map +1 -0
- package/dist/generated/builtins/get.js +70 -0
- package/dist/generated/builtins/get.js.map +1 -0
- package/dist/generated/builtins/getenv.d.ts +4 -0
- package/dist/generated/builtins/getenv.d.ts.map +1 -0
- package/dist/generated/builtins/getenv.js +209 -0
- package/dist/generated/builtins/getenv.js.map +1 -0
- package/dist/generated/builtins/getfield.d.ts +4 -0
- package/dist/generated/builtins/getfield.d.ts.map +1 -0
- package/dist/generated/builtins/getfield.js +151 -0
- package/dist/generated/builtins/getfield.js.map +1 -0
- package/dist/generated/builtins/gpuArray.d.ts +4 -0
- package/dist/generated/builtins/gpuArray.d.ts.map +1 -0
- package/dist/generated/builtins/gpuArray.js +133 -0
- package/dist/generated/builtins/gpuArray.js.map +1 -0
- package/dist/generated/builtins/gpuDevice.d.ts +4 -0
- package/dist/generated/builtins/gpuDevice.d.ts.map +1 -0
- package/dist/generated/builtins/gpuDevice.js +127 -0
- package/dist/generated/builtins/gpuDevice.js.map +1 -0
- package/dist/generated/builtins/gpuInfo.d.ts +4 -0
- package/dist/generated/builtins/gpuInfo.d.ts.map +1 -0
- package/dist/generated/builtins/gpuInfo.js +126 -0
- package/dist/generated/builtins/gpuInfo.js.map +1 -0
- package/dist/generated/builtins/grid.d.ts +4 -0
- package/dist/generated/builtins/grid.d.ts.map +1 -0
- package/dist/generated/builtins/grid.js +60 -0
- package/dist/generated/builtins/grid.js.map +1 -0
- package/dist/generated/builtins/gt.d.ts +4 -0
- package/dist/generated/builtins/gt.d.ts.map +1 -0
- package/dist/generated/builtins/gt.js +153 -0
- package/dist/generated/builtins/gt.js.map +1 -0
- package/dist/generated/builtins/hist.d.ts +4 -0
- package/dist/generated/builtins/hist.d.ts.map +1 -0
- package/dist/generated/builtins/hist.js +84 -0
- package/dist/generated/builtins/hist.js.map +1 -0
- package/dist/generated/builtins/histcounts.d.ts +4 -0
- package/dist/generated/builtins/histcounts.d.ts.map +1 -0
- package/dist/generated/builtins/histcounts.js +154 -0
- package/dist/generated/builtins/histcounts.js.map +1 -0
- package/dist/generated/builtins/histcounts2.d.ts +4 -0
- package/dist/generated/builtins/histcounts2.d.ts.map +1 -0
- package/dist/generated/builtins/histcounts2.js +148 -0
- package/dist/generated/builtins/histcounts2.js.map +1 -0
- package/dist/generated/builtins/histogram.d.ts +4 -0
- package/dist/generated/builtins/histogram.d.ts.map +1 -0
- package/dist/generated/builtins/histogram.js +88 -0
- package/dist/generated/builtins/histogram.js.map +1 -0
- package/dist/generated/builtins/horzcat.d.ts +4 -0
- package/dist/generated/builtins/horzcat.d.ts.map +1 -0
- package/dist/generated/builtins/horzcat.js +164 -0
- package/dist/generated/builtins/horzcat.js.map +1 -0
- package/dist/generated/builtins/hypot.d.ts +4 -0
- package/dist/generated/builtins/hypot.d.ts.map +1 -0
- package/dist/generated/builtins/hypot.js +245 -0
- package/dist/generated/builtins/hypot.js.map +1 -0
- package/dist/generated/builtins/ifft.d.ts +4 -0
- package/dist/generated/builtins/ifft.d.ts.map +1 -0
- package/dist/generated/builtins/ifft.js +147 -0
- package/dist/generated/builtins/ifft.js.map +1 -0
- package/dist/generated/builtins/ifft2.d.ts +4 -0
- package/dist/generated/builtins/ifft2.d.ts.map +1 -0
- package/dist/generated/builtins/ifft2.js +159 -0
- package/dist/generated/builtins/ifft2.js.map +1 -0
- package/dist/generated/builtins/ifftshift.d.ts +4 -0
- package/dist/generated/builtins/ifftshift.d.ts.map +1 -0
- package/dist/generated/builtins/ifftshift.js +141 -0
- package/dist/generated/builtins/ifftshift.js.map +1 -0
- package/dist/generated/builtins/imag.d.ts +4 -0
- package/dist/generated/builtins/imag.d.ts.map +1 -0
- package/dist/generated/builtins/imag.js +223 -0
- package/dist/generated/builtins/imag.js.map +1 -0
- package/dist/generated/builtins/image.d.ts +4 -0
- package/dist/generated/builtins/image.d.ts.map +1 -0
- package/dist/generated/builtins/image.js +98 -0
- package/dist/generated/builtins/image.js.map +1 -0
- package/dist/generated/builtins/imagesc.d.ts +4 -0
- package/dist/generated/builtins/imagesc.d.ts.map +1 -0
- package/dist/generated/builtins/imagesc.js +87 -0
- package/dist/generated/builtins/imagesc.js.map +1 -0
- package/dist/generated/builtins/imfilter.d.ts +4 -0
- package/dist/generated/builtins/imfilter.d.ts.map +1 -0
- package/dist/generated/builtins/imfilter.js +143 -0
- package/dist/generated/builtins/imfilter.js.map +1 -0
- package/dist/generated/builtins/ind2sub.d.ts +4 -0
- package/dist/generated/builtins/ind2sub.d.ts.map +1 -0
- package/dist/generated/builtins/ind2sub.js +157 -0
- package/dist/generated/builtins/ind2sub.js.map +1 -0
- package/dist/generated/builtins/input.d.ts +4 -0
- package/dist/generated/builtins/input.d.ts.map +1 -0
- package/dist/generated/builtins/input.js +102 -0
- package/dist/generated/builtins/input.js.map +1 -0
- package/dist/generated/builtins/intersect.d.ts +4 -0
- package/dist/generated/builtins/intersect.d.ts.map +1 -0
- package/dist/generated/builtins/intersect.js +147 -0
- package/dist/generated/builtins/intersect.js.map +1 -0
- package/dist/generated/builtins/inv.d.ts +4 -0
- package/dist/generated/builtins/inv.d.ts.map +1 -0
- package/dist/generated/builtins/inv.js +164 -0
- package/dist/generated/builtins/inv.js.map +1 -0
- package/dist/generated/builtins/ipermute.d.ts +4 -0
- package/dist/generated/builtins/ipermute.d.ts.map +1 -0
- package/dist/generated/builtins/ipermute.js +217 -0
- package/dist/generated/builtins/ipermute.js.map +1 -0
- package/dist/generated/builtins/isa.d.ts +4 -0
- package/dist/generated/builtins/isa.d.ts.map +1 -0
- package/dist/generated/builtins/isa.js +176 -0
- package/dist/generated/builtins/isa.js.map +1 -0
- package/dist/generated/builtins/ischar.d.ts +4 -0
- package/dist/generated/builtins/ischar.d.ts.map +1 -0
- package/dist/generated/builtins/ischar.js +154 -0
- package/dist/generated/builtins/ischar.js.map +1 -0
- package/dist/generated/builtins/isempty.d.ts +4 -0
- package/dist/generated/builtins/isempty.d.ts.map +1 -0
- package/dist/generated/builtins/isempty.js +152 -0
- package/dist/generated/builtins/isempty.js.map +1 -0
- package/dist/generated/builtins/isequal.d.ts +4 -0
- package/dist/generated/builtins/isequal.d.ts.map +1 -0
- package/dist/generated/builtins/isequal.js +154 -0
- package/dist/generated/builtins/isequal.js.map +1 -0
- package/dist/generated/builtins/isfield.d.ts +4 -0
- package/dist/generated/builtins/isfield.d.ts.map +1 -0
- package/dist/generated/builtins/isfield.js +140 -0
- package/dist/generated/builtins/isfield.js.map +1 -0
- package/dist/generated/builtins/isfinite.d.ts +4 -0
- package/dist/generated/builtins/isfinite.d.ts.map +1 -0
- package/dist/generated/builtins/isfinite.js +150 -0
- package/dist/generated/builtins/isfinite.js.map +1 -0
- package/dist/generated/builtins/isgpuarray.d.ts +4 -0
- package/dist/generated/builtins/isgpuarray.d.ts.map +1 -0
- package/dist/generated/builtins/isgpuarray.js +117 -0
- package/dist/generated/builtins/isgpuarray.js.map +1 -0
- package/dist/generated/builtins/ishermitian.d.ts +4 -0
- package/dist/generated/builtins/ishermitian.d.ts.map +1 -0
- package/dist/generated/builtins/ishermitian.js +159 -0
- package/dist/generated/builtins/ishermitian.js.map +1 -0
- package/dist/generated/builtins/isinf.d.ts +4 -0
- package/dist/generated/builtins/isinf.d.ts.map +1 -0
- package/dist/generated/builtins/isinf.js +151 -0
- package/dist/generated/builtins/isinf.js.map +1 -0
- package/dist/generated/builtins/islogical.d.ts +4 -0
- package/dist/generated/builtins/islogical.d.ts.map +1 -0
- package/dist/generated/builtins/islogical.js +153 -0
- package/dist/generated/builtins/islogical.js.map +1 -0
- package/dist/generated/builtins/ismatrix.d.ts +4 -0
- package/dist/generated/builtins/ismatrix.d.ts.map +1 -0
- package/dist/generated/builtins/ismatrix.js +175 -0
- package/dist/generated/builtins/ismatrix.js.map +1 -0
- package/dist/generated/builtins/ismember.d.ts +4 -0
- package/dist/generated/builtins/ismember.d.ts.map +1 -0
- package/dist/generated/builtins/ismember.js +165 -0
- package/dist/generated/builtins/ismember.js.map +1 -0
- package/dist/generated/builtins/isnan.d.ts +4 -0
- package/dist/generated/builtins/isnan.d.ts.map +1 -0
- package/dist/generated/builtins/isnan.js +171 -0
- package/dist/generated/builtins/isnan.js.map +1 -0
- package/dist/generated/builtins/isnumeric.d.ts +4 -0
- package/dist/generated/builtins/isnumeric.d.ts.map +1 -0
- package/dist/generated/builtins/isnumeric.js +157 -0
- package/dist/generated/builtins/isnumeric.js.map +1 -0
- package/dist/generated/builtins/isreal.d.ts +4 -0
- package/dist/generated/builtins/isreal.d.ts.map +1 -0
- package/dist/generated/builtins/isreal.js +152 -0
- package/dist/generated/builtins/isreal.js.map +1 -0
- package/dist/generated/builtins/isscalar.d.ts +4 -0
- package/dist/generated/builtins/isscalar.d.ts.map +1 -0
- package/dist/generated/builtins/isscalar.js +162 -0
- package/dist/generated/builtins/isscalar.js.map +1 -0
- package/dist/generated/builtins/issorted.d.ts +4 -0
- package/dist/generated/builtins/issorted.d.ts.map +1 -0
- package/dist/generated/builtins/issorted.js +179 -0
- package/dist/generated/builtins/issorted.js.map +1 -0
- package/dist/generated/builtins/isstring.d.ts +4 -0
- package/dist/generated/builtins/isstring.d.ts.map +1 -0
- package/dist/generated/builtins/isstring.js +157 -0
- package/dist/generated/builtins/isstring.js.map +1 -0
- package/dist/generated/builtins/issymmetric.d.ts +4 -0
- package/dist/generated/builtins/issymmetric.d.ts.map +1 -0
- package/dist/generated/builtins/issymmetric.js +166 -0
- package/dist/generated/builtins/issymmetric.js.map +1 -0
- package/dist/generated/builtins/isvector.d.ts +4 -0
- package/dist/generated/builtins/isvector.d.ts.map +1 -0
- package/dist/generated/builtins/isvector.js +180 -0
- package/dist/generated/builtins/isvector.js.map +1 -0
- package/dist/generated/builtins/join.d.ts +4 -0
- package/dist/generated/builtins/join.d.ts.map +1 -0
- package/dist/generated/builtins/join.js +189 -0
- package/dist/generated/builtins/join.js.map +1 -0
- package/dist/generated/builtins/jsondecode.d.ts +4 -0
- package/dist/generated/builtins/jsondecode.d.ts.map +1 -0
- package/dist/generated/builtins/jsondecode.js +159 -0
- package/dist/generated/builtins/jsondecode.js.map +1 -0
- package/dist/generated/builtins/jsonencode.d.ts +4 -0
- package/dist/generated/builtins/jsonencode.d.ts.map +1 -0
- package/dist/generated/builtins/jsonencode.js +173 -0
- package/dist/generated/builtins/jsonencode.js.map +1 -0
- package/dist/generated/builtins/kron.d.ts +4 -0
- package/dist/generated/builtins/kron.d.ts.map +1 -0
- package/dist/generated/builtins/kron.js +203 -0
- package/dist/generated/builtins/kron.js.map +1 -0
- package/dist/generated/builtins/ldivide.d.ts +4 -0
- package/dist/generated/builtins/ldivide.d.ts.map +1 -0
- package/dist/generated/builtins/ldivide.js +248 -0
- package/dist/generated/builtins/ldivide.js.map +1 -0
- package/dist/generated/builtins/le.d.ts +4 -0
- package/dist/generated/builtins/le.d.ts.map +1 -0
- package/dist/generated/builtins/le.js +153 -0
- package/dist/generated/builtins/le.js.map +1 -0
- package/dist/generated/builtins/legend.d.ts +4 -0
- package/dist/generated/builtins/legend.d.ts.map +1 -0
- package/dist/generated/builtins/legend.js +70 -0
- package/dist/generated/builtins/legend.js.map +1 -0
- package/dist/generated/builtins/length.d.ts +4 -0
- package/dist/generated/builtins/length.d.ts.map +1 -0
- package/dist/generated/builtins/length.js +156 -0
- package/dist/generated/builtins/length.js.map +1 -0
- package/dist/generated/builtins/linsolve.d.ts +4 -0
- package/dist/generated/builtins/linsolve.d.ts.map +1 -0
- package/dist/generated/builtins/linsolve.js +168 -0
- package/dist/generated/builtins/linsolve.js.map +1 -0
- package/dist/generated/builtins/linspace.d.ts +4 -0
- package/dist/generated/builtins/linspace.d.ts.map +1 -0
- package/dist/generated/builtins/linspace.js +217 -0
- package/dist/generated/builtins/linspace.js.map +1 -0
- package/dist/generated/builtins/load.d.ts +4 -0
- package/dist/generated/builtins/load.d.ts.map +1 -0
- package/dist/generated/builtins/load.js +139 -0
- package/dist/generated/builtins/load.js.map +1 -0
- package/dist/generated/builtins/log.d.ts +4 -0
- package/dist/generated/builtins/log.d.ts.map +1 -0
- package/dist/generated/builtins/log.js +226 -0
- package/dist/generated/builtins/log.js.map +1 -0
- package/dist/generated/builtins/log10.d.ts +4 -0
- package/dist/generated/builtins/log10.d.ts.map +1 -0
- package/dist/generated/builtins/log10.js +221 -0
- package/dist/generated/builtins/log10.js.map +1 -0
- package/dist/generated/builtins/log1p.d.ts +4 -0
- package/dist/generated/builtins/log1p.d.ts.map +1 -0
- package/dist/generated/builtins/log1p.js +233 -0
- package/dist/generated/builtins/log1p.js.map +1 -0
- package/dist/generated/builtins/log2.d.ts +4 -0
- package/dist/generated/builtins/log2.d.ts.map +1 -0
- package/dist/generated/builtins/log2.js +226 -0
- package/dist/generated/builtins/log2.js.map +1 -0
- package/dist/generated/builtins/logical.d.ts +4 -0
- package/dist/generated/builtins/logical.d.ts.map +1 -0
- package/dist/generated/builtins/logical.js +156 -0
- package/dist/generated/builtins/logical.js.map +1 -0
- package/dist/generated/builtins/loglog.d.ts +4 -0
- package/dist/generated/builtins/loglog.d.ts.map +1 -0
- package/dist/generated/builtins/loglog.js +69 -0
- package/dist/generated/builtins/loglog.js.map +1 -0
- package/dist/generated/builtins/logspace.d.ts +4 -0
- package/dist/generated/builtins/logspace.d.ts.map +1 -0
- package/dist/generated/builtins/logspace.js +208 -0
- package/dist/generated/builtins/logspace.js.map +1 -0
- package/dist/generated/builtins/lower.d.ts +4 -0
- package/dist/generated/builtins/lower.d.ts.map +1 -0
- package/dist/generated/builtins/lower.js +179 -0
- package/dist/generated/builtins/lower.js.map +1 -0
- package/dist/generated/builtins/ls.d.ts +4 -0
- package/dist/generated/builtins/ls.d.ts.map +1 -0
- package/dist/generated/builtins/ls.js +226 -0
- package/dist/generated/builtins/ls.js.map +1 -0
- package/dist/generated/builtins/lt.d.ts +4 -0
- package/dist/generated/builtins/lt.d.ts.map +1 -0
- package/dist/generated/builtins/lt.js +153 -0
- package/dist/generated/builtins/lt.js.map +1 -0
- package/dist/generated/builtins/lu.d.ts +4 -0
- package/dist/generated/builtins/lu.d.ts.map +1 -0
- package/dist/generated/builtins/lu.js +164 -0
- package/dist/generated/builtins/lu.js.map +1 -0
- package/dist/generated/builtins/magic.d.ts +4 -0
- package/dist/generated/builtins/magic.d.ts.map +1 -0
- package/dist/generated/builtins/magic.js +153 -0
- package/dist/generated/builtins/magic.js.map +1 -0
- package/dist/generated/builtins/mat2cell.d.ts +4 -0
- package/dist/generated/builtins/mat2cell.d.ts.map +1 -0
- package/dist/generated/builtins/mat2cell.js +154 -0
- package/dist/generated/builtins/mat2cell.js.map +1 -0
- package/dist/generated/builtins/max.d.ts +4 -0
- package/dist/generated/builtins/max.d.ts.map +1 -0
- package/dist/generated/builtins/max.js +192 -0
- package/dist/generated/builtins/max.js.map +1 -0
- package/dist/generated/builtins/mean.d.ts +4 -0
- package/dist/generated/builtins/mean.d.ts.map +1 -0
- package/dist/generated/builtins/mean.js +209 -0
- package/dist/generated/builtins/mean.js.map +1 -0
- package/dist/generated/builtins/median.d.ts +4 -0
- package/dist/generated/builtins/median.d.ts.map +1 -0
- package/dist/generated/builtins/median.js +197 -0
- package/dist/generated/builtins/median.js.map +1 -0
- package/dist/generated/builtins/mesh.d.ts +4 -0
- package/dist/generated/builtins/mesh.d.ts.map +1 -0
- package/dist/generated/builtins/mesh.js +90 -0
- package/dist/generated/builtins/mesh.js.map +1 -0
- package/dist/generated/builtins/meshc.d.ts +4 -0
- package/dist/generated/builtins/meshc.d.ts.map +1 -0
- package/dist/generated/builtins/meshc.js +90 -0
- package/dist/generated/builtins/meshc.js.map +1 -0
- package/dist/generated/builtins/meshgrid.d.ts +4 -0
- package/dist/generated/builtins/meshgrid.d.ts.map +1 -0
- package/dist/generated/builtins/meshgrid.js +206 -0
- package/dist/generated/builtins/meshgrid.js.map +1 -0
- package/dist/generated/builtins/min.d.ts +4 -0
- package/dist/generated/builtins/min.d.ts.map +1 -0
- package/dist/generated/builtins/min.js +192 -0
- package/dist/generated/builtins/min.js.map +1 -0
- package/dist/generated/builtins/minus.d.ts +4 -0
- package/dist/generated/builtins/minus.d.ts.map +1 -0
- package/dist/generated/builtins/minus.js +244 -0
- package/dist/generated/builtins/minus.js.map +1 -0
- package/dist/generated/builtins/mkdir.d.ts +4 -0
- package/dist/generated/builtins/mkdir.d.ts.map +1 -0
- package/dist/generated/builtins/mkdir.js +220 -0
- package/dist/generated/builtins/mkdir.js.map +1 -0
- package/dist/generated/builtins/mldivide.d.ts +4 -0
- package/dist/generated/builtins/mldivide.d.ts.map +1 -0
- package/dist/generated/builtins/mldivide.js +156 -0
- package/dist/generated/builtins/mldivide.js.map +1 -0
- package/dist/generated/builtins/mod.d.ts +4 -0
- package/dist/generated/builtins/mod.d.ts.map +1 -0
- package/dist/generated/builtins/mod.js +155 -0
- package/dist/generated/builtins/mod.js.map +1 -0
- package/dist/generated/builtins/movefile.d.ts +4 -0
- package/dist/generated/builtins/movefile.d.ts.map +1 -0
- package/dist/generated/builtins/movefile.js +217 -0
- package/dist/generated/builtins/movefile.js.map +1 -0
- package/dist/generated/builtins/mpower.d.ts +4 -0
- package/dist/generated/builtins/mpower.d.ts.map +1 -0
- package/dist/generated/builtins/mpower.js +161 -0
- package/dist/generated/builtins/mpower.js.map +1 -0
- package/dist/generated/builtins/mrdivide.d.ts +4 -0
- package/dist/generated/builtins/mrdivide.d.ts.map +1 -0
- package/dist/generated/builtins/mrdivide.js +155 -0
- package/dist/generated/builtins/mrdivide.js.map +1 -0
- package/dist/generated/builtins/mtimes.d.ts +4 -0
- package/dist/generated/builtins/mtimes.d.ts.map +1 -0
- package/dist/generated/builtins/mtimes.js +185 -0
- package/dist/generated/builtins/mtimes.js.map +1 -0
- package/dist/generated/builtins/ndims.d.ts +4 -0
- package/dist/generated/builtins/ndims.d.ts.map +1 -0
- package/dist/generated/builtins/ndims.js +149 -0
- package/dist/generated/builtins/ndims.js.map +1 -0
- package/dist/generated/builtins/ne.d.ts +4 -0
- package/dist/generated/builtins/ne.d.ts.map +1 -0
- package/dist/generated/builtins/ne.js +161 -0
- package/dist/generated/builtins/ne.js.map +1 -0
- package/dist/generated/builtins/nnz.d.ts +4 -0
- package/dist/generated/builtins/nnz.d.ts.map +1 -0
- package/dist/generated/builtins/nnz.js +198 -0
- package/dist/generated/builtins/nnz.js.map +1 -0
- package/dist/generated/builtins/norm.d.ts +4 -0
- package/dist/generated/builtins/norm.d.ts.map +1 -0
- package/dist/generated/builtins/norm.js +167 -0
- package/dist/generated/builtins/norm.js.map +1 -0
- package/dist/generated/builtins/not.d.ts +4 -0
- package/dist/generated/builtins/not.d.ts.map +1 -0
- package/dist/generated/builtins/not.js +136 -0
- package/dist/generated/builtins/not.js.map +1 -0
- package/dist/generated/builtins/num2str.d.ts +4 -0
- package/dist/generated/builtins/num2str.d.ts.map +1 -0
- package/dist/generated/builtins/num2str.js +168 -0
- package/dist/generated/builtins/num2str.js.map +1 -0
- package/dist/generated/builtins/numel.d.ts +4 -0
- package/dist/generated/builtins/numel.d.ts.map +1 -0
- package/dist/generated/builtins/numel.js +164 -0
- package/dist/generated/builtins/numel.js.map +1 -0
- package/dist/generated/builtins/ones.d.ts +4 -0
- package/dist/generated/builtins/ones.d.ts.map +1 -0
- package/dist/generated/builtins/ones.js +191 -0
- package/dist/generated/builtins/ones.js.map +1 -0
- package/dist/generated/builtins/or.d.ts +4 -0
- package/dist/generated/builtins/or.d.ts.map +1 -0
- package/dist/generated/builtins/or.js +136 -0
- package/dist/generated/builtins/or.js.map +1 -0
- package/dist/generated/builtins/orderfields.d.ts +4 -0
- package/dist/generated/builtins/orderfields.d.ts.map +1 -0
- package/dist/generated/builtins/orderfields.js +156 -0
- package/dist/generated/builtins/orderfields.js.map +1 -0
- package/dist/generated/builtins/pad.d.ts +4 -0
- package/dist/generated/builtins/pad.d.ts.map +1 -0
- package/dist/generated/builtins/pad.js +182 -0
- package/dist/generated/builtins/pad.js.map +1 -0
- package/dist/generated/builtins/pagefun.d.ts +4 -0
- package/dist/generated/builtins/pagefun.d.ts.map +1 -0
- package/dist/generated/builtins/pagefun.js +125 -0
- package/dist/generated/builtins/pagefun.js.map +1 -0
- package/dist/generated/builtins/path.d.ts +4 -0
- package/dist/generated/builtins/path.d.ts.map +1 -0
- package/dist/generated/builtins/path.js +202 -0
- package/dist/generated/builtins/path.js.map +1 -0
- package/dist/generated/builtins/pause.d.ts +4 -0
- package/dist/generated/builtins/pause.d.ts.map +1 -0
- package/dist/generated/builtins/pause.js +121 -0
- package/dist/generated/builtins/pause.js.map +1 -0
- package/dist/generated/builtins/permute.d.ts +4 -0
- package/dist/generated/builtins/permute.d.ts.map +1 -0
- package/dist/generated/builtins/permute.js +217 -0
- package/dist/generated/builtins/permute.js.map +1 -0
- package/dist/generated/builtins/pie.d.ts +4 -0
- package/dist/generated/builtins/pie.d.ts.map +1 -0
- package/dist/generated/builtins/pie.js +66 -0
- package/dist/generated/builtins/pie.js.map +1 -0
- package/dist/generated/builtins/pinv.d.ts +4 -0
- package/dist/generated/builtins/pinv.d.ts.map +1 -0
- package/dist/generated/builtins/pinv.js +167 -0
- package/dist/generated/builtins/pinv.js.map +1 -0
- package/dist/generated/builtins/plot.d.ts +4 -0
- package/dist/generated/builtins/plot.d.ts.map +1 -0
- package/dist/generated/builtins/plot.js +123 -0
- package/dist/generated/builtins/plot.js.map +1 -0
- package/dist/generated/builtins/plot3.d.ts +4 -0
- package/dist/generated/builtins/plot3.d.ts.map +1 -0
- package/dist/generated/builtins/plot3.js +92 -0
- package/dist/generated/builtins/plot3.js.map +1 -0
- package/dist/generated/builtins/plus.d.ts +4 -0
- package/dist/generated/builtins/plus.d.ts.map +1 -0
- package/dist/generated/builtins/plus.js +248 -0
- package/dist/generated/builtins/plus.js.map +1 -0
- package/dist/generated/builtins/polyder.d.ts +4 -0
- package/dist/generated/builtins/polyder.d.ts.map +1 -0
- package/dist/generated/builtins/polyder.js +172 -0
- package/dist/generated/builtins/polyder.js.map +1 -0
- package/dist/generated/builtins/polyfit.d.ts +4 -0
- package/dist/generated/builtins/polyfit.d.ts.map +1 -0
- package/dist/generated/builtins/polyfit.js +145 -0
- package/dist/generated/builtins/polyfit.js.map +1 -0
- package/dist/generated/builtins/polyint.d.ts +4 -0
- package/dist/generated/builtins/polyint.d.ts.map +1 -0
- package/dist/generated/builtins/polyint.js +148 -0
- package/dist/generated/builtins/polyint.js.map +1 -0
- package/dist/generated/builtins/polyval.d.ts +4 -0
- package/dist/generated/builtins/polyval.d.ts.map +1 -0
- package/dist/generated/builtins/polyval.js +165 -0
- package/dist/generated/builtins/polyval.js.map +1 -0
- package/dist/generated/builtins/pow2.d.ts +4 -0
- package/dist/generated/builtins/pow2.d.ts.map +1 -0
- package/dist/generated/builtins/pow2.js +231 -0
- package/dist/generated/builtins/pow2.js.map +1 -0
- package/dist/generated/builtins/power.d.ts +4 -0
- package/dist/generated/builtins/power.d.ts.map +1 -0
- package/dist/generated/builtins/power.js +236 -0
- package/dist/generated/builtins/power.js.map +1 -0
- package/dist/generated/builtins/prod.d.ts +4 -0
- package/dist/generated/builtins/prod.d.ts.map +1 -0
- package/dist/generated/builtins/prod.js +192 -0
- package/dist/generated/builtins/prod.js.map +1 -0
- package/dist/generated/builtins/pwd.d.ts +4 -0
- package/dist/generated/builtins/pwd.d.ts.map +1 -0
- package/dist/generated/builtins/pwd.js +190 -0
- package/dist/generated/builtins/pwd.js.map +1 -0
- package/dist/generated/builtins/qr.d.ts +4 -0
- package/dist/generated/builtins/qr.d.ts.map +1 -0
- package/dist/generated/builtins/qr.js +154 -0
- package/dist/generated/builtins/qr.js.map +1 -0
- package/dist/generated/builtins/quiver.d.ts +4 -0
- package/dist/generated/builtins/quiver.d.ts.map +1 -0
- package/dist/generated/builtins/quiver.js +102 -0
- package/dist/generated/builtins/quiver.js.map +1 -0
- package/dist/generated/builtins/rand.d.ts +4 -0
- package/dist/generated/builtins/rand.d.ts.map +1 -0
- package/dist/generated/builtins/rand.js +186 -0
- package/dist/generated/builtins/rand.js.map +1 -0
- package/dist/generated/builtins/randi.d.ts +4 -0
- package/dist/generated/builtins/randi.d.ts.map +1 -0
- package/dist/generated/builtins/randi.js +199 -0
- package/dist/generated/builtins/randi.js.map +1 -0
- package/dist/generated/builtins/randn.d.ts +4 -0
- package/dist/generated/builtins/randn.d.ts.map +1 -0
- package/dist/generated/builtins/randn.js +199 -0
- package/dist/generated/builtins/randn.js.map +1 -0
- package/dist/generated/builtins/randperm.d.ts +4 -0
- package/dist/generated/builtins/randperm.d.ts.map +1 -0
- package/dist/generated/builtins/randperm.js +188 -0
- package/dist/generated/builtins/randperm.js.map +1 -0
- package/dist/generated/builtins/range.d.ts +4 -0
- package/dist/generated/builtins/range.d.ts.map +1 -0
- package/dist/generated/builtins/range.js +216 -0
- package/dist/generated/builtins/range.js.map +1 -0
- package/dist/generated/builtins/rank.d.ts +4 -0
- package/dist/generated/builtins/rank.d.ts.map +1 -0
- package/dist/generated/builtins/rank.js +181 -0
- package/dist/generated/builtins/rank.js.map +1 -0
- package/dist/generated/builtins/rcond.d.ts +4 -0
- package/dist/generated/builtins/rcond.d.ts.map +1 -0
- package/dist/generated/builtins/rcond.js +157 -0
- package/dist/generated/builtins/rcond.js.map +1 -0
- package/dist/generated/builtins/rdivide.d.ts +4 -0
- package/dist/generated/builtins/rdivide.d.ts.map +1 -0
- package/dist/generated/builtins/rdivide.js +257 -0
- package/dist/generated/builtins/rdivide.js.map +1 -0
- package/dist/generated/builtins/read.d.ts +4 -0
- package/dist/generated/builtins/read.d.ts.map +1 -0
- package/dist/generated/builtins/read.js +133 -0
- package/dist/generated/builtins/read.js.map +1 -0
- package/dist/generated/builtins/readline.d.ts +4 -0
- package/dist/generated/builtins/readline.d.ts.map +1 -0
- package/dist/generated/builtins/readline.js +152 -0
- package/dist/generated/builtins/readline.js.map +1 -0
- package/dist/generated/builtins/readmatrix.d.ts +4 -0
- package/dist/generated/builtins/readmatrix.d.ts.map +1 -0
- package/dist/generated/builtins/readmatrix.js +213 -0
- package/dist/generated/builtins/readmatrix.js.map +1 -0
- package/dist/generated/builtins/real.d.ts +4 -0
- package/dist/generated/builtins/real.d.ts.map +1 -0
- package/dist/generated/builtins/real.js +228 -0
- package/dist/generated/builtins/real.js.map +1 -0
- package/dist/generated/builtins/regexp.d.ts +4 -0
- package/dist/generated/builtins/regexp.d.ts.map +1 -0
- package/dist/generated/builtins/regexp.js +154 -0
- package/dist/generated/builtins/regexp.js.map +1 -0
- package/dist/generated/builtins/regexpi.d.ts +4 -0
- package/dist/generated/builtins/regexpi.d.ts.map +1 -0
- package/dist/generated/builtins/regexpi.js +149 -0
- package/dist/generated/builtins/regexpi.js.map +1 -0
- package/dist/generated/builtins/regexprep.d.ts +4 -0
- package/dist/generated/builtins/regexprep.d.ts.map +1 -0
- package/dist/generated/builtins/regexprep.js +139 -0
- package/dist/generated/builtins/regexprep.js.map +1 -0
- package/dist/generated/builtins/rem.d.ts +4 -0
- package/dist/generated/builtins/rem.d.ts.map +1 -0
- package/dist/generated/builtins/rem.js +163 -0
- package/dist/generated/builtins/rem.js.map +1 -0
- package/dist/generated/builtins/replace.d.ts +4 -0
- package/dist/generated/builtins/replace.d.ts.map +1 -0
- package/dist/generated/builtins/replace.js +195 -0
- package/dist/generated/builtins/replace.js.map +1 -0
- package/dist/generated/builtins/repmat.d.ts +4 -0
- package/dist/generated/builtins/repmat.d.ts.map +1 -0
- package/dist/generated/builtins/repmat.js +205 -0
- package/dist/generated/builtins/repmat.js.map +1 -0
- package/dist/generated/builtins/reshape.d.ts +4 -0
- package/dist/generated/builtins/reshape.d.ts.map +1 -0
- package/dist/generated/builtins/reshape.js +178 -0
- package/dist/generated/builtins/reshape.js.map +1 -0
- package/dist/generated/builtins/rmdir.d.ts +4 -0
- package/dist/generated/builtins/rmdir.d.ts.map +1 -0
- package/dist/generated/builtins/rmdir.js +215 -0
- package/dist/generated/builtins/rmdir.js.map +1 -0
- package/dist/generated/builtins/rmfield.d.ts +4 -0
- package/dist/generated/builtins/rmfield.d.ts.map +1 -0
- package/dist/generated/builtins/rmfield.js +136 -0
- package/dist/generated/builtins/rmfield.js.map +1 -0
- package/dist/generated/builtins/rmpath.d.ts +4 -0
- package/dist/generated/builtins/rmpath.d.ts.map +1 -0
- package/dist/generated/builtins/rmpath.js +215 -0
- package/dist/generated/builtins/rmpath.js.map +1 -0
- package/dist/generated/builtins/rng.d.ts +4 -0
- package/dist/generated/builtins/rng.d.ts.map +1 -0
- package/dist/generated/builtins/rng.js +138 -0
- package/dist/generated/builtins/rng.js.map +1 -0
- package/dist/generated/builtins/roots.d.ts +4 -0
- package/dist/generated/builtins/roots.d.ts.map +1 -0
- package/dist/generated/builtins/roots.js +135 -0
- package/dist/generated/builtins/roots.js.map +1 -0
- package/dist/generated/builtins/rot90.d.ts +4 -0
- package/dist/generated/builtins/rot90.d.ts.map +1 -0
- package/dist/generated/builtins/rot90.js +200 -0
- package/dist/generated/builtins/rot90.js.map +1 -0
- package/dist/generated/builtins/round.d.ts +4 -0
- package/dist/generated/builtins/round.d.ts.map +1 -0
- package/dist/generated/builtins/round.js +161 -0
- package/dist/generated/builtins/round.js.map +1 -0
- package/dist/generated/builtins/save.d.ts +4 -0
- package/dist/generated/builtins/save.d.ts.map +1 -0
- package/dist/generated/builtins/save.js +147 -0
- package/dist/generated/builtins/save.js.map +1 -0
- package/dist/generated/builtins/savepath.d.ts +4 -0
- package/dist/generated/builtins/savepath.d.ts.map +1 -0
- package/dist/generated/builtins/savepath.js +220 -0
- package/dist/generated/builtins/savepath.js.map +1 -0
- package/dist/generated/builtins/scatter.d.ts +4 -0
- package/dist/generated/builtins/scatter.d.ts.map +1 -0
- package/dist/generated/builtins/scatter.js +96 -0
- package/dist/generated/builtins/scatter.js.map +1 -0
- package/dist/generated/builtins/scatter3.d.ts +4 -0
- package/dist/generated/builtins/scatter3.d.ts.map +1 -0
- package/dist/generated/builtins/scatter3.js +97 -0
- package/dist/generated/builtins/scatter3.js.map +1 -0
- package/dist/generated/builtins/semilogx.d.ts +4 -0
- package/dist/generated/builtins/semilogx.d.ts.map +1 -0
- package/dist/generated/builtins/semilogx.js +85 -0
- package/dist/generated/builtins/semilogx.js.map +1 -0
- package/dist/generated/builtins/semilogy.d.ts +4 -0
- package/dist/generated/builtins/semilogy.d.ts.map +1 -0
- package/dist/generated/builtins/semilogy.js +69 -0
- package/dist/generated/builtins/semilogy.js.map +1 -0
- package/dist/generated/builtins/set.d.ts +4 -0
- package/dist/generated/builtins/set.d.ts.map +1 -0
- package/dist/generated/builtins/set.js +69 -0
- package/dist/generated/builtins/set.js.map +1 -0
- package/dist/generated/builtins/setdiff.d.ts +4 -0
- package/dist/generated/builtins/setdiff.d.ts.map +1 -0
- package/dist/generated/builtins/setdiff.js +171 -0
- package/dist/generated/builtins/setdiff.js.map +1 -0
- package/dist/generated/builtins/setenv.d.ts +4 -0
- package/dist/generated/builtins/setenv.d.ts.map +1 -0
- package/dist/generated/builtins/setenv.js +212 -0
- package/dist/generated/builtins/setenv.js.map +1 -0
- package/dist/generated/builtins/setfield.d.ts +4 -0
- package/dist/generated/builtins/setfield.d.ts.map +1 -0
- package/dist/generated/builtins/setfield.js +145 -0
- package/dist/generated/builtins/setfield.js.map +1 -0
- package/dist/generated/builtins/shading.d.ts +4 -0
- package/dist/generated/builtins/shading.d.ts.map +1 -0
- package/dist/generated/builtins/shading.js +64 -0
- package/dist/generated/builtins/shading.js.map +1 -0
- package/dist/generated/builtins/sign.d.ts +4 -0
- package/dist/generated/builtins/sign.d.ts.map +1 -0
- package/dist/generated/builtins/sign.js +246 -0
- package/dist/generated/builtins/sign.js.map +1 -0
- package/dist/generated/builtins/sin.d.ts +4 -0
- package/dist/generated/builtins/sin.d.ts.map +1 -0
- package/dist/generated/builtins/sin.js +179 -0
- package/dist/generated/builtins/sin.js.map +1 -0
- package/dist/generated/builtins/single.d.ts +4 -0
- package/dist/generated/builtins/single.d.ts.map +1 -0
- package/dist/generated/builtins/single.js +249 -0
- package/dist/generated/builtins/single.js.map +1 -0
- package/dist/generated/builtins/sinh.d.ts +4 -0
- package/dist/generated/builtins/sinh.d.ts.map +1 -0
- package/dist/generated/builtins/sinh.js +182 -0
- package/dist/generated/builtins/sinh.js.map +1 -0
- package/dist/generated/builtins/size.d.ts +4 -0
- package/dist/generated/builtins/size.d.ts.map +1 -0
- package/dist/generated/builtins/size.js +166 -0
- package/dist/generated/builtins/size.js.map +1 -0
- package/dist/generated/builtins/sort.d.ts +4 -0
- package/dist/generated/builtins/sort.d.ts.map +1 -0
- package/dist/generated/builtins/sort.js +195 -0
- package/dist/generated/builtins/sort.js.map +1 -0
- package/dist/generated/builtins/sortrows.d.ts +4 -0
- package/dist/generated/builtins/sortrows.d.ts.map +1 -0
- package/dist/generated/builtins/sortrows.js +204 -0
- package/dist/generated/builtins/sortrows.js.map +1 -0
- package/dist/generated/builtins/split.d.ts +4 -0
- package/dist/generated/builtins/split.d.ts.map +1 -0
- package/dist/generated/builtins/split.js +178 -0
- package/dist/generated/builtins/split.js.map +1 -0
- package/dist/generated/builtins/sprintf.d.ts +4 -0
- package/dist/generated/builtins/sprintf.d.ts.map +1 -0
- package/dist/generated/builtins/sprintf.js +191 -0
- package/dist/generated/builtins/sprintf.js.map +1 -0
- package/dist/generated/builtins/sqrt.d.ts +4 -0
- package/dist/generated/builtins/sqrt.d.ts.map +1 -0
- package/dist/generated/builtins/sqrt.js +230 -0
- package/dist/generated/builtins/sqrt.js.map +1 -0
- package/dist/generated/builtins/squeeze.d.ts +4 -0
- package/dist/generated/builtins/squeeze.d.ts.map +1 -0
- package/dist/generated/builtins/squeeze.js +216 -0
- package/dist/generated/builtins/squeeze.js.map +1 -0
- package/dist/generated/builtins/stairs.d.ts +4 -0
- package/dist/generated/builtins/stairs.d.ts.map +1 -0
- package/dist/generated/builtins/stairs.js +89 -0
- package/dist/generated/builtins/stairs.js.map +1 -0
- package/dist/generated/builtins/startsWith.d.ts +4 -0
- package/dist/generated/builtins/startsWith.d.ts.map +1 -0
- package/dist/generated/builtins/startsWith.js +156 -0
- package/dist/generated/builtins/startsWith.js.map +1 -0
- package/dist/generated/builtins/std.d.ts +4 -0
- package/dist/generated/builtins/std.d.ts.map +1 -0
- package/dist/generated/builtins/std.js +200 -0
- package/dist/generated/builtins/std.js.map +1 -0
- package/dist/generated/builtins/stem.d.ts +4 -0
- package/dist/generated/builtins/stem.d.ts.map +1 -0
- package/dist/generated/builtins/stem.js +96 -0
- package/dist/generated/builtins/stem.js.map +1 -0
- package/dist/generated/builtins/str2double.d.ts +4 -0
- package/dist/generated/builtins/str2double.d.ts.map +1 -0
- package/dist/generated/builtins/str2double.js +185 -0
- package/dist/generated/builtins/str2double.js.map +1 -0
- package/dist/generated/builtins/strcat.d.ts +4 -0
- package/dist/generated/builtins/strcat.d.ts.map +1 -0
- package/dist/generated/builtins/strcat.js +180 -0
- package/dist/generated/builtins/strcat.js.map +1 -0
- package/dist/generated/builtins/strcmp.d.ts +4 -0
- package/dist/generated/builtins/strcmp.d.ts.map +1 -0
- package/dist/generated/builtins/strcmp.js +169 -0
- package/dist/generated/builtins/strcmp.js.map +1 -0
- package/dist/generated/builtins/strcmpi.d.ts +4 -0
- package/dist/generated/builtins/strcmpi.d.ts.map +1 -0
- package/dist/generated/builtins/strcmpi.js +181 -0
- package/dist/generated/builtins/strcmpi.js.map +1 -0
- package/dist/generated/builtins/strfind.d.ts +4 -0
- package/dist/generated/builtins/strfind.d.ts.map +1 -0
- package/dist/generated/builtins/strfind.js +136 -0
- package/dist/generated/builtins/strfind.js.map +1 -0
- package/dist/generated/builtins/string.d.ts +4 -0
- package/dist/generated/builtins/string.d.ts.map +1 -0
- package/dist/generated/builtins/string.empty.d.ts +4 -0
- package/dist/generated/builtins/string.empty.d.ts.map +1 -0
- package/dist/generated/builtins/string.empty.js +198 -0
- package/dist/generated/builtins/string.empty.js.map +1 -0
- package/dist/generated/builtins/string.js +189 -0
- package/dist/generated/builtins/string.js.map +1 -0
- package/dist/generated/builtins/strings.d.ts +4 -0
- package/dist/generated/builtins/strings.d.ts.map +1 -0
- package/dist/generated/builtins/strings.js +188 -0
- package/dist/generated/builtins/strings.js.map +1 -0
- package/dist/generated/builtins/strip.d.ts +4 -0
- package/dist/generated/builtins/strip.d.ts.map +1 -0
- package/dist/generated/builtins/strip.js +181 -0
- package/dist/generated/builtins/strip.js.map +1 -0
- package/dist/generated/builtins/strlength.d.ts +4 -0
- package/dist/generated/builtins/strlength.d.ts.map +1 -0
- package/dist/generated/builtins/strlength.js +174 -0
- package/dist/generated/builtins/strlength.js.map +1 -0
- package/dist/generated/builtins/strncmp.d.ts +4 -0
- package/dist/generated/builtins/strncmp.d.ts.map +1 -0
- package/dist/generated/builtins/strncmp.js +169 -0
- package/dist/generated/builtins/strncmp.js.map +1 -0
- package/dist/generated/builtins/strrep.d.ts +4 -0
- package/dist/generated/builtins/strrep.d.ts.map +1 -0
- package/dist/generated/builtins/strrep.js +193 -0
- package/dist/generated/builtins/strrep.js.map +1 -0
- package/dist/generated/builtins/strtrim.d.ts +4 -0
- package/dist/generated/builtins/strtrim.d.ts.map +1 -0
- package/dist/generated/builtins/strtrim.js +180 -0
- package/dist/generated/builtins/strtrim.js.map +1 -0
- package/dist/generated/builtins/struct.d.ts +4 -0
- package/dist/generated/builtins/struct.d.ts.map +1 -0
- package/dist/generated/builtins/struct.js +149 -0
- package/dist/generated/builtins/struct.js.map +1 -0
- package/dist/generated/builtins/sub2ind.d.ts +4 -0
- package/dist/generated/builtins/sub2ind.d.ts.map +1 -0
- package/dist/generated/builtins/sub2ind.js +157 -0
- package/dist/generated/builtins/sub2ind.js.map +1 -0
- package/dist/generated/builtins/subplot.d.ts +4 -0
- package/dist/generated/builtins/subplot.d.ts.map +1 -0
- package/dist/generated/builtins/subplot.js +70 -0
- package/dist/generated/builtins/subplot.js.map +1 -0
- package/dist/generated/builtins/sum.d.ts +4 -0
- package/dist/generated/builtins/sum.d.ts.map +1 -0
- package/dist/generated/builtins/sum.js +192 -0
- package/dist/generated/builtins/sum.js.map +1 -0
- package/dist/generated/builtins/surf.d.ts +4 -0
- package/dist/generated/builtins/surf.d.ts.map +1 -0
- package/dist/generated/builtins/surf.js +105 -0
- package/dist/generated/builtins/surf.js.map +1 -0
- package/dist/generated/builtins/surfc.d.ts +4 -0
- package/dist/generated/builtins/surfc.d.ts.map +1 -0
- package/dist/generated/builtins/surfc.js +90 -0
- package/dist/generated/builtins/surfc.js.map +1 -0
- package/dist/generated/builtins/svd.d.ts +4 -0
- package/dist/generated/builtins/svd.d.ts.map +1 -0
- package/dist/generated/builtins/svd.js +150 -0
- package/dist/generated/builtins/svd.js.map +1 -0
- package/dist/generated/builtins/symrcm.d.ts +4 -0
- package/dist/generated/builtins/symrcm.d.ts.map +1 -0
- package/dist/generated/builtins/symrcm.js +134 -0
- package/dist/generated/builtins/symrcm.js.map +1 -0
- package/dist/generated/builtins/tan.d.ts +4 -0
- package/dist/generated/builtins/tan.d.ts.map +1 -0
- package/dist/generated/builtins/tan.js +200 -0
- package/dist/generated/builtins/tan.js.map +1 -0
- package/dist/generated/builtins/tanh.d.ts +4 -0
- package/dist/generated/builtins/tanh.d.ts.map +1 -0
- package/dist/generated/builtins/tanh.js +193 -0
- package/dist/generated/builtins/tanh.js.map +1 -0
- package/dist/generated/builtins/tcpclient.d.ts +4 -0
- package/dist/generated/builtins/tcpclient.d.ts.map +1 -0
- package/dist/generated/builtins/tcpclient.js +146 -0
- package/dist/generated/builtins/tcpclient.js.map +1 -0
- package/dist/generated/builtins/tcpserver.d.ts +4 -0
- package/dist/generated/builtins/tcpserver.d.ts.map +1 -0
- package/dist/generated/builtins/tcpserver.js +177 -0
- package/dist/generated/builtins/tcpserver.js.map +1 -0
- package/dist/generated/builtins/tempdir.d.ts +4 -0
- package/dist/generated/builtins/tempdir.d.ts.map +1 -0
- package/dist/generated/builtins/tempdir.js +212 -0
- package/dist/generated/builtins/tempdir.js.map +1 -0
- package/dist/generated/builtins/tempname.d.ts +4 -0
- package/dist/generated/builtins/tempname.d.ts.map +1 -0
- package/dist/generated/builtins/tempname.js +212 -0
- package/dist/generated/builtins/tempname.js.map +1 -0
- package/dist/generated/builtins/tic.d.ts +4 -0
- package/dist/generated/builtins/tic.d.ts.map +1 -0
- package/dist/generated/builtins/tic.js +110 -0
- package/dist/generated/builtins/tic.js.map +1 -0
- package/dist/generated/builtins/timeit.d.ts +4 -0
- package/dist/generated/builtins/timeit.d.ts.map +1 -0
- package/dist/generated/builtins/timeit.js +143 -0
- package/dist/generated/builtins/timeit.js.map +1 -0
- package/dist/generated/builtins/times.d.ts +4 -0
- package/dist/generated/builtins/times.d.ts.map +1 -0
- package/dist/generated/builtins/times.js +253 -0
- package/dist/generated/builtins/times.js.map +1 -0
- package/dist/generated/builtins/toc.d.ts +4 -0
- package/dist/generated/builtins/toc.d.ts.map +1 -0
- package/dist/generated/builtins/toc.js +118 -0
- package/dist/generated/builtins/toc.js.map +1 -0
- package/dist/generated/builtins/trace.d.ts +4 -0
- package/dist/generated/builtins/trace.d.ts.map +1 -0
- package/dist/generated/builtins/trace.js +184 -0
- package/dist/generated/builtins/trace.js.map +1 -0
- package/dist/generated/builtins/transpose.d.ts +4 -0
- package/dist/generated/builtins/transpose.d.ts.map +1 -0
- package/dist/generated/builtins/transpose.js +179 -0
- package/dist/generated/builtins/transpose.js.map +1 -0
- package/dist/generated/builtins/tril.d.ts +4 -0
- package/dist/generated/builtins/tril.d.ts.map +1 -0
- package/dist/generated/builtins/tril.js +186 -0
- package/dist/generated/builtins/tril.js.map +1 -0
- package/dist/generated/builtins/triu.d.ts +4 -0
- package/dist/generated/builtins/triu.d.ts.map +1 -0
- package/dist/generated/builtins/triu.js +185 -0
- package/dist/generated/builtins/triu.js.map +1 -0
- package/dist/generated/builtins/true.d.ts +4 -0
- package/dist/generated/builtins/true.d.ts.map +1 -0
- package/dist/generated/builtins/true.js +163 -0
- package/dist/generated/builtins/true.js.map +1 -0
- package/dist/generated/builtins/union.d.ts +4 -0
- package/dist/generated/builtins/union.d.ts.map +1 -0
- package/dist/generated/builtins/union.js +168 -0
- package/dist/generated/builtins/union.js.map +1 -0
- package/dist/generated/builtins/unique.d.ts +4 -0
- package/dist/generated/builtins/unique.d.ts.map +1 -0
- package/dist/generated/builtins/unique.js +192 -0
- package/dist/generated/builtins/unique.js.map +1 -0
- package/dist/generated/builtins/upper.d.ts +4 -0
- package/dist/generated/builtins/upper.d.ts.map +1 -0
- package/dist/generated/builtins/upper.js +179 -0
- package/dist/generated/builtins/upper.js.map +1 -0
- package/dist/generated/builtins/var.d.ts +4 -0
- package/dist/generated/builtins/var.d.ts.map +1 -0
- package/dist/generated/builtins/var.js +193 -0
- package/dist/generated/builtins/var.js.map +1 -0
- package/dist/generated/builtins/vertcat.d.ts +4 -0
- package/dist/generated/builtins/vertcat.d.ts.map +1 -0
- package/dist/generated/builtins/vertcat.js +182 -0
- package/dist/generated/builtins/vertcat.js.map +1 -0
- package/dist/generated/builtins/view.d.ts +4 -0
- package/dist/generated/builtins/view.d.ts.map +1 -0
- package/dist/generated/builtins/view.js +78 -0
- package/dist/generated/builtins/view.js.map +1 -0
- package/dist/generated/builtins/warning.d.ts +4 -0
- package/dist/generated/builtins/warning.d.ts.map +1 -0
- package/dist/generated/builtins/warning.js +159 -0
- package/dist/generated/builtins/warning.js.map +1 -0
- package/dist/generated/builtins/weboptions.d.ts +4 -0
- package/dist/generated/builtins/weboptions.d.ts.map +1 -0
- package/dist/generated/builtins/weboptions.js +139 -0
- package/dist/generated/builtins/weboptions.js.map +1 -0
- package/dist/generated/builtins/webread.d.ts +4 -0
- package/dist/generated/builtins/webread.d.ts.map +1 -0
- package/dist/generated/builtins/webread.js +153 -0
- package/dist/generated/builtins/webread.js.map +1 -0
- package/dist/generated/builtins/webwrite.d.ts +4 -0
- package/dist/generated/builtins/webwrite.d.ts.map +1 -0
- package/dist/generated/builtins/webwrite.js +155 -0
- package/dist/generated/builtins/webwrite.js.map +1 -0
- package/dist/generated/builtins/which.d.ts +4 -0
- package/dist/generated/builtins/which.d.ts.map +1 -0
- package/dist/generated/builtins/which.js +171 -0
- package/dist/generated/builtins/which.js.map +1 -0
- package/dist/generated/builtins/who.d.ts +4 -0
- package/dist/generated/builtins/who.d.ts.map +1 -0
- package/dist/generated/builtins/who.js +154 -0
- package/dist/generated/builtins/who.js.map +1 -0
- package/dist/generated/builtins/whos.d.ts +4 -0
- package/dist/generated/builtins/whos.d.ts.map +1 -0
- package/dist/generated/builtins/whos.js +171 -0
- package/dist/generated/builtins/whos.js.map +1 -0
- package/dist/generated/builtins/write.d.ts +4 -0
- package/dist/generated/builtins/write.d.ts.map +1 -0
- package/dist/generated/builtins/write.js +130 -0
- package/dist/generated/builtins/write.js.map +1 -0
- package/dist/generated/builtins/writematrix.d.ts +4 -0
- package/dist/generated/builtins/writematrix.d.ts.map +1 -0
- package/dist/generated/builtins/writematrix.js +161 -0
- package/dist/generated/builtins/writematrix.js.map +1 -0
- package/dist/generated/builtins/xor.d.ts +4 -0
- package/dist/generated/builtins/xor.d.ts.map +1 -0
- package/dist/generated/builtins/xor.js +148 -0
- package/dist/generated/builtins/xor.js.map +1 -0
- package/dist/generated/builtins/zeros.d.ts +4 -0
- package/dist/generated/builtins/zeros.d.ts.map +1 -0
- package/dist/generated/builtins/zeros.js +191 -0
- package/dist/generated/builtins/zeros.js.map +1 -0
- package/dist/generated/builtins/zlabel.d.ts +4 -0
- package/dist/generated/builtins/zlabel.d.ts.map +1 -0
- package/dist/generated/builtins/zlabel.js +72 -0
- package/dist/generated/builtins/zlabel.js.map +1 -0
- package/dist/generated/builtins-manifest.d.ts +5 -0
- package/dist/generated/builtins-manifest.d.ts.map +1 -0
- package/dist/generated/builtins-manifest.js +6801 -0
- package/dist/generated/builtins-manifest.js.map +1 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/lsp/runmat_lsp.d.ts +2 -2
- package/dist/lsp/runmat_lsp.js +4 -4
- package/dist/lsp/runmat_lsp_bg.wasm +0 -0
- package/dist/lsp/runmat_lsp_bg.wasm.d.ts +2 -2
- package/dist/pkg-web/runmat_wasm_web.d.ts +4 -4
- package/dist/pkg-web/runmat_wasm_web.js +10 -10
- package/dist/pkg-web/runmat_wasm_web_bg.wasm +0 -0
- package/dist/pkg-web/runmat_wasm_web_bg.wasm.d.ts +4 -4
- package/dist/runtime/stdlib.snapshot +0 -0
- package/package.json +7 -2
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @generated by scripts/generate-builtins.cjs
|
|
2
|
+
// Do not edit by hand.
|
|
3
|
+
export const builtinExamplesCatalog = [{ "id": "abs:1", "builtinKey": "abs", "builtinTitle": "abs", "builtinSlug": "abs", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Getting the absolute value of a scalar", "summary": "Absolute value or magnitude of scalars, vectors, matrices, or N-D tensors.", "code": "y = abs(-42)", "output": "y = 42", "keywords": ["abs", "absolute value", "magnitude", "complex", "gpu"], "suggestedPath": "/abs-1.m" }, { "id": "abs:2", "builtinKey": "abs", "builtinTitle": "abs", "builtinSlug": "abs", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Taking the absolute value of a vector", "summary": "Absolute value or magnitude of scalars, vectors, matrices, or N-D tensors.", "code": "v = [-2 -1 0 1 2];\nresult = abs(v)", "output": "result = [2 1 0 1 2]", "keywords": ["abs", "absolute value", "magnitude", "complex", "gpu"], "suggestedPath": "/abs-2.m" }, { "id": "abs:3", "builtinKey": "abs", "builtinTitle": "abs", "builtinSlug": "abs", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Measuring complex magnitudes", "summary": "Absolute value or magnitude of scalars, vectors, matrices, or N-D tensors.", "code": "z = [3+4i, 1-1i];\nmagnitudes = abs(z)", "output": "magnitudes = [5 1.4142]", "keywords": ["abs", "absolute value", "magnitude", "complex", "gpu"], "suggestedPath": "/abs-3.m" }, { "id": "abs:4", "builtinKey": "abs", "builtinTitle": "abs", "builtinSlug": "abs", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Working with matrices on the GPU", "summary": "Absolute value or magnitude of scalars, vectors, matrices, or N-D tensors.", "code": "G = randn(2048, 2048, \"gpuArray\");\npositive = abs(G)", "keywords": ["abs", "absolute value", "magnitude", "complex", "gpu"], "suggestedPath": "/abs-4.m" }, { "id": "abs:5", "builtinKey": "abs", "builtinTitle": "abs", "builtinSlug": "abs", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Using `abs` with logical arrays", "summary": "Absolute value or magnitude of scalars, vectors, matrices, or N-D tensors.", "code": "mask = logical([0 1 0; 1 0 1]);\nnumeric = abs(mask)", "output": "numeric = [0 1 0; 1 0 1]", "keywords": ["abs", "absolute value", "magnitude", "complex", "gpu"], "suggestedPath": "/abs-5.m" }, { "id": "abs:6", "builtinKey": "abs", "builtinTitle": "abs", "builtinSlug": "abs", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Converting characters to numeric codes", "summary": "Absolute value or magnitude of scalars, vectors, matrices, or N-D tensors.", "code": "c = 'ABC';\ncodes = abs(c)", "output": "codes = [65 66 67]", "keywords": ["abs", "absolute value", "magnitude", "complex", "gpu"], "suggestedPath": "/abs-6.m" }, { "id": "abs:7", "builtinKey": "abs", "builtinTitle": "abs", "builtinSlug": "abs", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Chaining `abs` inside fused expressions", "summary": "Absolute value or magnitude of scalars, vectors, matrices, or N-D tensors.", "code": "x = linspace(-2, 2, 5);\ny = abs(x) + x.^2", "keywords": ["abs", "absolute value", "magnitude", "complex", "gpu"], "suggestedPath": "/abs-7.m" }, { "id": "accept:1", "builtinKey": "accept", "builtinTitle": "accept", "builtinSlug": "accept", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Accepting a localhost client connection", "summary": "Accept a pending client connection on a TCP server.", "code": "srv = tcpserver(\"127.0.0.1\", 0);\nport = srv.ServerPort;\ntcpclient(\"127.0.0.1\", port);\nclient = accept(srv);\ndisp(client.Address)\ndisp(client.Port)", "output": "127.0.0.1\n55000 % varies per run", "keywords": ["accept", "tcpserver", "tcpclient", "socket", "networking"], "suggestedPath": "/accept-1.m" }, { "id": "accept:2", "builtinKey": "accept", "builtinTitle": "accept", "builtinSlug": "accept", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Overriding the timeout for a single accept call", "summary": "Accept a pending client connection on a TCP server.", "code": "srv = tcpserver(\"0.0.0.0\", 0, \"Timeout\", 10);\ntry\n client = accept(srv, \"Timeout\", 0.25);\ncatch err\n disp(err.identifier)\nend", "output": "RunMat:accept:Timeout", "keywords": ["accept", "tcpserver", "tcpclient", "socket", "networking"], "suggestedPath": "/accept-2.m" }, { "id": "accept:3", "builtinKey": "accept", "builtinTitle": "accept", "builtinSlug": "accept", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Inspecting connection metadata after accepting a client", "summary": "Accept a pending client connection on a TCP server.", "code": "srv = tcpserver(\"::1\", 45000);\ntcpclient(\"::1\", 45000);\nclient = accept(srv);\nfprintf(\"Remote peer %s:%d\\\\n\", client.Address, client.Port);\nfprintf(\"Byte order: %s\\\\n\", client.ByteOrder)", "output": "Remote peer ::1:51432\nByte order: little-endian", "keywords": ["accept", "tcpserver", "tcpclient", "socket", "networking"], "suggestedPath": "/accept-3.m" }, { "id": "accept:4", "builtinKey": "accept", "builtinTitle": "accept", "builtinSlug": "accept", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Handling multiple queued clients sequentially", "summary": "Accept a pending client connection on a TCP server.", "code": "srv = tcpserver(\"127.0.0.1\", 47000);\ntcpclient(\"127.0.0.1\", 47000);\ntcpclient(\"127.0.0.1\", 47000);\nclient1 = accept(srv);\nclient2 = accept(srv);\nfprintf(\"First connection from %s\\\\n\", client1.Address);\nfprintf(\"Second connection from %s\\\\n\", client2.Address)", "output": "First connection from 127.0.0.1\nSecond connection from 127.0.0.1", "keywords": ["accept", "tcpserver", "tcpclient", "socket", "networking"], "suggestedPath": "/accept-4.m" }, { "id": "accept:5", "builtinKey": "accept", "builtinTitle": "accept", "builtinSlug": "accept", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Using the returned identifier with other networking builtins", "summary": "Accept a pending client connection on a TCP server.", "code": "srv = tcpserver(\"127.0.0.1\", 52000);\ntcpclient(\"127.0.0.1\", 52000);\nclient = accept(srv);\nclientId = client.__tcpclient_id;\nfprintf(\"Opaque client identifier: %d\\\\n\", clientId)", "output": "Opaque client identifier: 42 % identifier value varies per run", "keywords": ["accept", "tcpserver", "tcpclient", "socket", "networking"], "suggestedPath": "/accept-5.m" }, { "id": "acos:1", "builtinKey": "acos", "builtinTitle": "acos", "builtinSlug": "acos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing the inverse cosine of a scalar angle", "summary": "Element-wise inverse cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "y = acos(0.5)", "output": "y = 1.0472", "keywords": ["acos", "inverse cosine", "arccos", "trigonometry", "gpu"], "suggestedPath": "/acos-1.m" }, { "id": "acos:2", "builtinKey": "acos", "builtinTitle": "acos", "builtinSlug": "acos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Handling values outside [-1, 1] that produce complex results", "summary": "Element-wise inverse cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "z = acos(2)", "output": "z = 0.0000 - 1.3170i", "keywords": ["acos", "inverse cosine", "arccos", "trigonometry", "gpu"], "suggestedPath": "/acos-2.m" }, { "id": "acos:3", "builtinKey": "acos", "builtinTitle": "acos", "builtinSlug": "acos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Applying inverse cosine to every element of a matrix", "summary": "Element-wise inverse cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "A = [0 -0.5 0.75; 1 0.25 -0.8];\nY = acos(A)", "output": "Y =\n 1.5708 2.0944 0.7227\n 0 1.3181 2.4981", "keywords": ["acos", "inverse cosine", "arccos", "trigonometry", "gpu"], "suggestedPath": "/acos-3.m" }, { "id": "acos:4", "builtinKey": "acos", "builtinTitle": "acos", "builtinSlug": "acos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Using logical input with automatic double promotion", "summary": "Element-wise inverse cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "mask = logical([0 1 0 1]);\nangles = acos(mask)", "output": "angles = [1.5708 0 1.5708 0]", "keywords": ["acos", "inverse cosine", "arccos", "trigonometry", "gpu"], "suggestedPath": "/acos-4.m" }, { "id": "acos:5", "builtinKey": "acos", "builtinTitle": "acos", "builtinSlug": "acos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Running `acos` on a GPU array without explicit transfers", "summary": "Element-wise inverse cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "G = gpuArray(linspace(-1, 1, 5));\nresult_gpu = acos(G);\nresult = gather(result_gpu)", "output": "result = [3.1416 2.0944 1.5708 1.0472 0.0000]", "keywords": ["acos", "inverse cosine", "arccos", "trigonometry", "gpu"], "suggestedPath": "/acos-5.m" }, { "id": "acos:6", "builtinKey": "acos", "builtinTitle": "acos", "builtinSlug": "acos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Evaluating inverse cosine of complex numbers", "summary": "Element-wise inverse cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "vals = [0.5 + 1i, -0.2 + 0.75i];\nw = acos(vals)", "output": "w =\n 1.2214 - 0.9261i\n 1.7307 - 0.7009i", "keywords": ["acos", "inverse cosine", "arccos", "trigonometry", "gpu"], "suggestedPath": "/acos-6.m" }, { "id": "acosh:1", "builtinKey": "acosh", "builtinTitle": "acosh", "builtinSlug": "acosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Inverse hyperbolic cosine of a scalar greater than one", "summary": "Element-wise inverse hyperbolic cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "y = acosh(1.5)", "output": "y = 0.9624", "keywords": ["acosh", "inverse hyperbolic cosine", "arccosh", "trigonometry", "gpu", "complex"], "suggestedPath": "/acosh-1.m" }, { "id": "acosh:2", "builtinKey": "acosh", "builtinTitle": "acosh", "builtinSlug": "acosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Applying `acosh` to each element of a vector", "summary": "Element-wise inverse hyperbolic cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "x = [1 1.5 2 4];\ny = acosh(x)", "output": "y = [0 0.9624 1.31696 2.06344]", "keywords": ["acosh", "inverse hyperbolic cosine", "arccosh", "trigonometry", "gpu", "complex"], "suggestedPath": "/acosh-2.m" }, { "id": "acosh:3", "builtinKey": "acosh", "builtinTitle": "acosh", "builtinSlug": "acosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Handling elements below one that produce complex results", "summary": "Element-wise inverse hyperbolic cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "values = [0.5 1 2];\nz = acosh(values)", "output": "z =\n 0.0000 + 1.0472i 0.0000 + 0.0000i 1.31696 + 0.0000i", "keywords": ["acosh", "inverse hyperbolic cosine", "arccosh", "trigonometry", "gpu", "complex"], "suggestedPath": "/acosh-3.m" }, { "id": "acosh:4", "builtinKey": "acosh", "builtinTitle": "acosh", "builtinSlug": "acosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing `acosh` on GPU-resident data when the domain stays real", "summary": "Element-wise inverse hyperbolic cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "G = gpuArray(linspace(1, 5, 5));\nresult_gpu = acosh(G);\nresult = gather(result_gpu)", "output": "result = [0 1.31696 1.76274 2.06344 2.29243]", "keywords": ["acosh", "inverse hyperbolic cosine", "arccosh", "trigonometry", "gpu", "complex"], "suggestedPath": "/acosh-4.m" }, { "id": "acosh:5", "builtinKey": "acosh", "builtinTitle": "acosh", "builtinSlug": "acosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Evaluating `acosh` for complex numbers", "summary": "Element-wise inverse hyperbolic cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "z = [1 + 2i, -2 + 0.5i];\nw = acosh(z)", "output": "w =\n 1.5286 + 1.1437i\n 1.3618 + 2.8638i", "keywords": ["acosh", "inverse hyperbolic cosine", "arccosh", "trigonometry", "gpu", "complex"], "suggestedPath": "/acosh-5.m" }, { "id": "acosh:6", "builtinKey": "acosh", "builtinTitle": "acosh", "builtinSlug": "acosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Working with character arrays (mix of complex and real results)", "summary": "Element-wise inverse hyperbolic cosine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "C = char([0 65]); % includes a code point below 1\nY = acosh(C)", "output": "Y =\n 0.0000 + 1.5708i 4.8675 + 0.0000i", "keywords": ["acosh", "inverse hyperbolic cosine", "arccosh", "trigonometry", "gpu", "complex"], "suggestedPath": "/acosh-6.m" }, { "id": "addpath:1", "builtinKey": "addpath", "builtinTitle": "addpath", "builtinSlug": "addpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Add a single folder to the top of the search path", "summary": "Add folders to the MATLAB search path used by RunMat.", "code": "mkdir(\"util/toolbox\");\noldPath = path();\naddpath(\"util/toolbox\");\nnewPath = path();\ncount = fprintf('%s %s\\n', oldPath, newPath);", "output": " /util/toolbox", "keywords": ["addpath", "search path", "matlab path", "-begin", "-end", "-frozen"], "suggestedPath": "/addpath-1.m" }, { "id": "addpath:2", "builtinKey": "addpath", "builtinTitle": "addpath", "builtinSlug": "addpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Append folders to the end of the search path", "summary": "Add folders to the MATLAB search path used by RunMat.", "code": "mkdir(\"shared/filters\");\nmkdir(\"shared/signal\");\noldPath = path();\ndirs = [\"shared/filters\", \"shared/signal\"];\naddpath(dirs, \"-end\");\nnewPath = path();\ncount = fprintf('%s %s\\n', oldPath, newPath);", "output": " /shared/filters:/shared/signal", "keywords": ["addpath", "search path", "matlab path", "-begin", "-end", "-frozen"], "suggestedPath": "/addpath-2.m" }, { "id": "addpath:3", "builtinKey": "addpath", "builtinTitle": "addpath", "builtinSlug": "addpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use `genpath` output to add a folder tree", "summary": "Add folders to the MATLAB search path used by RunMat.", "code": "mkdir(\"third_party/toolchain\");\nmkdir(\"third_party/toolchain/bin\");\noldPath = path();\ntoolchain = genpath(\"third_party/toolchain\");\naddpath(toolchain);\nnewPath = path();\ncount = fprintf('%s %s\\n', oldPath, newPath);", "output": " /third_party/toolchain:/third_party/toolchain/bin", "keywords": ["addpath", "search path", "matlab path", "-begin", "-end", "-frozen"], "suggestedPath": "/addpath-3.m" }, { "id": "addpath:4", "builtinKey": "addpath", "builtinTitle": "addpath", "builtinSlug": "addpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Add folders from a cell array", "summary": "Add folders to the MATLAB search path used by RunMat.", "code": "mkdir(\"src/algorithms\");\nmkdir(\"src/visualization\");\noldPath = path();\nfolders = [\"src/algorithms\", \"src/visualization\"];\naddpath(folders, \"-begin\");\nnewPath = path();\ncount = fprintf('%s %s\\n', oldPath, newPath);", "output": " /src/algorithms:/src/visualization", "keywords": ["addpath", "search path", "matlab path", "-begin", "-end", "-frozen"], "suggestedPath": "/addpath-4.m" }, { "id": "addpath:5", "builtinKey": "addpath", "builtinTitle": "addpath", "builtinSlug": "addpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Move an existing folder to the top of the search path", "summary": "Add folders to the MATLAB search path used by RunMat.", "code": "mkdir(\"src/algorithms\");\noldPath = path();\naddpath(\"src/algorithms\");\nnewPath = path();\ncount = fprintf('%s %s\\n', oldPath, newPath);", "output": " /src/algorithms", "keywords": ["addpath", "search path", "matlab path", "-begin", "-end", "-frozen"], "suggestedPath": "/addpath-5.m" }, { "id": "addpath:6", "builtinKey": "addpath", "builtinTitle": "addpath", "builtinSlug": "addpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Accept the MATLAB `-frozen` flag", "summary": "Add folders to the MATLAB search path used by RunMat.", "code": "mkdir(\"vendor/hardware\");\noldPath = path();\naddpath(\"vendor/hardware\", \"-frozen\");\nnewPath = path();\ncount = fprintf('%s %s\\n', oldPath, newPath);", "output": " /vendor/hardware", "keywords": ["addpath", "search path", "matlab path", "-begin", "-end", "-frozen"], "suggestedPath": "/addpath-6.m" }, { "id": "addpath:7", "builtinKey": "addpath", "builtinTitle": "addpath", "builtinSlug": "addpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Retrieve the previous path and restore it later", "summary": "Add folders to the MATLAB search path used by RunMat.", "code": "mkdir(\"analysis/utilities\");\noldPath = path();\nold = addpath(\"analysis/utilities\");\nnewPath = path();\npath(old);\ncount = fprintf('%s %s\\n', oldPath, newPath);", "output": " /analysis/utilities", "keywords": ["addpath", "search path", "matlab path", "-begin", "-end", "-frozen"], "suggestedPath": "/addpath-7.m" }, { "id": "addpath:8", "builtinKey": "addpath", "builtinTitle": "addpath", "builtinSlug": "addpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Combine multiple options", "summary": "Add folders to the MATLAB search path used by RunMat.", "code": "mkdir(\"contrib\");\nmkdir(\"docs/examples\");\noldPath = path();\naddpath(\"contrib\", \"docs/examples\", \"-end\", \"-frozen\");\nnewPath = path();\ncount = fprintf('%s %s\\n', oldPath, newPath);", "output": " /contrib:/docs/examples", "keywords": ["addpath", "search path", "matlab path", "-begin", "-end", "-frozen"], "suggestedPath": "/addpath-8.m" }, { "id": "all:1", "builtinKey": "all", "builtinTitle": "all", "builtinSlug": "all", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Checking if every column is nonzero", "summary": "Check whether every element of an array slice is nonzero with MATLAB-compatible semantics.", "code": "A = [1 2 3; 4 5 6];\ncolAllNonZero = all(A)", "output": "colAllNonZero = [1 1 1]", "keywords": ["all", "logical reduction", "omitnan", "gpu", "vectorization"], "suggestedPath": "/all-1.m" }, { "id": "all:2", "builtinKey": "all", "builtinTitle": "all", "builtinSlug": "all", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Verifying that each row contains only nonzero values", "summary": "Check whether every element of an array slice is nonzero with MATLAB-compatible semantics.", "code": "B = [1 0 3; 4 5 6; 0 7 8];\nrowAllNonZero = all(B, 2)", "output": "rowAllNonZero = [0; 1; 0]", "keywords": ["all", "logical reduction", "omitnan", "gpu", "vectorization"], "suggestedPath": "/all-2.m" }, { "id": "all:3", "builtinKey": "all", "builtinTitle": "all", "builtinSlug": "all", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Collapsing multiple dimensions with `vecdim`", "summary": "Check whether every element of an array slice is nonzero with MATLAB-compatible semantics.", "code": "C = reshape(1:24, [3 4 2]);\nallAlongDims = reshape(all(C > 0, [1 2]), 1, 2)", "output": "1 1", "keywords": ["all", "logical reduction", "omitnan", "gpu", "vectorization"], "suggestedPath": "/all-3.m" }, { "id": "all:4", "builtinKey": "all", "builtinTitle": "all", "builtinSlug": "all", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Reducing all elements to a single logical scalar", "summary": "Check whether every element of an array slice is nonzero with MATLAB-compatible semantics.", "code": "D = [2 4; 6 8];\neverythingNonZero = all(D, 'all')", "output": "everythingNonZero = true", "keywords": ["all", "logical reduction", "omitnan", "gpu", "vectorization"], "suggestedPath": "/all-4.m" }, { "id": "all:5", "builtinKey": "all", "builtinTitle": "all", "builtinSlug": "all", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring `NaN` values while testing slices", "summary": "Check whether every element of an array slice is nonzero with MATLAB-compatible semantics.", "code": "E = [NaN 1 2; NaN 0 3];\nwithNaN = all(E); % returns [1 0 1]\nignoringNaN = all(E, 'omitnan'); % returns [1 0 1]\ndisp(withNaN);\ndisp(ignoringNaN)", "output": "1 0 1\n1 0 1", "keywords": ["all", "logical reduction", "omitnan", "gpu", "vectorization"], "suggestedPath": "/all-5.m" }, { "id": "all:6", "builtinKey": "all", "builtinTitle": "all", "builtinSlug": "all", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Evaluating `all` on GPU arrays", "summary": "Check whether every element of an array slice is nonzero with MATLAB-compatible semantics.", "code": "G = gpuArray([1 1 1; 1 1 1]);\ngpuResult = all(G, 2); % RunMat returns a host logical array\ndisp(gpuResult)", "output": "1\n1", "keywords": ["all", "logical reduction", "omitnan", "gpu", "vectorization"], "suggestedPath": "/all-6.m" }, { "id": "all:7", "builtinKey": "all", "builtinTitle": "all", "builtinSlug": "all", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Testing `all` with character arrays", "summary": "Check whether every element of an array slice is nonzero with MATLAB-compatible semantics.", "code": "chars = ['a' 0 'c'];\nallPrintable = all(chars);\ndisp(allPrintable)", "output": "0", "keywords": ["all", "logical reduction", "omitnan", "gpu", "vectorization"], "suggestedPath": "/all-7.m" }, { "id": "and:1", "builtinKey": "and", "builtinTitle": "and", "builtinSlug": "and", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Check if two logical scalars are both true", "summary": "Element-wise logical AND for scalars, arrays, and gpuArray values.", "code": "result = and(true, false)", "output": "result =\n 0", "keywords": ["logical and", "elementwise and", "boolean and", "MATLAB and", "gpuArray and"], "suggestedPath": "/and-1.m" }, { "id": "and:2", "builtinKey": "and", "builtinTitle": "and", "builtinSlug": "and", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Combine numeric arrays element-wise with logical AND", "summary": "Element-wise logical AND for scalars, arrays, and gpuArray values.", "code": "A = [1 0 2 0];\nB = [3 4 0 0];\nC = and(A, B)", "output": "C =\n 1×4 logical array\n 1 0 0 0", "keywords": ["logical and", "elementwise and", "boolean and", "MATLAB and", "gpuArray and"], "suggestedPath": "/and-2.m" }, { "id": "and:3", "builtinKey": "and", "builtinTitle": "and", "builtinSlug": "and", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Apply logical AND with automatic scalar expansion", "summary": "Element-wise logical AND for scalars, arrays, and gpuArray values.", "code": "mask = [1; 0; 3; 0];\nflag = and(mask, 5)", "output": "flag =\n 4×1 logical array\n 1\n 0\n 1\n 0", "keywords": ["logical and", "elementwise and", "boolean and", "MATLAB and", "gpuArray and"], "suggestedPath": "/and-3.m" }, { "id": "and:4", "builtinKey": "and", "builtinTitle": "and", "builtinSlug": "and", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Use logical AND with character arrays", "summary": "Element-wise logical AND for scalars, arrays, and gpuArray values.", "code": "lhs = ['R' 'u' 'n'];\nrhs = ['R' 'u' 0];\nmatch = and(lhs, rhs)", "output": "match =\n 1×3 logical array\n 1 1 0", "keywords": ["logical and", "elementwise and", "boolean and", "MATLAB and", "gpuArray and"], "suggestedPath": "/and-4.m" }, { "id": "and:5", "builtinKey": "and", "builtinTitle": "and", "builtinSlug": "and", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Run logical AND directly on the GPU", "summary": "Element-wise logical AND for scalars, arrays, and gpuArray values.", "code": "G1 = gpuArray([0 2 0 4]);\nG2 = gpuArray([1 0 3 4]);\ndeviceResult = and(G1, G2)\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1×4 gpuArray logical array\n 0 0 0 1\nhostResult =\n 1×4 logical array\n 0 0 0 1", "keywords": ["logical and", "elementwise and", "boolean and", "MATLAB and", "gpuArray and"], "suggestedPath": "/and-5.m" }, { "id": "angle:1", "builtinKey": "angle", "builtinTitle": "angle", "builtinSlug": "angle", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Computing the phase of a complex scalar", "summary": "Phase angle of scalars, vectors, matrices, or N-D tensors.", "code": "z = 3 + 4i;\ntheta = angle(z);\ndisp(theta)", "output": "theta = 0.9273", "keywords": ["angle", "phase", "argument", "complex", "gpu"], "suggestedPath": "/angle-1.m" }, { "id": "angle:2", "builtinKey": "angle", "builtinTitle": "angle", "builtinSlug": "angle", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Extracting angles from a complex vector", "summary": "Phase angle of scalars, vectors, matrices, or N-D tensors.", "code": "Z = [1+1i, -1+1i, -1-1i, 1-1i];\nphases = angle(Z);\ndisp(phases)", "output": "phases = [0.7854 2.3562 -2.3562 -0.7854]", "keywords": ["angle", "phase", "argument", "complex", "gpu"], "suggestedPath": "/angle-2.m" }, { "id": "angle:3", "builtinKey": "angle", "builtinTitle": "angle", "builtinSlug": "angle", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Determining angles of negative real numbers", "summary": "Phase angle of scalars, vectors, matrices, or N-D tensors.", "code": "vals = [-2 -1 0 1 2];\nphi = angle(vals);\ndisp(phi)", "output": "phi = [3.1416 3.1416 0 0 0]", "keywords": ["angle", "phase", "argument", "complex", "gpu"], "suggestedPath": "/angle-3.m" }, { "id": "angle:4", "builtinKey": "angle", "builtinTitle": "angle", "builtinSlug": "angle", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Working with GPU-resident arrays", "summary": "Phase angle of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray([1 -1; -1 1]);\ntheta = angle(gather(G));\ndisp(theta)", "output": "theta =\n\n 0.0000 3.1416\n 3.1416 0.0000", "keywords": ["angle", "phase", "argument", "complex", "gpu"], "suggestedPath": "/angle-4.m" }, { "id": "angle:5", "builtinKey": "angle", "builtinTitle": "angle", "builtinSlug": "angle", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Angles of character code arrays", "summary": "Phase angle of scalars, vectors, matrices, or N-D tensors.", "code": "C = ['A' 'B'; 'C' 'D'];\ncodes = angle(C);\ndisp(codes)", "output": "codes = [0 0; 0 0]", "keywords": ["angle", "phase", "argument", "complex", "gpu"], "suggestedPath": "/angle-5.m" }, { "id": "angle:6", "builtinKey": "angle", "builtinTitle": "angle", "builtinSlug": "angle", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Angles from logical masks", "summary": "Phase angle of scalars, vectors, matrices, or N-D tensors.", "code": "mask = logical([0 1; 1 0]);\nphaseMask = angle(mask);\ndisp(phaseMask)", "output": "phaseMask = [0 0; 0 0]", "keywords": ["angle", "phase", "argument", "complex", "gpu"], "suggestedPath": "/angle-6.m" }, { "id": "any:1", "builtinKey": "any", "builtinTitle": "any", "builtinSlug": "any", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Checking if any column in a matrix is nonzero", "summary": "Test whether any element of an array is nonzero with MATLAB-compatible options.", "code": "A = [0 2 0; 0 0 0];\ncolHasData = any(A)", "output": "colHasData = [0 1 0]", "keywords": ["any", "logical reduction", "omitnan", "all", "gpu"], "suggestedPath": "/any-1.m" }, { "id": "any:2", "builtinKey": "any", "builtinTitle": "any", "builtinSlug": "any", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Detecting whether any row contains a nonzero entry", "summary": "Test whether any element of an array is nonzero with MATLAB-compatible options.", "code": "B = [0 4 0; 1 0 0; 0 0 0];\nrowHasData = any(B, 2)", "output": "rowHasData = [1; 1; 0]", "keywords": ["any", "logical reduction", "omitnan", "all", "gpu"], "suggestedPath": "/any-2.m" }, { "id": "any:3", "builtinKey": "any", "builtinTitle": "any", "builtinSlug": "any", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Reducing across multiple dimensions with `vecdim`", "summary": "Test whether any element of an array is nonzero with MATLAB-compatible options.", "code": "C = reshape(1:24, [3 4 2]);\nhasValues = reshape(any(C > 20, [1 2]), 1, 2)", "output": "0 1", "keywords": ["any", "logical reduction", "omitnan", "all", "gpu"], "suggestedPath": "/any-3.m" }, { "id": "any:4", "builtinKey": "any", "builtinTitle": "any", "builtinSlug": "any", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Checking all elements with the `'all'` option", "summary": "Test whether any element of an array is nonzero with MATLAB-compatible options.", "code": "D = [0 0; 0 5];\nanyNonZero = any(D, 'all')", "output": "anyNonZero = true", "keywords": ["any", "logical reduction", "omitnan", "all", "gpu"], "suggestedPath": "/any-4.m" }, { "id": "any:5", "builtinKey": "any", "builtinTitle": "any", "builtinSlug": "any", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring `NaN` values when probing slices", "summary": "Test whether any element of an array is nonzero with MATLAB-compatible options.", "code": "E = [NaN 0 0; 0 0 0];\nwithNaN = any(E); % returns [1 0 0]\nignoringNaN = any(E, 'omitnan'); % returns [0 0 0]\ndisp(withNaN);\ndisp(ignoringNaN)", "output": " 1 0 0\n 0 0 0", "keywords": ["any", "logical reduction", "omitnan", "all", "gpu"], "suggestedPath": "/any-5.m" }, { "id": "any:6", "builtinKey": "any", "builtinTitle": "any", "builtinSlug": "any", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Running `any` on GPU arrays with automatic fallback", "summary": "Test whether any element of an array is nonzero with MATLAB-compatible options.", "code": "G = gpuArray([0 1 0; 0 0 0]);\ngpuResult = any(G, 2);\nhostResult = gather(gpuResult);\ndisp(hostResult)", "output": "1\n0", "keywords": ["any", "logical reduction", "omitnan", "all", "gpu"], "suggestedPath": "/any-6.m" }, { "id": "any:7", "builtinKey": "any", "builtinTitle": "any", "builtinSlug": "any", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Evaluating `any` on character data", "summary": "Test whether any element of an array is nonzero with MATLAB-compatible options.", "code": "chars = ['a' 0 'c'];\nhasPrintable = any(chars)", "output": "hasPrintable = 1", "keywords": ["any", "logical reduction", "omitnan", "all", "gpu"], "suggestedPath": "/any-7.m" }, { "id": "area:1", "builtinKey": "area", "builtinTitle": "area", "builtinSlug": "area", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a basic filled area plot", "summary": "Create filled area plots for cumulative totals, stacked series, and MATLAB `area` workflows.", "code": "x = 0:0.1:1;\narea(x, x.^2);", "keywords": ["area", "area plot", "filled area chart", "stacked area chart", "matlab area", "cumulative area visualization"], "suggestedPath": "/area-1.m" }, { "id": "area:2", "builtinKey": "area", "builtinTitle": "area", "builtinSlug": "area", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create stacked area series from a matrix", "summary": "Create filled area plots for cumulative totals, stacked series, and MATLAB `area` workflows.", "code": "x = 1:5;\nY = [1 2 1; 2 1 2; 3 2 1; 2 3 2; 1 2 3];\narea(x, Y);", "keywords": ["area", "area plot", "filled area chart", "stacked area chart", "matlab area", "cumulative area visualization"], "suggestedPath": "/area-2.m" }, { "id": "area:3", "builtinKey": "area", "builtinTitle": "area", "builtinSlug": "area", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Change the baseline and label the series through the handle", "summary": "Create filled area plots for cumulative totals, stacked series, and MATLAB `area` workflows.", "code": "x = 0:0.2:2;\nh = area(x, sin(x) + 2);\nset(h, 'BaseValue', 1, 'DisplayName', 'offset area');\nlegend;", "keywords": ["area", "area plot", "filled area chart", "stacked area chart", "matlab area", "cumulative area visualization"], "suggestedPath": "/area-3.m" }, { "id": "argsort:1", "builtinKey": "argsort", "builtinTitle": "argsort", "builtinSlug": "argsort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Getting indices that sort a vector", "summary": "Return the permutation indices that would sort tensors along a dimension.", "code": "A = [4; 1; 3];\nidx = argsort(A)", "output": "idx =\n 2\n 3\n 1", "keywords": ["argsort", "sort", "indices", "permutation", "gpu"], "suggestedPath": "/argsort-1.m" }, { "id": "argsort:2", "builtinKey": "argsort", "builtinTitle": "argsort", "builtinSlug": "argsort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Reordering data with the permutation indices", "summary": "Return the permutation indices that would sort tensors along a dimension.", "code": "A = [3 9 1 5];\nidx = argsort(A);\nsorted = A(idx)", "output": "sorted =\n 1 3 5 9", "keywords": ["argsort", "sort", "indices", "permutation", "gpu"], "suggestedPath": "/argsort-2.m" }, { "id": "argsort:3", "builtinKey": "argsort", "builtinTitle": "argsort", "builtinSlug": "argsort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting along a specific dimension", "summary": "Return the permutation indices that would sort tensors along a dimension.", "code": "A = [1 6 4; 2 3 5];\nidx = argsort(A, 2)", "output": "idx =\n 1 3 2\n 1 2 3", "keywords": ["argsort", "sort", "indices", "permutation", "gpu"], "suggestedPath": "/argsort-3.m" }, { "id": "argsort:4", "builtinKey": "argsort", "builtinTitle": "argsort", "builtinSlug": "argsort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Descending order permutations", "summary": "Return the permutation indices that would sort tensors along a dimension.", "code": "A = [10 4 7 9];\nidx = argsort(A, 'descend')", "output": "idx =\n 1 4 3 2", "keywords": ["argsort", "sort", "indices", "permutation", "gpu"], "suggestedPath": "/argsort-4.m" }, { "id": "argsort:5", "builtinKey": "argsort", "builtinTitle": "argsort", "builtinSlug": "argsort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Using `ComparisonMethod` to sort by magnitude", "summary": "Return the permutation indices that would sort tensors along a dimension.", "code": "A = [-8 -1 3 -2];\nidx = argsort(A, 'ComparisonMethod', 'abs')", "output": "idx =\n 2 4 3 1", "keywords": ["argsort", "sort", "indices", "permutation", "gpu"], "suggestedPath": "/argsort-5.m" }, { "id": "argsort:6", "builtinKey": "argsort", "builtinTitle": "argsort", "builtinSlug": "argsort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Handling NaN values during permutation", "summary": "Return the permutation indices that would sort tensors along a dimension.", "code": "A = [NaN 4 1 2];\nidx = argsort(A)", "output": "idx =\n 3 4 2 1", "keywords": ["argsort", "sort", "indices", "permutation", "gpu"], "suggestedPath": "/argsort-6.m" }, { "id": "argsort:7", "builtinKey": "argsort", "builtinTitle": "argsort", "builtinSlug": "argsort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Argsort on GPU tensors falls back gracefully", "summary": "Return the permutation indices that would sort tensors along a dimension.", "code": "G = gpuArray(randn(5, 1));\nidx = argsort(G)", "keywords": ["argsort", "sort", "indices", "permutation", "gpu"], "suggestedPath": "/argsort-7.m" }, { "id": "arrayfun:1", "builtinKey": "arrayfun", "builtinTitle": "arrayfun", "builtinSlug": "arrayfun", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Squaring every element of a matrix", "summary": "Apply a function to each element of array inputs, returning either a numeric array or a cell array.", "code": "A = [1 2 3; 4 5 6];\nB = arrayfun(@(x) x.^2, A)", "output": "B =\n 1 4 9\n 16 25 36", "keywords": ["arrayfun", "gpuArray", "elementwise map", "anonymous function", "uniformoutput"], "suggestedPath": "/arrayfun-1.m" }, { "id": "arrayfun:2", "builtinKey": "arrayfun", "builtinTitle": "arrayfun", "builtinSlug": "arrayfun", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Passing additional scalar parameters", "summary": "Apply a function to each element of array inputs, returning either a numeric array or a cell array.", "code": "A = [1 2 3];\noffset = 10;\nresult = arrayfun(@(x, c) x + c, A, offset)", "output": "result =\n 11 12 13", "keywords": ["arrayfun", "gpuArray", "elementwise map", "anonymous function", "uniformoutput"], "suggestedPath": "/arrayfun-2.m" }, { "id": "arrayfun:3", "builtinKey": "arrayfun", "builtinTitle": "arrayfun", "builtinSlug": "arrayfun", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Returning cells with non-uniform outputs", "summary": "Apply a function to each element of array inputs, returning either a numeric array or a cell array.", "code": "strings = [\"Run\" \"Matlab\" \"GPU\"];\nchars = arrayfun(@(s) sprintf(\"%d\", strlength(s)), strings, 'UniformOutput', false)", "output": "chars =\n 1×3 cell array\n {'3'} {'6'} {'3'}", "keywords": ["arrayfun", "gpuArray", "elementwise map", "anonymous function", "uniformoutput"], "suggestedPath": "/arrayfun-3.m" }, { "id": "arrayfun:4", "builtinKey": "arrayfun", "builtinTitle": "arrayfun", "builtinSlug": "arrayfun", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Handling errors with a custom error handler", "summary": "Apply a function to each element of array inputs, returning either a numeric array or a cell array.", "code": "vals = [-1 0 1];\nhandler = @(err, x) err.identifier;\nsafe = arrayfun(@(x) sqrt(x), vals, 'ErrorHandler', handler, 'UniformOutput', false)", "output": "safe =\n 1×3 cell array\n {[0+1i]} {[0]} {[1]}", "keywords": ["arrayfun", "gpuArray", "elementwise map", "anonymous function", "uniformoutput"], "suggestedPath": "/arrayfun-4.m" }, { "id": "arrayfun:5", "builtinKey": "arrayfun", "builtinTitle": "arrayfun", "builtinSlug": "arrayfun", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Working with `gpuArray` inputs", "summary": "Apply a function to each element of array inputs, returning either a numeric array or a cell array.", "code": "G = gpuArray(linspace(0, pi, 5));\nS = arrayfun(@sin, G);\nH = gather(S)", "output": "H =\n 0 0.7071 1.0000 0.7071 0", "keywords": ["arrayfun", "gpuArray", "elementwise map", "anonymous function", "uniformoutput"], "suggestedPath": "/arrayfun-5.m" }, { "id": "asin:1", "builtinKey": "asin", "builtinTitle": "asin", "builtinSlug": "asin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Inverse sine of a scalar angle", "summary": "Element-wise inverse sine with full MATLAB-compatible complex promotion and GPU fallbacks.", "code": "y = asin(0.5)", "output": "y = 0.5236", "keywords": ["asin", "inverse sine", "arcsin", "trigonometry", "gpu"], "suggestedPath": "/asin-1.m" }, { "id": "asin:2", "builtinKey": "asin", "builtinTitle": "asin", "builtinSlug": "asin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Inverse sine of values greater than one (complex output)", "summary": "Element-wise inverse sine with full MATLAB-compatible complex promotion and GPU fallbacks.", "code": "z = asin(1.2)", "output": "z = 1.5708 - 0.6224i", "keywords": ["asin", "inverse sine", "arcsin", "trigonometry", "gpu"], "suggestedPath": "/asin-2.m" }, { "id": "asin:3", "builtinKey": "asin", "builtinTitle": "asin", "builtinSlug": "asin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Compute arcsine of every element in a matrix", "summary": "Element-wise inverse sine with full MATLAB-compatible complex promotion and GPU fallbacks.", "code": "A = [0 -0.5 0.75; 1 0.25 -0.8];\nY = asin(A)", "output": "Y =\n 0 -0.5236 0.8481\n 1.5708 0.2527 -0.9273", "keywords": ["asin", "inverse sine", "arcsin", "trigonometry", "gpu"], "suggestedPath": "/asin-3.m" }, { "id": "asin:4", "builtinKey": "asin", "builtinTitle": "asin", "builtinSlug": "asin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Handling logical input with automatic double promotion", "summary": "Element-wise inverse sine with full MATLAB-compatible complex promotion and GPU fallbacks.", "code": "mask = logical([0 1 1 0]);\nangles = asin(mask)", "output": "angles = [0 1.5708 1.5708 0]", "keywords": ["asin", "inverse sine", "arcsin", "trigonometry", "gpu"], "suggestedPath": "/asin-4.m" }, { "id": "asin:5", "builtinKey": "asin", "builtinTitle": "asin", "builtinSlug": "asin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing `asin` on a GPU array and keeping the result on device", "summary": "Element-wise inverse sine with full MATLAB-compatible complex promotion and GPU fallbacks.", "code": "G = gpuArray(linspace(-1, 1, 5));\nresult_gpu = asin(G);\nresult = gather(result_gpu)", "output": "result = [-1.5708 -0.5236 0 0.5236 1.5708]", "keywords": ["asin", "inverse sine", "arcsin", "trigonometry", "gpu"], "suggestedPath": "/asin-5.m" }, { "id": "asin:6", "builtinKey": "asin", "builtinTitle": "asin", "builtinSlug": "asin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Evaluating inverse sine of complex numbers", "summary": "Element-wise inverse sine with full MATLAB-compatible complex promotion and GPU fallbacks.", "code": "vals = [1+2i, -0.5+0.75i];\nw = asin(vals)", "output": "w =\n 0.4271 + 1.5286i\n -0.3983 + 0.7433i", "keywords": ["asin", "inverse sine", "arcsin", "trigonometry", "gpu"], "suggestedPath": "/asin-6.m" }, { "id": "asinh:1", "builtinKey": "asinh", "builtinTitle": "asinh", "builtinSlug": "asinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Inverse hyperbolic sine of a scalar", "summary": "Element-wise inverse hyperbolic sine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "y = asinh(0.5)", "output": "y = 0.4812", "keywords": ["asinh", "inverse hyperbolic sine", "arcsinh", "trigonometry", "gpu"], "suggestedPath": "/asinh-1.m" }, { "id": "asinh:2", "builtinKey": "asinh", "builtinTitle": "asinh", "builtinSlug": "asinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Applying `asinh` to every element of a vector", "summary": "Element-wise inverse hyperbolic sine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "x = linspace(-2, 2, 5);\ny = asinh(x)", "output": "y = [-1.4436 -0.8814 0 0.8814 1.4436]", "keywords": ["asinh", "inverse hyperbolic sine", "arcsinh", "trigonometry", "gpu"], "suggestedPath": "/asinh-2.m" }, { "id": "asinh:3", "builtinKey": "asinh", "builtinTitle": "asinh", "builtinSlug": "asinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Evaluating `asinh` on a matrix", "summary": "Element-wise inverse hyperbolic sine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "A = [0 -0.5 1.0; 1.5 -2.0 3.0];\nB = asinh(A)", "output": "B =\n 0 -0.4812 0.8814\n 1.1948 -1.4436 1.8184", "keywords": ["asinh", "inverse hyperbolic sine", "arcsinh", "trigonometry", "gpu"], "suggestedPath": "/asinh-3.m" }, { "id": "asinh:4", "builtinKey": "asinh", "builtinTitle": "asinh", "builtinSlug": "asinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing `asinh` on GPU data", "summary": "Element-wise inverse hyperbolic sine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "G = gpuArray([0.25 0.5; 0.75 1.0]);\nresult_gpu = asinh(G);\nresult = gather(result_gpu)", "output": "result = [0.2475 0.4812; 0.6931 0.8814]", "keywords": ["asinh", "inverse hyperbolic sine", "arcsinh", "trigonometry", "gpu"], "suggestedPath": "/asinh-4.m" }, { "id": "asinh:5", "builtinKey": "asinh", "builtinTitle": "asinh", "builtinSlug": "asinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Handling complex arguments with `asinh`", "summary": "Element-wise inverse hyperbolic sine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "z = [1 + 2i, -0.5 + 0.75i];\nw = asinh(z)", "output": "w =\n 1.4694 + 1.0634i\n -0.6063 + 0.6822i", "keywords": ["asinh", "inverse hyperbolic sine", "arcsinh", "trigonometry", "gpu"], "suggestedPath": "/asinh-5.m" }, { "id": "asinh:6", "builtinKey": "asinh", "builtinTitle": "asinh", "builtinSlug": "asinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Using `asinh` inside fused GPU expressions", "summary": "Element-wise inverse hyperbolic sine with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "G = gpuArray(rand(1024, 1));\nY = sinh(G) + asinh(G)", "keywords": ["asinh", "inverse hyperbolic sine", "arcsinh", "trigonometry", "gpu"], "suggestedPath": "/asinh-6.m" }, { "id": "assert:1", "builtinKey": "assert", "builtinTitle": "assert", "builtinSlug": "assert", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Checking that all elements are nonzero", "summary": "Throw a MATLAB-style error when a logical or numeric condition evaluates to false.", "code": "A = [1 2 3];\nassert(all(A))", "keywords": ["assert", "diagnostics", "validation", "error", "gpu"], "suggestedPath": "/assert-1.m" }, { "id": "assert:2", "builtinKey": "assert", "builtinTitle": "assert", "builtinSlug": "assert", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Verifying array bounds during development", "summary": "Throw a MATLAB-style error when a logical or numeric condition evaluates to false.", "code": "signal = 1:20;\nidx = 12;\nassert(idx >= 1 && idx <= numel(signal), ...\n \"Index %d is outside [1, %d].\", idx, numel(signal))", "keywords": ["assert", "diagnostics", "validation", "error", "gpu"], "suggestedPath": "/assert-2.m" }, { "id": "assert:3", "builtinKey": "assert", "builtinTitle": "assert", "builtinSlug": "assert", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Attaching a custom identifier for tooling", "summary": "Throw a MATLAB-style error when a logical or numeric condition evaluates to false.", "code": "M = magic(3);\nassert(det(M) ~= 0, \"runmat:demo:singularMatrix\", ...\n \"Matrix must be nonsingular (determinant is zero).\")", "keywords": ["assert", "diagnostics", "validation", "error", "gpu"], "suggestedPath": "/assert-3.m" }, { "id": "assert:4", "builtinKey": "assert", "builtinTitle": "assert", "builtinSlug": "assert", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Guarding GPU computations without manual gathering", "summary": "Throw a MATLAB-style error when a logical or numeric condition evaluates to false.", "code": "G = gpuArray(rand(1024, 1));\nassert(all(G > 0), \"All entries must be positive.\")", "keywords": ["assert", "diagnostics", "validation", "error", "gpu"], "suggestedPath": "/assert-4.m" }, { "id": "assert:5", "builtinKey": "assert", "builtinTitle": "assert", "builtinSlug": "assert", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Converting NaN checks into assertion failures", "summary": "Throw a MATLAB-style error when a logical or numeric condition evaluates to false.", "code": "samples = [1.0 2.5 3.7 4.2];\navg = mean(samples);\nassert(~isnan(avg), \"Average must be finite.\")", "keywords": ["assert", "diagnostics", "validation", "error", "gpu"], "suggestedPath": "/assert-5.m" }, { "id": "assert:6", "builtinKey": "assert", "builtinTitle": "assert", "builtinSlug": "assert", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Ensuring structure fields exist before use", "summary": "Throw a MATLAB-style error when a logical or numeric condition evaluates to false.", "code": "cfg = struct(\"timeout\", 30, \"rate\", 60);\nassert(isfield(cfg, \"rate\"), ...\n \"runmat:config:missingField\", ...\n \"Configuration missing required field '%s'.\", \"rate\")", "keywords": ["assert", "diagnostics", "validation", "error", "gpu"], "suggestedPath": "/assert-6.m" }, { "id": "assert:7", "builtinKey": "assert", "builtinTitle": "assert", "builtinSlug": "assert", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Detecting invalid enumeration values early", "summary": "Throw a MATLAB-style error when a logical or numeric condition evaluates to false.", "code": "mode = \"linear\";\nvalid = [\"nearest\", \"linear\", \"spline\"];\nassert(any(mode == valid), ...\n \"Invalid interpolation mode '%s'.\", mode)", "keywords": ["assert", "diagnostics", "validation", "error", "gpu"], "suggestedPath": "/assert-7.m" }, { "id": "assert:8", "builtinKey": "assert", "builtinTitle": "assert", "builtinSlug": "assert", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Validating dimensions before expensive work", "summary": "Throw a MATLAB-style error when a logical or numeric condition evaluates to false.", "code": "A = rand(3, 4);\nB = rand(4, 5);\nassert(size(A, 2) == size(B, 1), ...\n \"runmat:demo:dimensionMismatch\", ...\n \"Inner dimensions must agree (size(A,2)=%d, size(B,1)=%d).\", ...\n size(A, 2), size(B, 1))", "keywords": ["assert", "diagnostics", "validation", "error", "gpu"], "suggestedPath": "/assert-8.m" }, { "id": "atan:1", "builtinKey": "atan", "builtinTitle": "atan", "builtinSlug": "atan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Arctangent of a scalar", "summary": "Element-wise inverse tangent matching MATLAB semantics for real, logical, character, and complex inputs with GPU fallbacks.", "code": "y = atan(1)", "output": "y = 0.7854", "keywords": ["atan", "arctangent", "inverse tangent", "trigonometry", "gpu"], "suggestedPath": "/atan-1.m" }, { "id": "atan:2", "builtinKey": "atan", "builtinTitle": "atan", "builtinSlug": "atan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Element-wise arctangent of a vector", "summary": "Element-wise inverse tangent matching MATLAB semantics for real, logical, character, and complex inputs with GPU fallbacks.", "code": "x = linspace(-2, 2, 5);\nangles = atan(x)", "output": "angles = [-1.1071 -0.7854 0 0.7854 1.1071]", "keywords": ["atan", "arctangent", "inverse tangent", "trigonometry", "gpu"], "suggestedPath": "/atan-2.m" }, { "id": "atan:3", "builtinKey": "atan", "builtinTitle": "atan", "builtinSlug": "atan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing inverse tangent of every entry in a matrix", "summary": "Element-wise inverse tangent matching MATLAB semantics for real, logical, character, and complex inputs with GPU fallbacks.", "code": "A = [-2 -1 0; 1 2 3];\nY = atan(A)", "output": "Y =\n -1.1071 -0.7854 0\n 0.7854 1.1071 1.2490", "keywords": ["atan", "arctangent", "inverse tangent", "trigonometry", "gpu"], "suggestedPath": "/atan-3.m" }, { "id": "atan:4", "builtinKey": "atan", "builtinTitle": "atan", "builtinSlug": "atan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Evaluating `atan` on a complex number", "summary": "Element-wise inverse tangent matching MATLAB semantics for real, logical, character, and complex inputs with GPU fallbacks.", "code": "z = 1 + 2i;\nw = atan(z)", "output": "w = 1.3390 + 0.4024i", "keywords": ["atan", "arctangent", "inverse tangent", "trigonometry", "gpu"], "suggestedPath": "/atan-4.m" }, { "id": "atan:5", "builtinKey": "atan", "builtinTitle": "atan", "builtinSlug": "atan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Keeping the result on the GPU with `'like'`", "summary": "Element-wise inverse tangent matching MATLAB semantics for real, logical, character, and complex inputs with GPU fallbacks.", "code": "proto = gpuArray.zeros(1, 1);\nG = gpuArray([-3 -1 0 1 3]);\ndeviceResult = atan(G, 'like', proto);\nresult = gather(deviceResult)", "output": "result =\n -1.2490 -0.7854 0 0.7854 1.2490", "keywords": ["atan", "arctangent", "inverse tangent", "trigonometry", "gpu"], "suggestedPath": "/atan-5.m" }, { "id": "atan:6", "builtinKey": "atan", "builtinTitle": "atan", "builtinSlug": "atan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Inspecting character codes via inverse tangent", "summary": "Element-wise inverse tangent matching MATLAB semantics for real, logical, character, and complex inputs with GPU fallbacks.", "code": "codes = atan('RUN')", "output": "codes =\n 1.5586 1.5590 1.5580", "keywords": ["atan", "arctangent", "inverse tangent", "trigonometry", "gpu"], "suggestedPath": "/atan-6.m" }, { "id": "atan2:1", "builtinKey": "atan2", "builtinTitle": "atan2", "builtinSlug": "atan2", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing the polar angle of a point", "summary": "Quadrant-aware inverse tangent atan2(y, x) with MATLAB-compatible broadcasting.", "code": "theta = atan2(4, 3)", "output": "theta = 0.9273", "keywords": ["atan2", "inverse tangent", "quadrant aware", "gpu", "arctangent"], "suggestedPath": "/atan2-1.m" }, { "id": "atan2:2", "builtinKey": "atan2", "builtinTitle": "atan2", "builtinSlug": "atan2", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Determining quadrants for a vector of coordinates", "summary": "Quadrant-aware inverse tangent atan2(y, x) with MATLAB-compatible broadcasting.", "code": "Y = [-1 0 1];\nX = [-1 -1 -1];\nangles = atan2(Y, X)", "output": "angles = [-2.3562 3.1416 2.3562]", "keywords": ["atan2", "inverse tangent", "quadrant aware", "gpu", "arctangent"], "suggestedPath": "/atan2-2.m" }, { "id": "atan2:3", "builtinKey": "atan2", "builtinTitle": "atan2", "builtinSlug": "atan2", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Broadcasting a scalar denominator across a matrix", "summary": "Quadrant-aware inverse tangent atan2(y, x) with MATLAB-compatible broadcasting.", "code": "A = [1 2 3; 4 5 6];\nangles = atan2(A, 2)", "output": "angles =\n 0.4636 0.7854 0.9828\n 1.1071 1.1903 1.2490", "keywords": ["atan2", "inverse tangent", "quadrant aware", "gpu", "arctangent"], "suggestedPath": "/atan2-3.m" }, { "id": "atan2:4", "builtinKey": "atan2", "builtinTitle": "atan2", "builtinSlug": "atan2", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Handling zero numerators and signed zeros", "summary": "Quadrant-aware inverse tangent atan2(y, x) with MATLAB-compatible broadcasting.", "code": "theta = atan2([0 -0], [-2 0])", "output": "theta = [pi 0]", "keywords": ["atan2", "inverse tangent", "quadrant aware", "gpu", "arctangent"], "suggestedPath": "/atan2-4.m" }, { "id": "atan2:5", "builtinKey": "atan2", "builtinTitle": "atan2", "builtinSlug": "atan2", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Executing `atan2` on the GPU", "summary": "Quadrant-aware inverse tangent atan2(y, x) with MATLAB-compatible broadcasting.", "code": "Gy = gpuArray([1 1; -1 -1]);\nGx = gpuArray([1 -1; 1 -1]);\nangles_gpu = atan2(Gy, Gx);\nangles = gather(angles_gpu)", "output": "angles =\n 0.7854 2.3562\n -0.7854 -2.3562", "keywords": ["atan2", "inverse tangent", "quadrant aware", "gpu", "arctangent"], "suggestedPath": "/atan2-5.m" }, { "id": "atan2:6", "builtinKey": "atan2", "builtinTitle": "atan2", "builtinSlug": "atan2", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Converting character data to angles", "summary": "Quadrant-aware inverse tangent atan2(y, x) with MATLAB-compatible broadcasting.", "code": "theta = atan2('A', 100)", "output": "theta = 0.5764", "keywords": ["atan2", "inverse tangent", "quadrant aware", "gpu", "arctangent"], "suggestedPath": "/atan2-6.m" }, { "id": "atanh:1", "builtinKey": "atanh", "builtinTitle": "atanh", "builtinSlug": "atanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Inverse hyperbolic tangent of a real scalar", "summary": "Element-wise inverse hyperbolic tangent with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "y = atanh(0.5)", "output": "y = 0.5493", "keywords": ["atanh", "inverse hyperbolic tangent", "artanh", "trigonometry", "gpu", "complex"], "suggestedPath": "/atanh-1.m" }, { "id": "atanh:2", "builtinKey": "atanh", "builtinTitle": "atanh", "builtinSlug": "atanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Applying atanh element-wise to a vector", "summary": "Element-wise inverse hyperbolic tangent with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "x = linspace(-0.9, 0.9, 5);\ny = atanh(x)", "output": "y = [-1.4722 -0.4847 0 0.4847 1.4722]", "keywords": ["atanh", "inverse hyperbolic tangent", "artanh", "trigonometry", "gpu", "complex"], "suggestedPath": "/atanh-2.m" }, { "id": "atanh:3", "builtinKey": "atanh", "builtinTitle": "atanh", "builtinSlug": "atanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Dealing with values near ±1 in atanh", "summary": "Element-wise inverse hyperbolic tangent with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "A = [0.99 1.0 -1.0; 0.0 0.5 -0.5];\nB = atanh(A)", "output": "B =\n 2.6467 Inf -Inf\n 0 0.5493 -0.5493", "keywords": ["atanh", "inverse hyperbolic tangent", "artanh", "trigonometry", "gpu", "complex"], "suggestedPath": "/atanh-3.m" }, { "id": "atanh:4", "builtinKey": "atanh", "builtinTitle": "atanh", "builtinSlug": "atanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Producing complex outputs for |x| > 1", "summary": "Element-wise inverse hyperbolic tangent with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "values = [2 -3];\nresult = atanh(values)", "output": "result =\n 0.5493 + 1.5708i -0.3466 + 1.5708i", "keywords": ["atanh", "inverse hyperbolic tangent", "artanh", "trigonometry", "gpu", "complex"], "suggestedPath": "/atanh-4.m" }, { "id": "atanh:5", "builtinKey": "atanh", "builtinTitle": "atanh", "builtinSlug": "atanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing atanh for complex numbers", "summary": "Element-wise inverse hyperbolic tangent with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "Z = [1 + 2i, -0.5 + 0.75i];\nW = atanh(Z)", "output": "W =\n 0.1733 + 1.1781i -0.3104 + 0.7232i", "keywords": ["atanh", "inverse hyperbolic tangent", "artanh", "trigonometry", "gpu", "complex"], "suggestedPath": "/atanh-5.m" }, { "id": "atanh:6", "builtinKey": "atanh", "builtinTitle": "atanh", "builtinSlug": "atanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Running atanh on GPU arrays", "summary": "Element-wise inverse hyperbolic tangent with MATLAB-compatible complex promotion and GPU fallbacks.", "code": "G = gpuArray(linspace(-0.8, 0.8, 4));\ngpuResult = atanh(G);\nhostResult = gather(gpuResult)", "output": "hostResult = [-1.0986 -0.2733 0.2733 1.0986]", "keywords": ["atanh", "inverse hyperbolic tangent", "artanh", "trigonometry", "gpu", "complex"], "suggestedPath": "/atanh-6.m" }, { "id": "axis:1", "builtinKey": "axis", "builtinTitle": "axis", "builtinSlug": "axis", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Set explicit x and y limits", "summary": "Control axis limits, aspect behavior, and automatic fitting with MATLAB `axis` semantics.", "code": "plot(0:0.1:10, sin(0:0.1:10));\naxis([0 10 -1 1]);", "keywords": ["axis", "axis limits", "axis equal", "axis tight", "matlab axis"], "suggestedPath": "/axis-1.m" }, { "id": "axis:2", "builtinKey": "axis", "builtinTitle": "axis", "builtinSlug": "axis", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Force equal axis scaling", "summary": "Control axis limits, aspect behavior, and automatic fitting with MATLAB `axis` semantics.", "code": "t = linspace(0, 2*pi, 200);\nplot(cos(t), sin(t));\naxis equal;", "keywords": ["axis", "axis limits", "axis equal", "axis tight", "matlab axis"], "suggestedPath": "/axis-2.m" }, { "id": "axis:3", "builtinKey": "axis", "builtinTitle": "axis", "builtinSlug": "axis", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Return to automatic fitting inside a subplot", "summary": "Control axis limits, aspect behavior, and automatic fitting with MATLAB `axis` semantics.", "code": "subplot(1, 2, 1);\nplot(1:5, [1 4 2 5 3]);\naxis tight;\nsubplot(1, 2, 2);\nplot(1:5, [5 4 3 2 1]);\naxis auto;", "keywords": ["axis", "axis limits", "axis equal", "axis tight", "matlab axis"], "suggestedPath": "/axis-3.m" }, { "id": "bandwidth:1", "builtinKey": "bandwidth", "builtinTitle": "bandwidth", "builtinSlug": "bandwidth", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Checking the bandwidth of a diagonal matrix", "summary": "Compute the lower and upper bandwidth of a matrix, optionally returning a single side.", "code": "A = eye(4);\nbw = bandwidth(A)", "output": "bw = [0 0]", "keywords": ["bandwidth", "lower bandwidth", "upper bandwidth", "banded matrix", "structure", "gpu"], "suggestedPath": "/bandwidth-1.m" }, { "id": "bandwidth:2", "builtinKey": "bandwidth", "builtinTitle": "bandwidth", "builtinSlug": "bandwidth", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Requesting only the lower bandwidth", "summary": "Compute the lower and upper bandwidth of a matrix, optionally returning a single side.", "code": "A = [-1 0 0; 2 3 0; 4 5 6];\nlower_bw = bandwidth(A, 'lower')", "output": "lower_bw = 2", "keywords": ["bandwidth", "lower bandwidth", "upper bandwidth", "banded matrix", "structure", "gpu"], "suggestedPath": "/bandwidth-2.m" }, { "id": "bandwidth:3", "builtinKey": "bandwidth", "builtinTitle": "bandwidth", "builtinSlug": "bandwidth", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Requesting only the upper bandwidth", "summary": "Compute the lower and upper bandwidth of a matrix, optionally returning a single side.", "code": "B = [1 2 0 0; 0 3 4 0; 0 0 5 6];\nupper_bw = bandwidth(B, 'upper')", "output": "upper_bw = 1", "keywords": ["bandwidth", "lower bandwidth", "upper bandwidth", "banded matrix", "structure", "gpu"], "suggestedPath": "/bandwidth-3.m" }, { "id": "bandwidth:4", "builtinKey": "bandwidth", "builtinTitle": "bandwidth", "builtinSlug": "bandwidth", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Analysing a rectangular matrix", "summary": "Compute the lower and upper bandwidth of a matrix, optionally returning a single side.", "code": "C = [0 0 7; 8 0 0; 0 9 0; 0 0 10];\nbw = bandwidth(C)", "output": "bw = [1 2]", "keywords": ["bandwidth", "lower bandwidth", "upper bandwidth", "banded matrix", "structure", "gpu"], "suggestedPath": "/bandwidth-4.m" }, { "id": "bandwidth:5", "builtinKey": "bandwidth", "builtinTitle": "bandwidth", "builtinSlug": "bandwidth", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Working with complex-valued matrices", "summary": "Compute the lower and upper bandwidth of a matrix, optionally returning a single side.", "code": "Z = [1+2i 0; 0 3-4i; 5i 0];\nbw = bandwidth(Z)", "output": "bw = [2 0]", "keywords": ["bandwidth", "lower bandwidth", "upper bandwidth", "banded matrix", "structure", "gpu"], "suggestedPath": "/bandwidth-5.m" }, { "id": "bandwidth:6", "builtinKey": "bandwidth", "builtinTitle": "bandwidth", "builtinSlug": "bandwidth", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Inspecting a GPU-resident matrix", "summary": "Compute the lower and upper bandwidth of a matrix, optionally returning a single side.", "code": "G = gpuArray([0 1 0; 2 0 3; 0 0 0]);\nbw = bandwidth(G)", "output": "bw = [1 1]", "keywords": ["bandwidth", "lower bandwidth", "upper bandwidth", "banded matrix", "structure", "gpu"], "suggestedPath": "/bandwidth-6.m" }, { "id": "bar:1", "builtinKey": "bar", "builtinTitle": "bar", "builtinSlug": "bar", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a basic bar chart from a vector", "summary": "Create bar charts for categorical comparisons, grouped series, stacked values, and MATLAB `bar` workflows.", "code": "values = [3 5 2 9];\nbar(values);", "keywords": ["bar", "bar chart", "grouped bar chart", "stacked bar chart", "matlab bar", "categorical comparison"], "suggestedPath": "/bar-1.m" }, { "id": "bar:2", "builtinKey": "bar", "builtinTitle": "bar", "builtinSlug": "bar", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create grouped bars from a matrix", "summary": "Create bar charts for categorical comparisons, grouped series, stacked values, and MATLAB `bar` workflows.", "code": "Y = [3 5 2; 4 6 1; 5 4 3];\nbar(Y);", "keywords": ["bar", "bar chart", "grouped bar chart", "stacked bar chart", "matlab bar", "categorical comparison"], "suggestedPath": "/bar-2.m" }, { "id": "bar:3", "builtinKey": "bar", "builtinTitle": "bar", "builtinSlug": "bar", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Style a bar object and label it for the legend", "summary": "Create bar charts for categorical comparisons, grouped series, stacked values, and MATLAB `bar` workflows.", "code": "h = bar([2 4 1 5]);\nset(h, 'FaceColor', 'g', 'DisplayName', 'counts');\nlegend;", "keywords": ["bar", "bar chart", "grouped bar chart", "stacked bar chart", "matlab bar", "categorical comparison"], "suggestedPath": "/bar-3.m" }, { "id": "box:1", "builtinKey": "box", "builtinTitle": "box", "builtinSlug": "box", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Turn the axes frame on for a chart", "summary": "Toggle axes box outlines for chart framing, presentation, and MATLAB `box on` / `box off` workflows.", "code": "plot(1:5, [1 4 2 5 3]);\nbox on;", "keywords": ["box", "axes box", "box on", "box off", "matlab box"], "suggestedPath": "/box-1.m" }, { "id": "box:2", "builtinKey": "box", "builtinTitle": "box", "builtinSlug": "box", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Style subplots independently", "summary": "Toggle axes box outlines for chart framing, presentation, and MATLAB `box on` / `box off` workflows.", "code": "subplot(1, 2, 1);\nplot(1:5, 1:5);\nbox off;\nsubplot(1, 2, 2);\nplot(1:5, [5 4 3 2 1]);\nbox on;", "keywords": ["box", "axes box", "box on", "box off", "matlab box"], "suggestedPath": "/box-2.m" }, { "id": "cat:1", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Concatenating matrices by stacking rows", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "A = [1 2; 3 4];\nB = [5 6; 7 8];\nC = cat(1, A, B)", "output": "C =\n 1 2\n 3 4\n 5 6\n 7 8", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-1.m" }, { "id": "cat:2", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Concatenating matrices by appending columns", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "left = [1 3; 2 4];\nright = [10 30; 20 40];\nwide = cat(2, left, right)", "output": "wide =\n 1 3 10 30\n 2 4 20 40", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-2.m" }, { "id": "cat:3", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Building a 3-D array from 2-D slices", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "slice1 = magic(3);\nslice2 = eye(3);\ncube = cat(3, slice1, slice2)", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-3.m" }, { "id": "cat:4", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Concatenating logical masks without type changes", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "row = logical([1 0 1]);\nmask = cat(1, row, ~row)", "output": "mask =\n 1 0 1\n 0 1 0", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-4.m" }, { "id": "cat:5", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Joining character arrays into wider text rows", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "lhs = ['Run' ; 'GPU'];\nrhs = ['Mat'; 'Fun'];\nwords = cat(2, lhs, rhs)", "output": "words =\n RunMat\n GPUFun", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-5.m" }, { "id": "cat:6", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Concatenating string arrays along rows", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "names = [\"alpha\" \"beta\"];\nmore = [\"gamma\" \"delta\"];\ncombined = cat(1, names, more)", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-6.m" }, { "id": "cat:7", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Appending cell array columns for table-like data", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "cols1 = {1, 2; 'a', 'b'};\ncols2 = {3, 4; 'c', 'd'};\ntableCells = cat(2, cols1, cols2)", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-7.m" }, { "id": "cat:8", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Keeping gpuArray inputs on the device", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "G1 = gpuArray(rand(256, 256));\nG2 = gpuArray(rand(256, 256));\nstacked = cat(3, G1, G2)", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-8.m" }, { "id": "cat:9", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Requesting GPU output with the `'like'` prototype", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "G = gpuArray(rand(3, 3));\nH = cat(3, zeros(3, 3), ones(3, 3), \"like\", G)", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-9.m" }, { "id": "cat:10", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Concatenating complex arrays preserves imaginary parts", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "z1 = complex([1 2], [3 4]);\nz2 = complex([5 6], [7 8]);\njoined = cat(2, z1, z2)", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-10.m" }, { "id": "cat:11", "builtinKey": "cat", "builtinTitle": "cat", "builtinSlug": "cat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Combining empty inputs yields an empty result", "summary": "Concatenate arrays along a specified dimension while preserving MATLAB semantics.", "code": "emptyRow = zeros(0, 3);\ncombo = cat(1, emptyRow, emptyRow)", "keywords": ["cat", "concatenate", "array", "dimension", "gpu"], "suggestedPath": "/cat-11.m" }, { "id": "cd:1", "builtinKey": "cd", "builtinTitle": "cd", "builtinSlug": "cd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Display The Current Working Folder In RunMat", "summary": "Change the current working folder or query the folder that RunMat is executing in.", "code": "current = cd", "output": "% current is the absolute path to the folder where RunMat is executing", "keywords": ["cd", "change directory", "current folder", "working directory", "pwd"], "suggestedPath": "/cd-1.m" }, { "id": "cd:2", "builtinKey": "cd", "builtinTitle": "cd", "builtinSlug": "cd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Change Directory To A Project Subfolder", "summary": "Change the current working folder or query the folder that RunMat is executing in.", "code": "projectRoot = pwd;\nmkdir(\"data/logs\");\nold = cd(\"data/logs\");\n% ... work inside the logs folder ...\ncd(old)", "output": "% old contains the previous folder so you can restore it later, and the final cd(old)\n% call brings you back to projectRoot", "keywords": ["cd", "change directory", "current folder", "working directory", "pwd"], "suggestedPath": "/cd-2.m" }, { "id": "cd:3", "builtinKey": "cd", "builtinTitle": "cd", "builtinSlug": "cd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Navigate Up One Level From The Current Folder", "summary": "Change the current working folder or query the folder that RunMat is executing in.", "code": "old = cd(\"..\")", "output": "% RunMat moves to the parent folder and old captures the prior location", "keywords": ["cd", "change directory", "current folder", "working directory", "pwd"], "suggestedPath": "/cd-3.m" }, { "id": "cd:4", "builtinKey": "cd", "builtinTitle": "cd", "builtinSlug": "cd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Switch To Your Home Folder With cd ~", "summary": "Change the current working folder or query the folder that RunMat is executing in.", "code": "old = cd(\"~\")", "output": "% Changes to the user home directory; old stores the previous folder", "keywords": ["cd", "change directory", "current folder", "working directory", "pwd"], "suggestedPath": "/cd-4.m" }, { "id": "cd:5", "builtinKey": "cd", "builtinTitle": "cd", "builtinSlug": "cd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Capture The Previous Folder And Restore Later", "summary": "Change the current working folder or query the folder that RunMat is executing in.", "code": "old = cd(\"results\");\n% ... run code that writes outputs into results ...\ncd(old)", "output": "% The working folder is restored to its original location at the end", "keywords": ["cd", "change directory", "current folder", "working directory", "pwd"], "suggestedPath": "/cd-5.m" }, { "id": "cd:6", "builtinKey": "cd", "builtinTitle": "cd", "builtinSlug": "cd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handle Missing Folders With A try/catch Block", "summary": "Change the current working folder or query the folder that RunMat is executing in.", "code": "try\n cd(\"missing-folder\");\ncatch err\n disp(err.message);\nend", "output": "% Displays a descriptive error such as:\n% \"cd: unable to change directory to 'missing-folder' (No such file or directory)\"", "keywords": ["cd", "change directory", "current folder", "working directory", "pwd"], "suggestedPath": "/cd-6.m" }, { "id": "ceil:1", "builtinKey": "ceil", "builtinTitle": "ceil", "builtinSlug": "ceil", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding values up to the next integer", "summary": "Round scalars, vectors, matrices, or N-D tensors toward positive infinity or to specified digits.", "code": "x = [-2.7, -0.3, 0, 0.8, 3.2];\ny = ceil(x)", "output": "y = [-2, 0, 0, 1, 4]", "keywords": ["ceil", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/ceil-1.m" }, { "id": "ceil:2", "builtinKey": "ceil", "builtinTitle": "ceil", "builtinSlug": "ceil", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding a matrix up element-wise", "summary": "Round scalars, vectors, matrices, or N-D tensors toward positive infinity or to specified digits.", "code": "A = [1.2 4.7; -3.4 5.0];\nB = ceil(A)", "output": "B = [2 5; -3 5]", "keywords": ["ceil", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/ceil-2.m" }, { "id": "ceil:3", "builtinKey": "ceil", "builtinTitle": "ceil", "builtinSlug": "ceil", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding fractions upward in a tensor", "summary": "Round scalars, vectors, matrices, or N-D tensors toward positive infinity or to specified digits.", "code": "t = reshape([-1.8, -0.2, 0.4, 1.1, 2.1, 3.6], [3, 2]);\nup = ceil(t)", "output": "up =\n [-1 2;\n 0 3;\n 1 4]", "keywords": ["ceil", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/ceil-3.m" }, { "id": "ceil:4", "builtinKey": "ceil", "builtinTitle": "ceil", "builtinSlug": "ceil", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding up to two decimal places", "summary": "Round scalars, vectors, matrices, or N-D tensors toward positive infinity or to specified digits.", "code": "temps = [21.452 19.991 22.501];\nrounded = ceil(temps, 2)", "output": "rounded = [21.46 20 22.51]", "keywords": ["ceil", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/ceil-4.m" }, { "id": "ceil:5", "builtinKey": "ceil", "builtinTitle": "ceil", "builtinSlug": "ceil", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding to significant digits", "summary": "Round scalars, vectors, matrices, or N-D tensors toward positive infinity or to specified digits.", "code": "measurements = [0.001234 12.3456 98765];\nsig2 = ceil(measurements, 2, 'significant')", "output": "sig2 = [0.0013 13.0 99000]", "keywords": ["ceil", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/ceil-5.m" }, { "id": "ceil:6", "builtinKey": "ceil", "builtinTitle": "ceil", "builtinSlug": "ceil", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding complex numbers toward positive infinity", "summary": "Round scalars, vectors, matrices, or N-D tensors toward positive infinity or to specified digits.", "code": "z = [1.2 + 2.1i, -0.2 - 3.9i];\nresult = ceil(z)", "output": "result = [2 + 3i, 0 - 3i]", "keywords": ["ceil", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/ceil-6.m" }, { "id": "ceil:7", "builtinKey": "ceil", "builtinTitle": "ceil", "builtinSlug": "ceil", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Keeping GPU results on-device with `unary_ceil`", "summary": "Round scalars, vectors, matrices, or N-D tensors toward positive infinity or to specified digits.", "code": "G = gpuArray([1.8 -0.2 0.0; -1.1 2.5 -3.4]);\nup = ceil(G);\ngather(up)", "output": "ans =\n [ 2 0 0;\n -1 3 -3]", "keywords": ["ceil", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/ceil-7.m" }, { "id": "ceil:8", "builtinKey": "ceil", "builtinTitle": "ceil", "builtinSlug": "ceil", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Forcing GPU residency with a `'like'` prototype", "summary": "Round scalars, vectors, matrices, or N-D tensors toward positive infinity or to specified digits.", "code": "A = [1.8 -0.2; 2.7 3.4];\nproto = gpuArray(0);\nG = ceil(A, 'like', proto); % Result remains on the GPU\nresult = gather(G)", "output": "result =\n [ 2 0;\n 3 4]", "keywords": ["ceil", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/ceil-8.m" }, { "id": "cell:1", "builtinKey": "cell", "builtinTitle": "cell", "builtinSlug": "cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Creating a square cell array of empty placeholders", "summary": "Create MATLAB cell arrays, including `'like'` prototypes, with RunMat's modern builtin pipeline.", "code": "C = cell(3);\nsize(C)", "output": "ans =\n 3 3", "keywords": ["cell", "cell array", "containers", "empty", "like", "gpu fallback"], "suggestedPath": "/cell-1.m" }, { "id": "cell:2", "builtinKey": "cell", "builtinTitle": "cell", "builtinSlug": "cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Creating a rectangular 2-by-4 cell array", "summary": "Create MATLAB cell arrays, including `'like'` prototypes, with RunMat's modern builtin pipeline.", "code": "C = cell(2, 4);\nclass(C)", "output": "ans =\n 'cell'", "keywords": ["cell", "cell array", "containers", "empty", "like", "gpu fallback"], "suggestedPath": "/cell-2.m" }, { "id": "cell:3", "builtinKey": "cell", "builtinTitle": "cell", "builtinSlug": "cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Creating a 3-D cell array", "summary": "Create MATLAB cell arrays, including `'like'` prototypes, with RunMat's modern builtin pipeline.", "code": "C = cell(2, 3, 4);\nsize(C)", "output": "ans =\n 2 3 4", "keywords": ["cell", "cell array", "containers", "empty", "like", "gpu fallback"], "suggestedPath": "/cell-3.m" }, { "id": "cell:4", "builtinKey": "cell", "builtinTitle": "cell", "builtinSlug": "cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Matching the size of an existing matrix", "summary": "Create MATLAB cell arrays, including `'like'` prototypes, with RunMat's modern builtin pipeline.", "code": "A = ones(5, 2);\nC = cell(size(A));\nsize(C)", "output": "ans =\n 5 2", "keywords": ["cell", "cell array", "containers", "empty", "like", "gpu fallback"], "suggestedPath": "/cell-4.m" }, { "id": "cell:5", "builtinKey": "cell", "builtinTitle": "cell", "builtinSlug": "cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Creating a cell array using a `'like'` prototype", "summary": "Create MATLAB cell arrays, including `'like'` prototypes, with RunMat's modern builtin pipeline.", "code": "proto = logical.empty(0, 0);\nC = cell(2, 3, 'like', proto);\ncellfun(@isempty, C)", "output": "ans =\n 1 1 1\n 1 1 1", "keywords": ["cell", "cell array", "containers", "empty", "like", "gpu fallback"], "suggestedPath": "/cell-5.m" }, { "id": "cell:6", "builtinKey": "cell", "builtinTitle": "cell", "builtinSlug": "cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Using a column size vector", "summary": "Create MATLAB cell arrays, including `'like'` prototypes, with RunMat's modern builtin pipeline.", "code": "sz = [4; 1];\nC = cell(sz);\nsize(C)", "output": "ans =\n 4 1", "keywords": ["cell", "cell array", "containers", "empty", "like", "gpu fallback"], "suggestedPath": "/cell-6.m" }, { "id": "cell:7", "builtinKey": "cell", "builtinTitle": "cell", "builtinSlug": "cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Verifying that every cell starts with `[]`", "summary": "Create MATLAB cell arrays, including `'like'` prototypes, with RunMat's modern builtin pipeline.", "code": "C = cell(2, 2);\nisequal(C{1,1}, [], C{2,2}, [])", "output": "ans = logical\n 1", "keywords": ["cell", "cell array", "containers", "empty", "like", "gpu fallback"], "suggestedPath": "/cell-7.m" }, { "id": "cell2mat:1", "builtinKey": "cell2mat", "builtinTitle": "cell2mat", "builtinSlug": "cell2mat", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Converting a 2-by-2 cell array of scalars into a matrix", "summary": "Convert the contents of a MATLAB cell array into a dense numeric, logical, complex, or character matrix.", "code": "C = {1, 2; 3, 4};\nA = cell2mat(C)", "output": "A =\n 1 2\n 3 4", "keywords": ["cell2mat", "cell arrays", "matrix conversion", "block concatenation", "gpu fallback"], "suggestedPath": "/cell2mat-1.m" }, { "id": "cell2mat:2", "builtinKey": "cell2mat", "builtinTitle": "cell2mat", "builtinSlug": "cell2mat", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Concatenating blocks of different column widths", "summary": "Convert the contents of a MATLAB cell array into a dense numeric, logical, complex, or character matrix.", "code": "C = {[1 2], [3 4 5]; [6 7], [8 9 10]};\nA = cell2mat(C)", "output": "A =\n 1 2 3 4 5\n 6 7 8 9 10", "keywords": ["cell2mat", "cell arrays", "matrix conversion", "block concatenation", "gpu fallback"], "suggestedPath": "/cell2mat-2.m" }, { "id": "cell2mat:3", "builtinKey": "cell2mat", "builtinTitle": "cell2mat", "builtinSlug": "cell2mat", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Converting logical cell contents into a logical matrix", "summary": "Convert the contents of a MATLAB cell array into a dense numeric, logical, complex, or character matrix.", "code": "C = {true(2,1), false(2,1)};\nM = cell2mat(C)", "output": "M =\n 2×2 logical array\n 1 0\n 1 0", "keywords": ["cell2mat", "cell arrays", "matrix conversion", "block concatenation", "gpu fallback"], "suggestedPath": "/cell2mat-3.m" }, { "id": "cell2mat:4", "builtinKey": "cell2mat", "builtinTitle": "cell2mat", "builtinSlug": "cell2mat", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Handling complex-valued blocks", "summary": "Convert the contents of a MATLAB cell array into a dense numeric, logical, complex, or character matrix.", "code": "C = {1+2i, [3+4i 5+6i]};\nZ = cell2mat(C)", "output": "Z =\n 1.0000 + 2.0000i 3.0000 + 4.0000i 5.0000 + 6.0000i", "keywords": ["cell2mat", "cell arrays", "matrix conversion", "block concatenation", "gpu fallback"], "suggestedPath": "/cell2mat-4.m" }, { "id": "cell2mat:5", "builtinKey": "cell2mat", "builtinTitle": "cell2mat", "builtinSlug": "cell2mat", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Producing character matrices from cell arrays of character rows", "summary": "Convert the contents of a MATLAB cell array into a dense numeric, logical, complex, or character matrix.", "code": "C = {'foo', 'bar'; 'baz', 'qux'};\nS = cell2mat(C)", "output": "S =\n 'foobar'\n 'bazqux'", "keywords": ["cell2mat", "cell arrays", "matrix conversion", "block concatenation", "gpu fallback"], "suggestedPath": "/cell2mat-5.m" }, { "id": "cell2mat:6", "builtinKey": "cell2mat", "builtinTitle": "cell2mat", "builtinSlug": "cell2mat", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Tiling higher-dimensional numeric blocks", "summary": "Convert the contents of a MATLAB cell array into a dense numeric, logical, complex, or character matrix.", "code": "C = {ones(2,2,3), 2*ones(2,1,3)};\nX = cell2mat(C);\nsize(X)", "output": "ans =\n 2 3 3", "keywords": ["cell2mat", "cell arrays", "matrix conversion", "block concatenation", "gpu fallback"], "suggestedPath": "/cell2mat-6.m" }, { "id": "cell2mat:7", "builtinKey": "cell2mat", "builtinTitle": "cell2mat", "builtinSlug": "cell2mat", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Working with empty cells", "summary": "Convert the contents of a MATLAB cell array into a dense numeric, logical, complex, or character matrix.", "code": "C = {[], []; [], []};\nA = cell2mat(C);\nsize(A)", "output": "ans =\n 0 0", "keywords": ["cell2mat", "cell arrays", "matrix conversion", "block concatenation", "gpu fallback"], "suggestedPath": "/cell2mat-7.m" }, { "id": "cell2mat:8", "builtinKey": "cell2mat", "builtinTitle": "cell2mat", "builtinSlug": "cell2mat", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Gathering GPU tensors stored inside cells", "summary": "Convert the contents of a MATLAB cell array into a dense numeric, logical, complex, or character matrix.", "code": "G = gpuArray(ones(4,1));\nC = {G, 2*G};\nH = cell2mat(C); % gathered back to host automatically\nclassUnderlying(H)", "output": "ans =\n 'double'", "keywords": ["cell2mat", "cell arrays", "matrix conversion", "block concatenation", "gpu fallback"], "suggestedPath": "/cell2mat-8.m" }, { "id": "cellfun:1", "builtinKey": "cellfun", "builtinTitle": "cellfun", "builtinSlug": "cellfun", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Computing string lengths across a cell array", "summary": "Apply a function to every element of one or more cell arrays, mirroring MATLAB's cellfun behaviour.", "code": "C = {'apple', 'banana', 'cherry'};\nlengths = cellfun(@length, C)", "output": "lengths =\n 5 6 6", "keywords": ["cellfun", "cell arrays", "functional programming", "uniformoutput", "errorhandler"], "suggestedPath": "/cellfun-1.m" }, { "id": "cellfun:2", "builtinKey": "cellfun", "builtinTitle": "cellfun", "builtinSlug": "cellfun", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Mapping across two cell arrays in lockstep", "summary": "Apply a function to every element of one or more cell arrays, mirroring MATLAB's cellfun behaviour.", "code": "A = {1, 2, 3};\nB = {4, 5, 6};\ntotals = cellfun(@plus, A, B)", "output": "totals =\n 5 7 9", "keywords": ["cellfun", "cell arrays", "functional programming", "uniformoutput", "errorhandler"], "suggestedPath": "/cellfun-2.m" }, { "id": "cellfun:3", "builtinKey": "cellfun", "builtinTitle": "cellfun", "builtinSlug": "cellfun", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Keeping non-scalar outputs as cells", "summary": "Apply a function to every element of one or more cell arrays, mirroring MATLAB's cellfun behaviour.", "code": "names = {'Ada', 'Linus', 'Katherine'};\nupper = cellfun(@upper, names, 'UniformOutput', false)", "output": "upper =\n 1×3 cell array\n {'ADA'} {'LINUS'} {'KATHERINE'}", "keywords": ["cellfun", "cell arrays", "functional programming", "uniformoutput", "errorhandler"], "suggestedPath": "/cellfun-3.m" }, { "id": "cellfun:4", "builtinKey": "cellfun", "builtinTitle": "cellfun", "builtinSlug": "cellfun", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Supplying additional arguments alongside each cell", "summary": "Apply a function to every element of one or more cell arrays, mirroring MATLAB's cellfun behaviour.", "code": "C = {magic(3), eye(3)};\ndiag3 = cellfun('size', C, 2)", "output": "diag3 =\n 3 3", "keywords": ["cellfun", "cell arrays", "functional programming", "uniformoutput", "errorhandler"], "suggestedPath": "/cellfun-4.m" }, { "id": "cellfun:5", "builtinKey": "cellfun", "builtinTitle": "cellfun", "builtinSlug": "cellfun", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Handling callback failures with `'ErrorHandler'`", "summary": "Apply a function to every element of one or more cell arrays, mirroring MATLAB's cellfun behaviour.", "code": "C = {'42', 'NaN', '3.14'};\nhandler = @(err, value) NaN;\nnumbers = cellfun(@str2double, C, 'ErrorHandler', handler)", "output": "numbers =\n 42 NaN 3.1400", "keywords": ["cellfun", "cell arrays", "functional programming", "uniformoutput", "errorhandler"], "suggestedPath": "/cellfun-5.m" }, { "id": "cellfun:6", "builtinKey": "cellfun", "builtinTitle": "cellfun", "builtinSlug": "cellfun", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Using builtin short names instead of function handles", "summary": "Apply a function to every element of one or more cell arrays, mirroring MATLAB's cellfun behaviour.", "code": "cells = {[], 1:5, zeros(0, 3)};\nempty_flags = cellfun('isempty', cells)", "output": "empty_flags =\n 1 0 1", "keywords": ["cellfun", "cell arrays", "functional programming", "uniformoutput", "errorhandler"], "suggestedPath": "/cellfun-6.m" }, { "id": "cellfun:7", "builtinKey": "cellfun", "builtinTitle": "cellfun", "builtinSlug": "cellfun", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Returning rich metadata in the error handler", "summary": "Apply a function to every element of one or more cell arrays, mirroring MATLAB's cellfun behaviour.", "code": "cells = {1, 'two', 3};\neh = @(err, value) sprintf('%s @ %d', err.identifier, err.index);\nresults = cellfun(@(x) x + 1, cells, 'UniformOutput', false, 'ErrorHandler', eh)", "output": "results =\n 1×3 cell array\n {[2]} {[117 120 112]} {[4]}", "keywords": ["cellfun", "cell arrays", "functional programming", "uniformoutput", "errorhandler"], "suggestedPath": "/cellfun-7.m" }, { "id": "cellstr:1", "builtinKey": "cellstr", "builtinTitle": "cellstr", "builtinSlug": "cellstr", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Converting a character matrix into a column cell array", "summary": "Convert character arrays, string arrays, or cell arrays of text into cell arrays of character vectors with MATLAB-compatible trimming semantics.", "code": "A = ['apple '; 'berry '; 'citrus'];\nC = cellstr(A)", "output": "C =\n 3x1 cell array\n {'apple'}\n {'berry'}\n {'citrus'}", "keywords": ["cellstr", "cell array", "character vectors", "string conversion", "text", "gpu fallback"], "suggestedPath": "/cellstr-1.m" }, { "id": "cellstr:2", "builtinKey": "cellstr", "builtinTitle": "cellstr", "builtinSlug": "cellstr", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Removing trailing spaces automatically", "summary": "Convert character arrays, string arrays, or cell arrays of text into cell arrays of character vectors with MATLAB-compatible trimming semantics.", "code": "words = ['a '; 'b '; 'c '];\nC = cellstr(words)", "output": "C =\n 3x1 cell array\n {'a'}\n {'b'}\n {'c'}", "keywords": ["cellstr", "cell array", "character vectors", "string conversion", "text", "gpu fallback"], "suggestedPath": "/cellstr-2.m" }, { "id": "cellstr:3", "builtinKey": "cellstr", "builtinTitle": "cellstr", "builtinSlug": "cellstr", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Converting a string array while preserving shape", "summary": "Convert character arrays, string arrays, or cell arrays of text into cell arrays of character vectors with MATLAB-compatible trimming semantics.", "code": "S = [\"north\" \"south\"; \"east\" \"west\"];\nC = cellstr(S)", "output": "C =\n 2x2 cell array\n {'north'} {'south'}\n {'east'} {'west'}", "keywords": ["cellstr", "cell array", "character vectors", "string conversion", "text", "gpu fallback"], "suggestedPath": "/cellstr-3.m" }, { "id": "cellstr:4", "builtinKey": "cellstr", "builtinTitle": "cellstr", "builtinSlug": "cellstr", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Normalising a cell array that mixes strings and character vectors", "summary": "Convert character arrays, string arrays, or cell arrays of text into cell arrays of character vectors with MATLAB-compatible trimming semantics.", "code": "C = {\"left\", 'right'};\nout = cellstr(C)", "output": "out =\n 1x2 cell array\n {'left'} {'right'}", "keywords": ["cellstr", "cell array", "character vectors", "string conversion", "text", "gpu fallback"], "suggestedPath": "/cellstr-4.m" }, { "id": "cellstr:5", "builtinKey": "cellstr", "builtinTitle": "cellstr", "builtinSlug": "cellstr", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Handling empty character arrays", "summary": "Convert character arrays, string arrays, or cell arrays of text into cell arrays of character vectors with MATLAB-compatible trimming semantics.", "code": "emptyChars = char.empty(0, 5);\nC = cellstr(emptyChars);\nsize(C)", "output": "ans =\n 0 1", "keywords": ["cellstr", "cell array", "character vectors", "string conversion", "text", "gpu fallback"], "suggestedPath": "/cellstr-5.m" }, { "id": "cellstr:6", "builtinKey": "cellstr", "builtinTitle": "cellstr", "builtinSlug": "cellstr", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Converting a single string scalar", "summary": "Convert character arrays, string arrays, or cell arrays of text into cell arrays of character vectors with MATLAB-compatible trimming semantics.", "code": "single = \"RunMat\";\nC = cellstr(single)", "output": "C =\n 1x1 cell array\n {'RunMat'}", "keywords": ["cellstr", "cell array", "character vectors", "string conversion", "text", "gpu fallback"], "suggestedPath": "/cellstr-6.m" }, { "id": "cellstr:7", "builtinKey": "cellstr", "builtinTitle": "cellstr", "builtinSlug": "cellstr", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Validating non-text inputs", "summary": "Convert character arrays, string arrays, or cell arrays of text into cell arrays of character vectors with MATLAB-compatible trimming semantics.", "code": "try\n cellstr(42);\ncatch ME\n disp(ME.message)\nend", "output": "cellstr: input must be a character array, string array, or cell array of character vectors", "keywords": ["cellstr", "cell array", "character vectors", "string conversion", "text", "gpu fallback"], "suggestedPath": "/cellstr-7.m" }, { "id": "char:1", "builtinKey": "char", "builtinTitle": "char", "builtinSlug": "char", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Converting a string scalar to a character row", "summary": "Convert text, numeric codes, and cell contents into MATLAB-style character arrays.", "code": "name = char(\"RunMat\")", "output": "name =\n 'RunMat'", "keywords": ["char", "character array", "string conversion", "padding", "gpu"], "suggestedPath": "/char-1.m" }, { "id": "char:2", "builtinKey": "char", "builtinTitle": "char", "builtinSlug": "char", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Building a character matrix from multiple rows", "summary": "Convert text, numeric codes, and cell contents into MATLAB-style character arrays.", "code": "rows = char(\"alpha\", \"beta\")", "output": "rows =\n 'alpha'\n 'beta '", "keywords": ["char", "character array", "string conversion", "padding", "gpu"], "suggestedPath": "/char-2.m" }, { "id": "char:3", "builtinKey": "char", "builtinTitle": "char", "builtinSlug": "char", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Transforming numeric codes to characters", "summary": "Convert text, numeric codes, and cell contents into MATLAB-style character arrays.", "code": "codes = [77 65 84 76 65 66];\nletters = char(codes)", "output": "letters =\n 'MATLAB'", "keywords": ["char", "character array", "string conversion", "padding", "gpu"], "suggestedPath": "/char-3.m" }, { "id": "char:4", "builtinKey": "char", "builtinTitle": "char", "builtinSlug": "char", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Padding a string array into a character matrix", "summary": "Convert text, numeric codes, and cell contents into MATLAB-style character arrays.", "code": "animals = [\"cat\"; \"giraffe\"];\nC = char(animals)", "output": "C =\n 'cat '\n 'giraffe'", "keywords": ["char", "character array", "string conversion", "padding", "gpu"], "suggestedPath": "/char-4.m" }, { "id": "char:5", "builtinKey": "char", "builtinTitle": "char", "builtinSlug": "char", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Creating rows from a cell array of character vectors", "summary": "Convert text, numeric codes, and cell contents into MATLAB-style character arrays.", "code": "dirs = {'north', 'east', 'west'};\nchart = char(dirs)", "output": "chart =\n 'north'\n 'east '\n 'west '", "keywords": ["char", "character array", "string conversion", "padding", "gpu"], "suggestedPath": "/char-5.m" }, { "id": "char:6", "builtinKey": "char", "builtinTitle": "char", "builtinSlug": "char", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Converting GPU-resident codes back to text", "summary": "Convert text, numeric codes, and cell contents into MATLAB-style character arrays.", "code": "G = gpuArray([82 85 78 77 65 84]);\nlabel = char(G)", "output": "label =\n 'RUNMAT'", "keywords": ["char", "character array", "string conversion", "padding", "gpu"], "suggestedPath": "/char-6.m" }, { "id": "chol:1", "builtinKey": "chol", "builtinTitle": "chol", "builtinSlug": "chol", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Upper-triangular Cholesky factor of a symmetric positive-definite matrix", "summary": "Cholesky factorization with MATLAB-compatible upper and lower forms.", "code": "A = [4 12 -16; 12 37 -43; -16 -43 98];\nR = chol(A)", "output": "R =\n 2 6 -8\n 0 1 5\n 0 0 3", "keywords": ["chol", "cholesky", "factorization", "positive definite", "lower", "upper"], "suggestedPath": "/chol-1.m" }, { "id": "chol:2", "builtinKey": "chol", "builtinTitle": "chol", "builtinSlug": "chol", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Lower-triangular factor using the `'lower'` option", "summary": "Cholesky factorization with MATLAB-compatible upper and lower forms.", "code": "A = [25 15 -5; 15 18 0; -5 0 11];\nL = chol(A, 'lower')", "output": "L =\n 5 0 0\n 3 3 0\n -1 1 3", "keywords": ["chol", "cholesky", "factorization", "positive definite", "lower", "upper"], "suggestedPath": "/chol-2.m" }, { "id": "chol:3", "builtinKey": "chol", "builtinTitle": "chol", "builtinSlug": "chol", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Detecting a non-positive-definite matrix with the two-output form", "summary": "Cholesky factorization with MATLAB-compatible upper and lower forms.", "code": "A = [1 2; 2 1];\n[R, p] = chol(A)", "output": "R =\n 1 2\n 0 0\n\np =\n 2", "keywords": ["chol", "cholesky", "factorization", "positive definite", "lower", "upper"], "suggestedPath": "/chol-3.m" }, { "id": "chol:4", "builtinKey": "chol", "builtinTitle": "chol", "builtinSlug": "chol", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Using the Cholesky factor to solve linear systems", "summary": "Cholesky factorization with MATLAB-compatible upper and lower forms.", "code": "A = [10 2 3; 2 9 1; 3 1 7];\nb = [1; 2; 3];\n[R, p] = chol(A);\nif p == 0\n y = R' \\ b;\n x = R \\ y;\nend", "keywords": ["chol", "cholesky", "factorization", "positive definite", "lower", "upper"], "suggestedPath": "/chol-4.m" }, { "id": "chol:5", "builtinKey": "chol", "builtinTitle": "chol", "builtinSlug": "chol", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Cholesky factor of a complex Hermitian positive-definite matrix", "summary": "Cholesky factorization with MATLAB-compatible upper and lower forms.", "code": "A = [5 1-2i; 1+2i 4];\n[R, p] = chol(A)", "output": "R =\n 2.2361 0.4472 -0.8944i\n 0 1.7321\n\np =\n 0", "keywords": ["chol", "cholesky", "factorization", "positive definite", "lower", "upper"], "suggestedPath": "/chol-5.m" }, { "id": "chol:6", "builtinKey": "chol", "builtinTitle": "chol", "builtinSlug": "chol", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Running `chol` on a `gpuArray`", "summary": "Cholesky factorization with MATLAB-compatible upper and lower forms.", "code": "G = gpuArray([6 2; 2 5]);\n[R, p] = chol(G);\nclass(R)", "output": "ans =\n 'gpuArray'", "keywords": ["chol", "cholesky", "factorization", "positive definite", "lower", "upper"], "suggestedPath": "/chol-6.m" }, { "id": "circshift:1", "builtinKey": "circshift", "builtinTitle": "circshift", "builtinSlug": "circshift", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Shifting matrix rows downward by one location", "summary": "Rotate arrays circularly along one or more dimensions.", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nB = circshift(A, 1)", "output": "B =\n 7 8 9\n 1 2 3\n 4 5 6", "keywords": ["circshift", "circular shift", "rotate array", "gpu", "cyclic shift"], "suggestedPath": "/circshift-1.m" }, { "id": "circshift:2", "builtinKey": "circshift", "builtinTitle": "circshift", "builtinSlug": "circshift", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Shifting columns left by two positions", "summary": "Rotate arrays circularly along one or more dimensions.", "code": "A = reshape(1:12, [3 4]);\nC = circshift(A, [0 -2])", "output": "C =\n 7 10 1 4\n 8 11 2 5\n 9 12 3 6", "keywords": ["circshift", "circular shift", "rotate array", "gpu", "cyclic shift"], "suggestedPath": "/circshift-2.m" }, { "id": "circshift:3", "builtinKey": "circshift", "builtinTitle": "circshift", "builtinSlug": "circshift", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Rotating a 3-D tensor along multiple dimensions", "summary": "Rotate arrays circularly along one or more dimensions.", "code": "T = reshape(1:8, [2 2 2]);\nU = circshift(T, [1 0 -1]);\nU(:, :, 1)\nU(:, :, 2)", "output": "ans(:,:,1) =\n 6 8\n 5 7\n\nans(:,:,2) =\n 2 4\n 1 3", "keywords": ["circshift", "circular shift", "rotate array", "gpu", "cyclic shift"], "suggestedPath": "/circshift-3.m" }, { "id": "circshift:4", "builtinKey": "circshift", "builtinTitle": "circshift", "builtinSlug": "circshift", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Shifting along specific dimensions using the `dims` argument", "summary": "Rotate arrays circularly along one or more dimensions.", "code": "A = reshape(1:12, [3 4]);\nV = circshift(A, [2 -1], [1 2])", "output": "V =\n 5 8 11 2\n 6 9 12 3\n 4 7 10 1", "keywords": ["circshift", "circular shift", "rotate array", "gpu", "cyclic shift"], "suggestedPath": "/circshift-4.m" }, { "id": "circshift:5", "builtinKey": "circshift", "builtinTitle": "circshift", "builtinSlug": "circshift", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Rotating a character matrix to cycle through rows and columns", "summary": "Rotate arrays circularly along one or more dimensions.", "code": "C = ['r','u','n'; 'm','a','t'];\nR = circshift(C, [0 1])", "output": "R =\n 'nru'\n 'tma'", "keywords": ["circshift", "circular shift", "rotate array", "gpu", "cyclic shift"], "suggestedPath": "/circshift-5.m" }, { "id": "circshift:6", "builtinKey": "circshift", "builtinTitle": "circshift", "builtinSlug": "circshift", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Applying `circshift` to a gpuArray and keeping the result on the device", "summary": "Rotate arrays circularly along one or more dimensions.", "code": "G = gpuArray(reshape(1:12, [3 4]));\nH = circshift(G, [1 -2]);\nisgpuarray(H)", "output": "ans = logical 1", "keywords": ["circshift", "circular shift", "rotate array", "gpu", "cyclic shift"], "suggestedPath": "/circshift-6.m" }, { "id": "class:1", "builtinKey": "class", "builtinTitle": "class", "builtinSlug": "class", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Check the class of a numeric scalar", "summary": "Return the MATLAB class name for scalars, arrays, handles, and objects.", "code": "c = class(42)", "output": "c = \"double\"", "keywords": ["class", "type inspection", "gpuArray class", "MATLAB class name", "isa"], "suggestedPath": "/class-1.m" }, { "id": "class:2", "builtinKey": "class", "builtinTitle": "class", "builtinSlug": "class", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Inspect the class of a string array", "summary": "Return the MATLAB class name for scalars, arrays, handles, and objects.", "code": "names = [\"Ada\", \"Grace\", \"Edsger\"];\nclass_name = class(names)", "output": "class_name = \"string\"", "keywords": ["class", "type inspection", "gpuArray class", "MATLAB class name", "isa"], "suggestedPath": "/class-2.m" }, { "id": "class:3", "builtinKey": "class", "builtinTitle": "class", "builtinSlug": "class", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Determine whether a cell array stays typed as a cell", "summary": "Return the MATLAB class name for scalars, arrays, handles, and objects.", "code": "cells = {1, \"two\", 3};\ncell_class = class(cells)", "output": "cell_class = \"cell\"", "keywords": ["class", "type inspection", "gpuArray class", "MATLAB class name", "isa"], "suggestedPath": "/class-3.m" }, { "id": "class:4", "builtinKey": "class", "builtinTitle": "class", "builtinSlug": "class", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Detect the class of gpuArray data without gathering", "summary": "Return the MATLAB class name for scalars, arrays, handles, and objects.", "code": "G = gpuArray(rand(4));\ng_class = class(G)", "output": "g_class = \"gpuArray\"", "keywords": ["class", "type inspection", "gpuArray class", "MATLAB class name", "isa"], "suggestedPath": "/class-4.m" }, { "id": "class:5", "builtinKey": "class", "builtinTitle": "class", "builtinSlug": "class", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Report the class name of a custom object", "summary": "Return the MATLAB class name for scalars, arrays, handles, and objects.", "code": "P = classref(\"Point\").origin();\npoint_class = class(P)", "output": "point_class = \"Point\"", "keywords": ["class", "type inspection", "gpuArray class", "MATLAB class name", "isa"], "suggestedPath": "/class-5.m" }, { "id": "clc:1", "builtinKey": "clc", "builtinTitle": "clc", "builtinSlug": "clc", "category": "io", "categoryPath": ["io"], "exampleTitle": "Clear the command window after printing a message", "summary": "Request that the host clear the visible Command Window or console display.", "code": "disp('hello');\nclc;", "output": "% The host clears the visible console after displaying hello", "keywords": ["clc", "clear console", "command window", "console", "screen"], "suggestedPath": "/clc-1.m" }, { "id": "clc:2", "builtinKey": "clc", "builtinTitle": "clc", "builtinSlug": "clc", "category": "io", "categoryPath": ["io"], "exampleTitle": "Use clc between interactive steps", "summary": "Request that the host clear the visible Command Window or console display.", "code": "disp('Step 1 complete');\nclc;\ndisp('Ready for the next command')", "output": "% Only the later output remains visible if the host honors clear-screen events", "keywords": ["clc", "clear console", "command window", "console", "screen"], "suggestedPath": "/clc-2.m" }, { "id": "clc:3", "builtinKey": "clc", "builtinTitle": "clc", "builtinSlug": "clc", "category": "io", "categoryPath": ["io"], "exampleTitle": "Calling clc with inputs is invalid", "summary": "Request that the host clear the visible Command Window or console display.", "code": "clc(1)", "output": "clc: expected no input arguments", "keywords": ["clc", "clear console", "command window", "console", "screen"], "suggestedPath": "/clc-3.m" }, { "id": "clear:1", "builtinKey": "clear", "builtinTitle": "clear", "builtinSlug": "clear", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Clear the entire interactive workspace", "summary": "Clear variables from the active workspace.", "code": "x = 1;\ny = magic(3);\nclear", "output": "% x and y are removed from the workspace", "keywords": ["clear", "workspace", "variables", "clear all", "command window"], "suggestedPath": "/clear-1.m" }, { "id": "clear:2", "builtinKey": "clear", "builtinTitle": "clear", "builtinSlug": "clear", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Use MATLAB-style command form", "summary": "Clear variables from the active workspace.", "code": "a = 42;\nclear all", "output": "% a is removed from the workspace", "keywords": ["clear", "workspace", "variables", "clear all", "command window"], "suggestedPath": "/clear-2.m" }, { "id": "clear:3", "builtinKey": "clear", "builtinTitle": "clear", "builtinSlug": "clear", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Accessing a cleared variable raises an error", "summary": "Clear variables from the active workspace.", "code": "x = 7;\nclear;\nx", "output": "Undefined variable: x", "keywords": ["clear", "workspace", "variables", "clear all", "command window"], "suggestedPath": "/clear-3.m" }, { "id": "clear:4", "builtinKey": "clear", "builtinTitle": "clear", "builtinSlug": "clear", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Clear one variable while leaving others intact", "summary": "Clear variables from the active workspace.", "code": "x = 1;\ny = 2;\nclear x", "output": "% x is removed from the workspace while y remains defined", "keywords": ["clear", "workspace", "variables", "clear all", "command window"], "suggestedPath": "/clear-4.m" }, { "id": "clear:5", "builtinKey": "clear", "builtinTitle": "clear", "builtinSlug": "clear", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Clear multiple named variables in command form", "summary": "Clear variables from the active workspace.", "code": "a = 1;\nb = 2;\nc = 3;\nclear a b", "output": "% a and b are removed; c remains defined", "keywords": ["clear", "workspace", "variables", "clear all", "command window"], "suggestedPath": "/clear-5.m" }, { "id": "close:1", "builtinKey": "close", "builtinTitle": "close", "builtinSlug": "close", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Close a TCP client after finishing I/O", "summary": "Close TCP clients or servers that were created by tcpclient, tcpserver, or accept.", "code": "client = tcpclient(\"127.0.0.1\", 50000);\nstatus = close(client)", "output": "status = 1", "keywords": ["close", "tcpclient", "tcpserver", "socket", "networking"], "suggestedPath": "/close-1.m" }, { "id": "close:2", "builtinKey": "close", "builtinTitle": "close", "builtinSlug": "close", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Close a TCP server and any accepted clients", "summary": "Close TCP clients or servers that were created by tcpclient, tcpserver, or accept.", "code": "srv = tcpserver(\"127.0.0.1\", 0);\nclient = accept(srv); % accept a pending connection\nstatus = close(srv); % closes the server and the accepted client", "output": "status = 1", "keywords": ["close", "tcpclient", "tcpserver", "socket", "networking"], "suggestedPath": "/close-2.m" }, { "id": "close:3", "builtinKey": "close", "builtinTitle": "close", "builtinSlug": "close", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Close every open TCP client", "summary": "Close TCP clients or servers that were created by tcpclient, tcpserver, or accept.", "code": "tcpclient(\"localhost\", 40000);\ntcpclient(\"localhost\", 40001);\nstatus = close(\"clients\")", "output": "status = 1", "keywords": ["close", "tcpclient", "tcpserver", "socket", "networking"], "suggestedPath": "/close-3.m" }, { "id": "close:4", "builtinKey": "close", "builtinTitle": "close", "builtinSlug": "close", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Close all networking resources at once", "summary": "Close TCP clients or servers that were created by tcpclient, tcpserver, or accept.", "code": "client = tcpclient(\"localhost\", 40000);\nsrv = tcpserver(\"localhost\", 0);\nstatus = close(\"all\")", "output": "status = 1", "keywords": ["close", "tcpclient", "tcpserver", "socket", "networking"], "suggestedPath": "/close-4.m" }, { "id": "close:5", "builtinKey": "close", "builtinTitle": "close", "builtinSlug": "close", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Calling close on an already-closed client", "summary": "Close TCP clients or servers that were created by tcpclient, tcpserver, or accept.", "code": "client = tcpclient(\"127.0.0.1\", 50000);\nclose(client);\nstatus = close(client); % nothing left to close", "output": "status = 0", "keywords": ["close", "tcpclient", "tcpserver", "socket", "networking"], "suggestedPath": "/close-5.m" }, { "id": "close:6", "builtinKey": "close", "builtinTitle": "close", "builtinSlug": "close", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Close handles stored in a cell array", "summary": "Close TCP clients or servers that were created by tcpclient, tcpserver, or accept.", "code": "client = tcpclient(\"localhost\", 40000);\nsrv = tcpserver(\"localhost\", 0);\nhandles = {client, srv};\nstatus = close(handles)", "output": "status = 1", "keywords": ["close", "tcpclient", "tcpserver", "socket", "networking"], "suggestedPath": "/close-6.m" }, { "id": "colon:1", "builtinKey": "colon", "builtinTitle": "colon", "builtinSlug": "colon", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Generating consecutive integers", "summary": "Generate MATLAB-style arithmetic progressions with optional step size.", "code": "x = colon(1, 5)", "output": "x = [1 2 3 4 5]", "keywords": ["colon", "sequence", "range", "step", "gpu"], "suggestedPath": "/colon-1.m" }, { "id": "colon:2", "builtinKey": "colon", "builtinTitle": "colon", "builtinSlug": "colon", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Counting down without specifying a step", "summary": "Generate MATLAB-style arithmetic progressions with optional step size.", "code": "y = colon(5, 1)", "output": "y = [5 4 3 2 1]", "keywords": ["colon", "sequence", "range", "step", "gpu"], "suggestedPath": "/colon-2.m" }, { "id": "colon:3", "builtinKey": "colon", "builtinTitle": "colon", "builtinSlug": "colon", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Using a custom increment", "summary": "Generate MATLAB-style arithmetic progressions with optional step size.", "code": "z = colon(0, 0.5, 2)", "output": "z = [0 0.5 1.0 1.5 2.0]", "keywords": ["colon", "sequence", "range", "step", "gpu"], "suggestedPath": "/colon-3.m" }, { "id": "colon:4", "builtinKey": "colon", "builtinTitle": "colon", "builtinSlug": "colon", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Stopping before overshooting the end point", "summary": "Generate MATLAB-style arithmetic progressions with optional step size.", "code": "vals = colon(0, 2, 5)", "output": "vals = [0 2 4]", "keywords": ["colon", "sequence", "range", "step", "gpu"], "suggestedPath": "/colon-4.m" }, { "id": "colon:5", "builtinKey": "colon", "builtinTitle": "colon", "builtinSlug": "colon", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Working with fractional radians", "summary": "Generate MATLAB-style arithmetic progressions with optional step size.", "code": "theta = colon(-pi, pi/4, pi/2)", "output": "theta = [-3.1416 -2.3562 -1.5708 -0.7854 0.0000 0.7854 1.5708]", "keywords": ["colon", "sequence", "range", "step", "gpu"], "suggestedPath": "/colon-5.m" }, { "id": "colon:6", "builtinKey": "colon", "builtinTitle": "colon", "builtinSlug": "colon", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Keeping sequences on the GPU", "summary": "Generate MATLAB-style arithmetic progressions with optional step size.", "code": "g = gpuArray(0);\nh = colon(g, 0.25, 1);\nresult = gather(h)", "output": "result = [0 0.25 0.5 0.75 1.0]", "keywords": ["colon", "sequence", "range", "step", "gpu"], "suggestedPath": "/colon-6.m" }, { "id": "colon:7", "builtinKey": "colon", "builtinTitle": "colon", "builtinSlug": "colon", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Building character ranges", "summary": "Generate MATLAB-style arithmetic progressions with optional step size.", "code": "letters = colon('a', 'f')\nodds = colon('a', 2, 'g')", "output": "letters = 'abcdef';\nodds = 'aceg'", "keywords": ["colon", "sequence", "range", "step", "gpu"], "suggestedPath": "/colon-7.m" }, { "id": "colorbar:1", "builtinKey": "colorbar", "builtinTitle": "colorbar", "builtinSlug": "colorbar", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Show a colorbar for a scaled image", "summary": "Show or hide colorbars for images, surfaces, contours, and MATLAB `colorbar` workflows.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 60), linspace(-3, 3, 60));\nA = sin(X) .* cos(Y);\nimagesc(A);\ncolorbar on;", "keywords": ["colorbar", "color scale", "image colorbar", "surface colorbar", "matlab colorbar"], "suggestedPath": "/colorbar-1.m" }, { "id": "colorbar:2", "builtinKey": "colorbar", "builtinTitle": "colorbar", "builtinSlug": "colorbar", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use colorbars independently across subplots", "summary": "Show or hide colorbars for images, surfaces, contours, and MATLAB `colorbar` workflows.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 40), linspace(-3, 3, 40));\nZ = sin(X) .* cos(Y);\nsubplot(1, 2, 1);\ncontourf(X, Y, Z);\ncolorbar on;\nsubplot(1, 2, 2);\nsurf(X, Y, Z);\ncolorbar off;", "keywords": ["colorbar", "color scale", "image colorbar", "surface colorbar", "matlab colorbar"], "suggestedPath": "/colorbar-2.m" }, { "id": "colormap:1", "builtinKey": "colormap", "builtinTitle": "colormap", "builtinSlug": "colormap", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Apply a palette to a scaled image", "summary": "Set colormaps for images, surfaces, contours, and MATLAB `colormap` workflows.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 60), linspace(-3, 3, 60));\nA = sin(X) .* cos(Y);\nimagesc(A);\ncolormap('jet');\ncolorbar;", "keywords": ["colormap", "color palette", "heatmap palette", "surface palette", "matlab colormap"], "suggestedPath": "/colormap-1.m" }, { "id": "colormap:2", "builtinKey": "colormap", "builtinTitle": "colormap", "builtinSlug": "colormap", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Compare palettes across subplots", "summary": "Set colormaps for images, surfaces, contours, and MATLAB `colormap` workflows.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 40), linspace(-3, 3, 40));\nZ = sin(X) .* cos(Y);\nsubplot(1, 2, 1);\nsurf(X, Y, Z);\ncolormap('parula');\nsubplot(1, 2, 2);\ncontourf(X, Y, Z);\ncolormap('turbo');", "keywords": ["colormap", "color palette", "heatmap palette", "surface palette", "matlab colormap"], "suggestedPath": "/colormap-2.m" }, { "id": "compose:1", "builtinKey": "compose", "builtinTitle": "compose", "builtinSlug": "compose", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting A Scalar Value Into A Sentence", "summary": "Format numeric, logical, and text data into MATLAB string arrays using printf-style placeholders.", "code": "msg = compose(\"The answer is %d.\", 42)", "output": "msg = \"The answer is 42.\"", "keywords": ["compose", "format", "string array", "sprintf", "gpu"], "suggestedPath": "/compose-1.m" }, { "id": "compose:2", "builtinKey": "compose", "builtinTitle": "compose", "builtinSlug": "compose", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Broadcasting A Scalar Format Spec Over A Vector", "summary": "Format numeric, logical, and text data into MATLAB string arrays using printf-style placeholders.", "code": "result = compose(\"Trial %d\", 1:4)", "output": "result = 1×4 string\n \"Trial 1\" \"Trial 2\" \"Trial 3\" \"Trial 4\"", "keywords": ["compose", "format", "string array", "sprintf", "gpu"], "suggestedPath": "/compose-2.m" }, { "id": "compose:3", "builtinKey": "compose", "builtinTitle": "compose", "builtinSlug": "compose", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Using A String Array Of Formats", "summary": "Format numeric, logical, and text data into MATLAB string arrays using printf-style placeholders.", "code": "spec = [\"max: %0.2f\", \"min: %0.2f\"];\nvalues = compose(spec, [3.14159, 0.125])", "output": "values = 1×2 string\n \"max: 3.14\" \"min: 0.12\"", "keywords": ["compose", "format", "string array", "sprintf", "gpu"], "suggestedPath": "/compose-3.m" }, { "id": "compose:4", "builtinKey": "compose", "builtinTitle": "compose", "builtinSlug": "compose", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting Each Row Of A Character Array", "summary": "Format numeric, logical, and text data into MATLAB string arrays using printf-style placeholders.", "code": "C = ['Row %02d'; 'Row %02d'; 'Row %02d'];\nidx = compose(C, (1:3).')", "output": "idx = 3×1 string\n \"Row 01\"\n \"Row 02\"\n \"Row 03\"", "keywords": ["compose", "format", "string array", "sprintf", "gpu"], "suggestedPath": "/compose-4.m" }, { "id": "compose:5", "builtinKey": "compose", "builtinTitle": "compose", "builtinSlug": "compose", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Combining Real And Imaginary Parts", "summary": "Format numeric, logical, and text data into MATLAB string arrays using printf-style placeholders.", "code": "Z = [1+2i, 3-4i];\ntxt = compose(\"z = %s\", Z)", "output": "txt = 1×2 string\n \"z = 1+2i\" \"z = 3-4i\"", "keywords": ["compose", "format", "string array", "sprintf", "gpu"], "suggestedPath": "/compose-5.m" }, { "id": "compose:6", "builtinKey": "compose", "builtinTitle": "compose", "builtinSlug": "compose", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Using A Cell Array Of Format Specs", "summary": "Format numeric, logical, and text data into MATLAB string arrays using printf-style placeholders.", "code": "specs = {'%0.1f volts', '%0.1f amps'};\nreadings = compose(specs, {12.6, 3.4})", "output": "readings = 2×1 string\n \"12.6 volts\"\n \"3.4 amps\"", "keywords": ["compose", "format", "string array", "sprintf", "gpu"], "suggestedPath": "/compose-6.m" }, { "id": "compose:7", "builtinKey": "compose", "builtinTitle": "compose", "builtinSlug": "compose", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting GPU-Resident Data", "summary": "Format numeric, logical, and text data into MATLAB string arrays using printf-style placeholders.", "code": "G = gpuArray([10 20 30]);\nlabels = compose(\"Value %d\", G)", "output": "labels = 1×3 string\n \"Value 10\" \"Value 20\" \"Value 30\"", "keywords": ["compose", "format", "string array", "sprintf", "gpu"], "suggestedPath": "/compose-7.m" }, { "id": "cond:1", "builtinKey": "cond", "builtinTitle": "cond", "builtinSlug": "cond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Condition number of the identity matrix", "summary": "Compute the matrix condition number with MATLAB-compatible norm choices.", "code": "A = eye(3);\nk = cond(A)", "output": "k = 1", "keywords": ["cond", "condition number", "norm", "linear algebra", "gpu"], "suggestedPath": "/cond-1.m" }, { "id": "cond:2", "builtinKey": "cond", "builtinTitle": "cond", "builtinSlug": "cond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Diagnosing an ill-conditioned diagonal matrix", "summary": "Compute the matrix condition number with MATLAB-compatible norm choices.", "code": "D = diag([1, 1e-8]);\nk = cond(D)", "output": "k = 1.0e+8", "keywords": ["cond", "condition number", "norm", "linear algebra", "gpu"], "suggestedPath": "/cond-2.m" }, { "id": "cond:3", "builtinKey": "cond", "builtinTitle": "cond", "builtinSlug": "cond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Condition number of a rectangular matrix (2-norm)", "summary": "Compute the matrix condition number with MATLAB-compatible norm choices.", "code": "A = [1 0; 0 1; 1 1];\nk = cond(A, 2)", "output": "k = 1.7321", "keywords": ["cond", "condition number", "norm", "linear algebra", "gpu"], "suggestedPath": "/cond-3.m" }, { "id": "cond:4", "builtinKey": "cond", "builtinTitle": "cond", "builtinSlug": "cond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Using a different norm specification", "summary": "Compute the matrix condition number with MATLAB-compatible norm choices.", "code": "A = [4 -1; 2 3];\nk1 = cond(A, 1)\nkInf = cond(A, Inf)", "output": "k1 = 2.1429\nkInf = 2.1429", "keywords": ["cond", "condition number", "norm", "linear algebra", "gpu"], "suggestedPath": "/cond-4.m" }, { "id": "cond:5", "builtinKey": "cond", "builtinTitle": "cond", "builtinSlug": "cond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Complex-valued matrices", "summary": "Compute the matrix condition number with MATLAB-compatible norm choices.", "code": "A = [1+2i 0; 3i 4-1i];\nk = cond(A)", "output": "k = 3.0327", "keywords": ["cond", "condition number", "norm", "linear algebra", "gpu"], "suggestedPath": "/cond-5.m" }, { "id": "cond:6", "builtinKey": "cond", "builtinTitle": "cond", "builtinSlug": "cond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Empty inputs and GPU residency", "summary": "Compute the matrix condition number with MATLAB-compatible norm choices.", "code": "G = gpuArray([]); % Empty 0x0 matrix on the GPU\nk = cond(G); % Returns 0 and keeps residency when possible\nresult = gather(k)", "output": "result = 0", "keywords": ["cond", "condition number", "norm", "linear algebra", "gpu"], "suggestedPath": "/cond-6.m" }, { "id": "conj:1", "builtinKey": "conj", "builtinTitle": "conj", "builtinSlug": "conj", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Complex conjugate of a scalar value in MATLAB", "summary": "Compute the complex conjugate of scalars, vectors, matrices, or N-D tensors.", "code": "z = 3 + 4i;\nresult = conj(z)", "output": "result = 3 - 4i", "keywords": ["conj", "complex conjugate", "complex", "elementwise", "gpu"], "suggestedPath": "/conj-1.m" }, { "id": "conj:2", "builtinKey": "conj", "builtinTitle": "conj", "builtinSlug": "conj", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Apply conj to every element of a complex matrix", "summary": "Compute the complex conjugate of scalars, vectors, matrices, or N-D tensors.", "code": "Z = [1+2i, 4-3i; -5+0i, 7+8i];\nC = conj(Z)", "output": "C =\n 1 - 2i 4 + 3i\n -5 + 0i 7 - 8i", "keywords": ["conj", "complex conjugate", "complex", "elementwise", "gpu"], "suggestedPath": "/conj-2.m" }, { "id": "conj:3", "builtinKey": "conj", "builtinTitle": "conj", "builtinSlug": "conj", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Ensure conj leaves real inputs unchanged", "summary": "Compute the complex conjugate of scalars, vectors, matrices, or N-D tensors.", "code": "data = [-2.5 0 9.75];\nunchanged = conj(data)", "output": "unchanged = [-2.5 0 9.75]", "keywords": ["conj", "complex conjugate", "complex", "elementwise", "gpu"], "suggestedPath": "/conj-3.m" }, { "id": "conj:4", "builtinKey": "conj", "builtinTitle": "conj", "builtinSlug": "conj", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Use conj on logical masks converted to doubles", "summary": "Compute the complex conjugate of scalars, vectors, matrices, or N-D tensors.", "code": "mask = logical([0 1 0; 1 1 0]);\nnumeric = conj(mask)", "output": "numeric =\n 0 1 0\n 1 1 0", "keywords": ["conj", "complex conjugate", "complex", "elementwise", "gpu"], "suggestedPath": "/conj-4.m" }, { "id": "conj:5", "builtinKey": "conj", "builtinTitle": "conj", "builtinSlug": "conj", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert MATLAB char arrays to numeric codes with conj", "summary": "Compute the complex conjugate of scalars, vectors, matrices, or N-D tensors.", "code": "chars = 'RunMat';\ncodes = conj(chars)\noutputClass = class(codes)", "output": "codes = [82 117 110 77 97 116];\noutputClass = 'double'", "keywords": ["conj", "complex conjugate", "complex", "elementwise", "gpu"], "suggestedPath": "/conj-5.m" }, { "id": "conj:6", "builtinKey": "conj", "builtinTitle": "conj", "builtinSlug": "conj", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Compute conjugate on GPU-resident arrays", "summary": "Compute the complex conjugate of scalars, vectors, matrices, or N-D tensors.", "code": "G = rand(4096, 256, \"gpuArray\");\nH = conj(G)", "keywords": ["conj", "complex conjugate", "complex", "elementwise", "gpu"], "suggestedPath": "/conj-6.m" }, { "id": "containers.map:1", "builtinKey": "containers.map", "builtinTitle": "containers.Map", "builtinSlug": "containers.map", "category": "containers/map", "categoryPath": ["containers", "map"], "exampleTitle": "Create an empty map with default types", "summary": "Create MATLAB-compatible dictionary objects that map keys to values.", "code": "m = containers.Map();\nm.KeyType\nm.ValueType\nm.Count", "output": "ans =\n 'char'\nans =\n 'any'\nans =\n 0", "keywords": ["containers.Map", "map", "dictionary", "hash map", "lookup"], "suggestedPath": "/containers-map-1.m" }, { "id": "containers.map:2", "builtinKey": "containers.map", "builtinTitle": "containers.Map", "builtinSlug": "containers.map", "category": "containers/map", "categoryPath": ["containers", "map"], "exampleTitle": "Build a map from paired cell arrays", "summary": "Create MATLAB-compatible dictionary objects that map keys to values.", "code": "keys = {'apple', 'pear', 'banana'};\nvals = {42, [1 2 3], true};\nfruit = containers.Map(keys, vals);\nenergy = fruit('apple')", "output": "energy =\n 42", "keywords": ["containers.Map", "map", "dictionary", "hash map", "lookup"], "suggestedPath": "/containers-map-2.m" }, { "id": "containers.map:3", "builtinKey": "containers.map", "builtinTitle": "containers.Map", "builtinSlug": "containers.map", "category": "containers/map", "categoryPath": ["containers", "map"], "exampleTitle": "Update an existing key and add a new one", "summary": "Create MATLAB-compatible dictionary objects that map keys to values.", "code": "fruit('apple') = 99;\nfruit('peach') = struct('ripe', true)", "output": "fruit('apple')\nans =\n 99", "keywords": ["containers.Map", "map", "dictionary", "hash map", "lookup"], "suggestedPath": "/containers-map-3.m" }, { "id": "containers.map:4", "builtinKey": "containers.map", "builtinTitle": "containers.Map", "builtinSlug": "containers.map", "category": "containers/map", "categoryPath": ["containers", "map"], "exampleTitle": "Query keys, values, and membership", "summary": "Create MATLAB-compatible dictionary objects that map keys to values.", "code": "allKeys = keys(fruit);\nallVals = values(fruit);\nmask = isKey(fruit, {'apple', 'durian'})", "output": "allKeys =\n 1×4 cell array\n {'apple'} {'pear'} {'banana'} {'peach'}\n\nallVals =\n 1×4 cell array\n {[99]} {[1 2 3]} {[1]} {1×1 struct}\n\nmask =\n 1×2 logical array\n 1 0", "keywords": ["containers.Map", "map", "dictionary", "hash map", "lookup"], "suggestedPath": "/containers-map-4.m" }, { "id": "containers.map:5", "builtinKey": "containers.map", "builtinTitle": "containers.Map", "builtinSlug": "containers.map", "category": "containers/map", "categoryPath": ["containers", "map"], "exampleTitle": "Remove keys and inspect the map length", "summary": "Create MATLAB-compatible dictionary objects that map keys to values.", "code": "remove(fruit, {'pear', 'banana'});\nn = length(fruit);\nremaining = keys(fruit)", "output": "n =\n 2\nremaining =\n 1×2 cell array\n {'apple'} {'peach'}", "keywords": ["containers.Map", "map", "dictionary", "hash map", "lookup"], "suggestedPath": "/containers-map-5.m" }, { "id": "contains:1", "builtinKey": "contains", "builtinTitle": "contains", "builtinSlug": "contains", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Check if a string contains a substring", "summary": "Determine whether text inputs contain specific patterns with MATLAB-compatible implicit expansion and case handling.", "code": "tf = contains(\"RunMat Accelerate\", \"Accelerate\")", "output": "tf = logical\n 1", "keywords": ["contains", "substring", "text search", "ignorecase", "string array"], "suggestedPath": "/contains-1.m" }, { "id": "contains:2", "builtinKey": "contains", "builtinTitle": "contains", "builtinSlug": "contains", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Perform a case-insensitive search", "summary": "Determine whether text inputs contain specific patterns with MATLAB-compatible implicit expansion and case handling.", "code": "tf = contains(\"RunMat\", \"run\", 'IgnoreCase', true)", "output": "tf = logical\n 1", "keywords": ["contains", "substring", "text search", "ignorecase", "string array"], "suggestedPath": "/contains-2.m" }, { "id": "contains:3", "builtinKey": "contains", "builtinTitle": "contains", "builtinSlug": "contains", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Apply a scalar pattern to every element of a string array", "summary": "Determine whether text inputs contain specific patterns with MATLAB-compatible implicit expansion and case handling.", "code": "labels = [\"alpha\" \"beta\" \"gamma\"];\ntf = contains(labels, \"a\")", "output": "tf = 1×3 logical array\n 1 1 1", "keywords": ["contains", "substring", "text search", "ignorecase", "string array"], "suggestedPath": "/contains-3.m" }, { "id": "contains:4", "builtinKey": "contains", "builtinTitle": "contains", "builtinSlug": "contains", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Match element-wise patterns with implicit expansion", "summary": "Determine whether text inputs contain specific patterns with MATLAB-compatible implicit expansion and case handling.", "code": "names = [\"hydrogen\"; \"helium\"; \"lithium\"];\npatterns = [\"gen\"; \"ium\"; \"iron\"];\ntf = contains(names, patterns)", "output": "tf = 3×1 logical array\n 1\n 1\n 0", "keywords": ["contains", "substring", "text search", "ignorecase", "string array"], "suggestedPath": "/contains-4.m" }, { "id": "contains:5", "builtinKey": "contains", "builtinTitle": "contains", "builtinSlug": "contains", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Search a cell array of character vectors", "summary": "Determine whether text inputs contain specific patterns with MATLAB-compatible implicit expansion and case handling.", "code": "C = {'Mercury', 'Venus', 'Mars'};\ntf = contains(C, 'us')", "output": "tf = 1×3 logical array\n 0 1 0", "keywords": ["contains", "substring", "text search", "ignorecase", "string array"], "suggestedPath": "/contains-5.m" }, { "id": "contains:6", "builtinKey": "contains", "builtinTitle": "contains", "builtinSlug": "contains", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Provide multiple patterns as a column vector", "summary": "Determine whether text inputs contain specific patterns with MATLAB-compatible implicit expansion and case handling.", "code": "tf = contains(\"saturn\", ['s'; 'n'; 'x'])", "output": "tf = 3×1 logical array\n 1\n 1\n 0", "keywords": ["contains", "substring", "text search", "ignorecase", "string array"], "suggestedPath": "/contains-6.m" }, { "id": "contains:7", "builtinKey": "contains", "builtinTitle": "contains", "builtinSlug": "contains", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Handle empty and missing text values", "summary": "Determine whether text inputs contain specific patterns with MATLAB-compatible implicit expansion and case handling.", "code": "texts = [\"\", \"<missing>\"];\ntf = contains(texts, \"\")", "output": "tf = 1×2 logical array\n 1 0", "keywords": ["contains", "substring", "text search", "ignorecase", "string array"], "suggestedPath": "/contains-7.m" }, { "id": "contour:1", "builtinKey": "contour", "builtinTitle": "contour", "builtinSlug": "contour", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a contour line plot from a scalar field", "summary": "Create contour line plots for level sets, iso-lines, and MATLAB `contour` workflows.", "code": "[X, Y] = meshgrid(-2:0.25:2, -2:0.25:2);\nZ = X .* exp(-X.^2 - Y.^2);\ncontour(X, Y, Z);", "keywords": ["contour", "contour lines", "iso-lines", "level sets", "matlab contour", "topographic lines"], "suggestedPath": "/contour-1.m" }, { "id": "contour:2", "builtinKey": "contour", "builtinTitle": "contour", "builtinSlug": "contour", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use explicit contour levels", "summary": "Create contour line plots for level sets, iso-lines, and MATLAB `contour` workflows.", "code": "[X, Y] = meshgrid(-2:0.25:2, -2:0.25:2);\nZ = X .* exp(-X.^2 - Y.^2);\ncontour(X, Y, Z, [0 0.25 0.5]);", "keywords": ["contour", "contour lines", "iso-lines", "level sets", "matlab contour", "topographic lines"], "suggestedPath": "/contour-2.m" }, { "id": "contour:3", "builtinKey": "contour", "builtinTitle": "contour", "builtinSlug": "contour", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect the returned contour handle", "summary": "Create contour line plots for level sets, iso-lines, and MATLAB `contour` workflows.", "code": "[X, Y] = meshgrid(1:20, 1:20);\nZ = X + Y;\nh = contour(X, Y, Z);\nget(h, 'Type')", "output": "ans =\n 'contour'", "keywords": ["contour", "contour lines", "iso-lines", "level sets", "matlab contour", "topographic lines"], "suggestedPath": "/contour-3.m" }, { "id": "contourf:1", "builtinKey": "contourf", "builtinTitle": "contourf", "builtinSlug": "contourf", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a filled contour plot", "summary": "Create filled contour plots for level regions, scalar fields, and MATLAB `contourf` workflows.", "code": "[X, Y] = meshgrid(-2:0.25:2, -2:0.25:2);\nZ = X .* exp(-X.^2 - Y.^2);\ncontourf(X, Y, Z);\ncolorbar;", "keywords": ["contourf", "filled contour plot", "level regions", "scalar field heatmap", "matlab contourf"], "suggestedPath": "/contourf-1.m" }, { "id": "contourf:2", "builtinKey": "contourf", "builtinTitle": "contourf", "builtinSlug": "contourf", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use explicit levels with a colormap", "summary": "Create filled contour plots for level regions, scalar fields, and MATLAB `contourf` workflows.", "code": "[X, Y] = meshgrid(-3:0.2:3, -3:0.2:3);\nZ = cos(X) .* sin(Y);\ncontourf(X, Y, Z, [-0.75 -0.25 0 0.25 0.75]);\ncolormap('turbo');", "keywords": ["contourf", "filled contour plot", "level regions", "scalar field heatmap", "matlab contourf"], "suggestedPath": "/contourf-2.m" }, { "id": "contourf:3", "builtinKey": "contourf", "builtinTitle": "contourf", "builtinSlug": "contourf", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect the returned contour-fill handle", "summary": "Create filled contour plots for level regions, scalar fields, and MATLAB `contourf` workflows.", "code": "[X, Y] = meshgrid(1:20, 1:20);\nZ = X - Y;\nh = contourf(X, Y, Z);\nget(h, 'Type')", "output": "ans =\n 'contour'", "keywords": ["contourf", "filled contour plot", "level regions", "scalar field heatmap", "matlab contourf"], "suggestedPath": "/contourf-3.m" }, { "id": "conv:1", "builtinKey": "conv", "builtinTitle": "conv", "builtinSlug": "conv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Computing the full convolution of two row vectors", "summary": "One-dimensional linear convolution with MATLAB-compatible padding modes.", "code": "a = [1 2 3];\nb = [1 1 1];\nc = conv(a, b)", "output": "c = [1 3 6 5 3]", "keywords": ["conv", "convolution", "linear convolution", "signal processing", "polynomial multiplication", "gpu"], "suggestedPath": "/conv-1.m" }, { "id": "conv:2", "builtinKey": "conv", "builtinTitle": "conv", "builtinSlug": "conv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Keeping the same length as the first input", "summary": "One-dimensional linear convolution with MATLAB-compatible padding modes.", "code": "kernel = [1 0 -1];\nsignal = [3 4 5 6 7];\nedge = conv(signal, kernel, 'same')", "output": "edge = [4 2 2 2 -6]", "keywords": ["conv", "convolution", "linear convolution", "signal processing", "polynomial multiplication", "gpu"], "suggestedPath": "/conv-2.m" }, { "id": "conv:3", "builtinKey": "conv", "builtinTitle": "conv", "builtinSlug": "conv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Valid convolution without zero padding", "summary": "One-dimensional linear convolution with MATLAB-compatible padding modes.", "code": "weights = [1 2 3 4];\nwindow = [1 1 1];\nvalid = conv(weights, window, 'valid')", "output": "valid = [6 9]", "keywords": ["conv", "convolution", "linear convolution", "signal processing", "polynomial multiplication", "gpu"], "suggestedPath": "/conv-3.m" }, { "id": "conv:4", "builtinKey": "conv", "builtinTitle": "conv", "builtinSlug": "conv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Convolving column vectors", "summary": "One-dimensional linear convolution with MATLAB-compatible padding modes.", "code": "a = (1:3)';\nb = [2; 0; -2];\nc = conv(a, b)", "output": "c =\n 2\n 4\n 4\n -4\n -6", "keywords": ["conv", "convolution", "linear convolution", "signal processing", "polynomial multiplication", "gpu"], "suggestedPath": "/conv-4.m" }, { "id": "conv:5", "builtinKey": "conv", "builtinTitle": "conv", "builtinSlug": "conv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Multiplying polynomials using convolution", "summary": "One-dimensional linear convolution with MATLAB-compatible padding modes.", "code": "p = [1 3 3 1]; % (x + 1)^3 coefficients\nq = [1 -1]; % (x - 1)\ncoeff = conv(p, q)", "output": "coeff = [1 2 0 -2 -1]", "keywords": ["conv", "convolution", "linear convolution", "signal processing", "polynomial multiplication", "gpu"], "suggestedPath": "/conv-5.m" }, { "id": "conv:6", "builtinKey": "conv", "builtinTitle": "conv", "builtinSlug": "conv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Complex-valued convolution", "summary": "One-dimensional linear convolution with MATLAB-compatible padding modes.", "code": "t = 0:3;\nsig = exp(1i * pi/4 * t);\nfilt = [1 2i];\nresp = conv(sig, filt)", "output": "resp =\n 1.0000 0.7071 + 2.7071i -1.4142 + 2.4142i -2.7071 + 0.7071i -1.4142 - 1.4142i", "keywords": ["conv", "convolution", "linear convolution", "signal processing", "polynomial multiplication", "gpu"], "suggestedPath": "/conv-6.m" }, { "id": "conv:7", "builtinKey": "conv", "builtinTitle": "conv", "builtinSlug": "conv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Scaling a signal by a scalar", "summary": "One-dimensional linear convolution with MATLAB-compatible padding modes.", "code": "s = [4 5 6];\ny = conv(2, s)", "output": "y = [8 10 12]", "keywords": ["conv", "convolution", "linear convolution", "signal processing", "polynomial multiplication", "gpu"], "suggestedPath": "/conv-7.m" }, { "id": "conv:8", "builtinKey": "conv", "builtinTitle": "conv", "builtinSlug": "conv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Using gpuArray inputs with automatic host fallback", "summary": "One-dimensional linear convolution with MATLAB-compatible padding modes.", "code": "g = gpuArray([1 2 3 4]);\nh = gpuArray([1 0 -1]);\nedge = conv(g, h, 'same');\nresult = gather(edge)", "keywords": ["conv", "convolution", "linear convolution", "signal processing", "polynomial multiplication", "gpu"], "suggestedPath": "/conv-8.m" }, { "id": "conv2:1", "builtinKey": "conv2", "builtinTitle": "conv2", "builtinSlug": "conv2", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Smoothing an image patch with a 3×3 averaging kernel", "summary": "Two-dimensional convolution with MATLAB-compatible padding modes.", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nh = ones(3) / 9;\nsmoothed = conv2(A, h, 'same')", "output": "smoothed =\n 1.3333 2.3333 1.7778\n 3.0000 5.0000 3.6667\n 2.6667 4.3333 3.1111", "keywords": ["conv2", "2d convolution", "image processing", "filtering", "gpu", "same", "valid"], "suggestedPath": "/conv2-1.m" }, { "id": "conv2:2", "builtinKey": "conv2", "builtinTitle": "conv2", "builtinSlug": "conv2", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Computing the full convolution of two small kernels", "summary": "Two-dimensional convolution with MATLAB-compatible padding modes.", "code": "K1 = [1 2; 3 4];\nK2 = [1 1; 1 1];\nC = conv2(K1, K2)", "output": "C =\n 1 3 2\n 4 10 6\n 3 7 4", "keywords": ["conv2", "2d convolution", "image processing", "filtering", "gpu", "same", "valid"], "suggestedPath": "/conv2-2.m" }, { "id": "conv2:3", "builtinKey": "conv2", "builtinTitle": "conv2", "builtinSlug": "conv2", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Extracting the same-sized result to preserve dimensions", "summary": "Two-dimensional convolution with MATLAB-compatible padding modes.", "code": "edge = conv2([1 2 3; 4 5 6; 7 8 9], [1 0 -1; 1 0 -1; 1 0 -1], 'same')", "output": "edge =\n -7 -4 7\n -15 -6 15\n -13 -4 13", "keywords": ["conv2", "2d convolution", "image processing", "filtering", "gpu", "same", "valid"], "suggestedPath": "/conv2-3.m" }, { "id": "conv2:4", "builtinKey": "conv2", "builtinTitle": "conv2", "builtinSlug": "conv2", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Valid convolution for sliding-window statistics", "summary": "Two-dimensional convolution with MATLAB-compatible padding modes.", "code": "block = magic(4);\nkernel = ones(2);\nvalid = conv2(block, kernel, 'valid')", "output": "valid =\n 34 26 34\n 32 34 36\n 34 42 34", "keywords": ["conv2", "2d convolution", "image processing", "filtering", "gpu", "same", "valid"], "suggestedPath": "/conv2-4.m" }, { "id": "conv2:5", "builtinKey": "conv2", "builtinTitle": "conv2", "builtinSlug": "conv2", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Using the separable form with column and row vectors", "summary": "Two-dimensional convolution with MATLAB-compatible padding modes.", "code": "hcol = [1; 2; 1];\nhrow = [1 0 -1];\nA = [3 4 5; 6 7 8; 9 10 11];\ngx = conv2(hcol, hrow, A, 'same')", "output": "gx =\n 27 -6 -27\n 28 -8 -28\n 15 -6 -15", "keywords": ["conv2", "2d convolution", "image processing", "filtering", "gpu", "same", "valid"], "suggestedPath": "/conv2-5.m" }, { "id": "conv2:6", "builtinKey": "conv2", "builtinTitle": "conv2", "builtinSlug": "conv2", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Convolving gpuArray inputs with transparent fallbacks", "summary": "Two-dimensional convolution with MATLAB-compatible padding modes.", "code": "G = gpuArray(rand(128, 128));\nH = gpuArray([1 2 1; 0 0 0; -1 -2 -1]);\ngx = conv2(G, H, 'same');\nresult = gather(gx)", "keywords": ["conv2", "2d convolution", "image processing", "filtering", "gpu", "same", "valid"], "suggestedPath": "/conv2-6.m" }, { "id": "copyfile:1", "builtinKey": "copyfile", "builtinTitle": "copyfile", "builtinSlug": "copyfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Copy a file into a new name in the same folder", "summary": "Copy files or folders with MATLAB-compatible status, diagnostic message, and message ID outputs.", "code": "fid = fopen(\"report.txt\", \"w\"); fclose(fid);\nstatus = copyfile(\"report.txt\", \"report_backup.txt\")", "output": "status =\n 1", "keywords": ["copyfile", "copy file", "copy folder", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/copyfile-1.m" }, { "id": "copyfile:2", "builtinKey": "copyfile", "builtinTitle": "copyfile", "builtinSlug": "copyfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Copy a file into an existing destination folder", "summary": "Copy files or folders with MATLAB-compatible status, diagnostic message, and message ID outputs.", "code": "mkdir(\"archive\");\nfid = fopen(\"summary.txt\", \"w\"); fclose(fid);\nstatus = copyfile(\"summary.txt\", \"archive\")", "output": "status =\n 1", "keywords": ["copyfile", "copy file", "copy folder", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/copyfile-2.m" }, { "id": "copyfile:3", "builtinKey": "copyfile", "builtinTitle": "copyfile", "builtinSlug": "copyfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Force overwrite an existing destination file", "summary": "Copy files or folders with MATLAB-compatible status, diagnostic message, and message ID outputs.", "code": "fid = fopen(\"draft.txt\", \"w\"); fclose(fid);\nfid = fopen(\"final.txt\", \"w\"); fclose(fid);\n[status, message, messageID] = copyfile(\"draft.txt\", \"final.txt\", \"f\");\nstatus\nmessage\nmessageID", "output": "status =\n 1\nmessage =\n\nmessageID =", "keywords": ["copyfile", "copy file", "copy folder", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/copyfile-3.m" }, { "id": "copyfile:4", "builtinKey": "copyfile", "builtinTitle": "copyfile", "builtinSlug": "copyfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Copy an entire folder tree", "summary": "Copy files or folders with MATLAB-compatible status, diagnostic message, and message ID outputs.", "code": "mkdir(\"data/raw\");\nfid = fopen(fullfile(\"data\", \"raw\", \"sample.dat\"), \"w\"); fclose(fid);\nstatus = copyfile(\"data\", \"data_copy\");\nstatus", "output": "status =\n 1", "keywords": ["copyfile", "copy file", "copy folder", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/copyfile-4.m" }, { "id": "copyfile:5", "builtinKey": "copyfile", "builtinTitle": "copyfile", "builtinSlug": "copyfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Copy multiple files with a wildcard pattern", "summary": "Copy files or folders with MATLAB-compatible status, diagnostic message, and message ID outputs.", "code": "fid = fopen(\"a.log\", \"w\"); fclose(fid);\nfid = fopen(\"b.log\", \"w\"); fclose(fid);\nmkdir(\"logs\");\nstatus = copyfile(\"*.log\", \"logs\")", "output": "status =\n 1", "keywords": ["copyfile", "copy file", "copy folder", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/copyfile-5.m" }, { "id": "copyfile:6", "builtinKey": "copyfile", "builtinTitle": "copyfile", "builtinSlug": "copyfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handle missing sources gracefully", "summary": "Copy files or folders with MATLAB-compatible status, diagnostic message, and message ID outputs.", "code": "[status, message, messageID] = copyfile(\"missing.txt\", \"dest.txt\");\nstatus\nmessage\nmessageID", "output": "status =\n 0\nmessage =\nSource \"missing.txt\" does not exist.\nmessageID =\nRunMat:COPYFILE:FileDoesNotExist", "keywords": ["copyfile", "copy file", "copy folder", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/copyfile-6.m" }, { "id": "corrcoef:1", "builtinKey": "corrcoef", "builtinTitle": "corrcoef", "builtinSlug": "corrcoef", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Calculating correlation between matrix columns", "summary": "Compute Pearson correlation coefficients for the columns of matrices or paired data sets.", "code": "A = [1 2 4; 2 4 1; 3 6 -1; 4 8 0];\nR = corrcoef(A)", "output": "R =\n 1.0000 1.0000 -0.8367\n 1.0000 1.0000 -0.8367\n -0.8367 -0.8367 1.0000", "keywords": ["corrcoef", "correlation", "statistics", "rows", "normalization", "gpu"], "suggestedPath": "/corrcoef-1.m" }, { "id": "corrcoef:2", "builtinKey": "corrcoef", "builtinTitle": "corrcoef", "builtinSlug": "corrcoef", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Correlating two separate data sets", "summary": "Compute Pearson correlation coefficients for the columns of matrices or paired data sets.", "code": "height = [1.72 1.84 1.65 1.91]';\nweight = [68.5 83.0 59.1 92.2]';\nR = corrcoef(height, weight)", "output": "R =\n 1.0000 0.9998\n 0.9998 1.0000", "keywords": ["corrcoef", "correlation", "statistics", "rows", "normalization", "gpu"], "suggestedPath": "/corrcoef-2.m" }, { "id": "corrcoef:3", "builtinKey": "corrcoef", "builtinTitle": "corrcoef", "builtinSlug": "corrcoef", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Ignoring rows that contain missing values", "summary": "Compute Pearson correlation coefficients for the columns of matrices or paired data sets.", "code": "X = [1 NaN 2;\n 3 4 5;\n 6 7 NaN];\nR = corrcoef(X, 'rows', 'complete')", "output": "R =\n NaN NaN NaN\n NaN NaN NaN\n NaN NaN NaN", "keywords": ["corrcoef", "correlation", "statistics", "rows", "normalization", "gpu"], "suggestedPath": "/corrcoef-3.m" }, { "id": "corrcoef:4", "builtinKey": "corrcoef", "builtinTitle": "corrcoef", "builtinSlug": "corrcoef", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Pairwise correlation with staggered NaNs", "summary": "Compute Pearson correlation coefficients for the columns of matrices or paired data sets.", "code": "X = [ 1 2 3;\n NaN 5 1;\n 4 NaN 6;\n 5 8 NaN];\nR = corrcoef(X, 'rows', 'pairwise')", "output": "R =\n 1 1 1\n 1 1 -1\n 1 -1 1", "keywords": ["corrcoef", "correlation", "statistics", "rows", "normalization", "gpu"], "suggestedPath": "/corrcoef-4.m" }, { "id": "corrcoef:5", "builtinKey": "corrcoef", "builtinTitle": "corrcoef", "builtinSlug": "corrcoef", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Using biased normalisation (`flag = 1`)", "summary": "Compute Pearson correlation coefficients for the columns of matrices or paired data sets.", "code": "A = [1 2; 3 4; 5 6];\nR = corrcoef(A, 1)", "output": "R =\n 1.0000 1.0000\n 1.0000 1.0000", "keywords": ["corrcoef", "correlation", "statistics", "rows", "normalization", "gpu"], "suggestedPath": "/corrcoef-5.m" }, { "id": "corrcoef:6", "builtinKey": "corrcoef", "builtinTitle": "corrcoef", "builtinSlug": "corrcoef", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Running `corrcoef` on `gpuArray` inputs", "summary": "Compute Pearson correlation coefficients for the columns of matrices or paired data sets.", "code": "G = gpuArray([1 2 4; 2 4 1; 3 6 -1; 4 8 0]);\nR = corrcoef(G);\nR_host = gather(R)", "keywords": ["corrcoef", "correlation", "statistics", "rows", "normalization", "gpu"], "suggestedPath": "/corrcoef-6.m" }, { "id": "cos:1", "builtinKey": "cos", "builtinTitle": "cos", "builtinSlug": "cos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Cosine of zero", "summary": "Cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "y = cos(0)", "output": "y = 1", "keywords": ["cos", "cosine", "trigonometry", "elementwise", "gpu", "like"], "suggestedPath": "/cos-1.m" }, { "id": "cos:2", "builtinKey": "cos", "builtinTitle": "cos", "builtinSlug": "cos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Cosine of evenly spaced angles", "summary": "Cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "theta = linspace(0, 2*pi, 5);\nvalues = cos(theta)", "output": "values = [1 0 -1 0 1]", "keywords": ["cos", "cosine", "trigonometry", "elementwise", "gpu", "like"], "suggestedPath": "/cos-2.m" }, { "id": "cos:3", "builtinKey": "cos", "builtinTitle": "cos", "builtinSlug": "cos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Cosine of complex data", "summary": "Cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "z = cos(1 + 2i)", "output": "z = 2.0327 - 3.0519i", "keywords": ["cos", "cosine", "trigonometry", "elementwise", "gpu", "like"], "suggestedPath": "/cos-3.m" }, { "id": "cos:4", "builtinKey": "cos", "builtinTitle": "cos", "builtinSlug": "cos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Cosine on a GPU tensor without manual residency", "summary": "Cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "A = reshape(0:5, [3 2]);\nresult = cos(A) % planner keeps the tensor on device when beneficial", "output": "result =\n 1.0000 -0.9900\n 0.5403 -0.6536\n -0.4161 0.2837", "keywords": ["cos", "cosine", "trigonometry", "elementwise", "gpu", "like"], "suggestedPath": "/cos-4.m" }, { "id": "cos:5", "builtinKey": "cos", "builtinTitle": "cos", "builtinSlug": "cos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Keeping results on the GPU with a `'like'` prototype", "summary": "Cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "proto = gpuArray.zeros(1, 1, 'single');\nangles = [0 pi/2 pi];\ndeviceResult = cos(angles, 'like', proto);\nresult = gather(deviceResult)", "output": "result = [1 0 -1]", "keywords": ["cos", "cosine", "trigonometry", "elementwise", "gpu", "like"], "suggestedPath": "/cos-5.m" }, { "id": "cos:6", "builtinKey": "cos", "builtinTitle": "cos", "builtinSlug": "cos", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Matching a host prototype while inputs live on the GPU", "summary": "Cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "G = gpuArray([0 1 2]);\nhostLike = cos(G, 'like', zeros(1, 'double'))", "output": "hostLike = [1 0.5403 -0.4161]", "keywords": ["cos", "cosine", "trigonometry", "elementwise", "gpu", "like"], "suggestedPath": "/cos-6.m" }, { "id": "cosh:1", "builtinKey": "cosh", "builtinTitle": "cosh", "builtinSlug": "cosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Hyperbolic cosine of a scalar", "summary": "Hyperbolic cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "y = cosh(2)", "output": "y = 3.7622", "keywords": ["cosh", "hyperbolic cosine", "trigonometry", "elementwise", "gpu"], "suggestedPath": "/cosh-1.m" }, { "id": "cosh:2", "builtinKey": "cosh", "builtinTitle": "cosh", "builtinSlug": "cosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Applying `cosh` elementwise to a vector", "summary": "Hyperbolic cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "x = linspace(-2, 2, 5);\ny = cosh(x)", "output": "y = [3.7622 1.5431 1.0000 1.5431 3.7622]", "keywords": ["cosh", "hyperbolic cosine", "trigonometry", "elementwise", "gpu"], "suggestedPath": "/cosh-2.m" }, { "id": "cosh:3", "builtinKey": "cosh", "builtinTitle": "cosh", "builtinSlug": "cosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Evaluating `cosh` on a matrix", "summary": "Hyperbolic cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "A = [0 0.5; 1.0 1.5];\nB = cosh(A)", "output": "B = [1.0000 1.1276; 1.5431 2.3524]", "keywords": ["cosh", "hyperbolic cosine", "trigonometry", "elementwise", "gpu"], "suggestedPath": "/cosh-3.m" }, { "id": "cosh:4", "builtinKey": "cosh", "builtinTitle": "cosh", "builtinSlug": "cosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Executing `cosh` on a GPU tensor", "summary": "Hyperbolic cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "G = gpuArray([0.25 0.75; 1.25 1.75]);\nresult_gpu = cosh(G);\nresult = gather(result_gpu)", "output": "result = [1.0314 1.2947; 1.8884 2.9642]", "keywords": ["cosh", "hyperbolic cosine", "trigonometry", "elementwise", "gpu"], "suggestedPath": "/cosh-4.m" }, { "id": "cosh:5", "builtinKey": "cosh", "builtinTitle": "cosh", "builtinSlug": "cosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Working with complex inputs", "summary": "Hyperbolic cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "z = 1 + 2i;\nw = cosh(z)", "output": "w = -0.6421 + 1.0686i", "keywords": ["cosh", "hyperbolic cosine", "trigonometry", "elementwise", "gpu"], "suggestedPath": "/cosh-5.m" }, { "id": "cosh:6", "builtinKey": "cosh", "builtinTitle": "cosh", "builtinSlug": "cosh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Hyperbolic cosine for character codes", "summary": "Hyperbolic cosine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "chars = 'AZ';\ncodes = cosh(chars)", "output": "codes = [8.4744e27 6.1020e38]", "keywords": ["cosh", "hyperbolic cosine", "trigonometry", "elementwise", "gpu"], "suggestedPath": "/cosh-6.m" }, { "id": "cov:1", "builtinKey": "cov", "builtinTitle": "cov", "builtinSlug": "cov", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Computing covariance of columns in a matrix", "summary": "Compute covariance matrices for vectors, matrices, or paired data sets.", "code": "X = [4.0 2.0 0.60;\n 4.2 2.1 0.59;\n 3.9 2.0 0.58;\n 4.3 2.1 0.62;\n 4.1 2.2 0.63];\nC = cov(X)", "output": "C =\n 0.0250 0.0075 0.0018\n 0.0075 0.0070 0.0014\n 0.0018 0.0014 0.0004", "keywords": ["cov", "covariance", "statistics", "weighted covariance", "gpu"], "suggestedPath": "/cov-1.m" }, { "id": "cov:2", "builtinKey": "cov", "builtinTitle": "cov", "builtinSlug": "cov", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Covariance between two vectors", "summary": "Compute covariance matrices for vectors, matrices, or paired data sets.", "code": "x = [1 2 3 4]';\ny = [10 11 9 12]';\nC = cov(x, y)", "output": "C =\n 1.6667 0.6667\n 0.6667 1.6667", "keywords": ["cov", "covariance", "statistics", "weighted covariance", "gpu"], "suggestedPath": "/cov-2.m" }, { "id": "cov:3", "builtinKey": "cov", "builtinTitle": "cov", "builtinSlug": "cov", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Weighted covariance with observation weights", "summary": "Compute covariance matrices for vectors, matrices, or paired data sets.", "code": "X = [4.0 2.0;\n 4.2 2.1;\n 3.9 2.0;\n 4.3 2.1;\n 4.1 2.2];\nw = [1 1 1 2 2];\nCw = cov(X, w)", "output": "Cw =\n 0.0224 0.0050\n 0.0050 0.0067", "keywords": ["cov", "covariance", "statistics", "weighted covariance", "gpu"], "suggestedPath": "/cov-3.m" }, { "id": "cov:4", "builtinKey": "cov", "builtinTitle": "cov", "builtinSlug": "cov", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Ignoring rows that contain missing values", "summary": "Compute covariance matrices for vectors, matrices, or paired data sets.", "code": "X = [1 NaN 2;\n 3 4 5;\n NaN 6 7;\n 8 9 10];\nC = cov(X, 'omitrows')", "output": "C =\n 12.5000 12.5000 12.5000\n 12.5000 12.5000 12.5000\n 12.5000 12.5000 12.5000", "keywords": ["cov", "covariance", "statistics", "weighted covariance", "gpu"], "suggestedPath": "/cov-4.m" }, { "id": "cov:5", "builtinKey": "cov", "builtinTitle": "cov", "builtinSlug": "cov", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Pairwise covariance with staggered NaNs", "summary": "Compute covariance matrices for vectors, matrices, or paired data sets.", "code": "X = [ 1 2 NaN;\n 4 NaN 6;\n 7 8 9];\nC = cov(X, 'partialrows')", "output": "C =\n 9.0000 18.0000 4.5000\n 18.0000 18.0000 NaN\n 4.5000 NaN 4.5000", "keywords": ["cov", "covariance", "statistics", "weighted covariance", "gpu"], "suggestedPath": "/cov-5.m" }, { "id": "cov:6", "builtinKey": "cov", "builtinTitle": "cov", "builtinSlug": "cov", "category": "stats/summary", "categoryPath": ["stats", "summary"], "exampleTitle": "Running covariance on `gpuArray` inputs", "summary": "Compute covariance matrices for vectors, matrices, or paired data sets.", "code": "X = [4.0 2.0 0.60;\n 4.2 2.1 0.59;\n 3.9 2.0 0.58;\n 4.3 2.1 0.62;\n 4.1 2.2 0.63];\nG = gpuArray(X);\nCG = cov(G);\nCG_host = gather(CG)", "output": "CG_host =\n 0.0250 0.0075 0.0018\n 0.0075 0.0070 0.0014\n 0.0018 0.0014 0.0004", "keywords": ["cov", "covariance", "statistics", "weighted covariance", "gpu"], "suggestedPath": "/cov-6.m" }, { "id": "csvread:1", "builtinKey": "csvread", "builtinTitle": "csvread", "builtinSlug": "csvread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Import Entire CSV File", "summary": "Read numeric data from a comma-separated text file with MATLAB-compatible zero-based ranges.", "code": "writematrix([1 2 3; 4 5 6], \"scores.csv\");\nM = csvread(\"scores.csv\");\ndisp(M);\ndelete(\"scores.csv\")", "output": "M =\n 1 2 3\n 4 5 6", "keywords": ["csvread", "csv", "comma-separated values", "numeric import", "range", "header"], "suggestedPath": "/csvread-1.m" }, { "id": "csvread:2", "builtinKey": "csvread", "builtinTitle": "csvread", "builtinSlug": "csvread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Skip Header Row And Column Using Zero-Based Offsets", "summary": "Read numeric data from a comma-separated text file with MATLAB-compatible zero-based ranges.", "code": "fid = fopen(\"with_header.csv\", \"w\");\nfprintf(fid, \"Name,Jan,Feb\\nalpha,1,2\\nbeta,3,4\\n\");\nfclose(fid);\n\nM = csvread(\"with_header.csv\", 1, 1);\ndisp(M);\ndelete(\"with_header.csv\");", "output": "M =\n 1 2\n 3 4", "keywords": ["csvread", "csv", "comma-separated values", "numeric import", "range", "header"], "suggestedPath": "/csvread-2.m" }, { "id": "csvread:3", "builtinKey": "csvread", "builtinTitle": "csvread", "builtinSlug": "csvread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Read A Specific Range With Numeric Vector Syntax", "summary": "Read numeric data from a comma-separated text file with MATLAB-compatible zero-based ranges.", "code": "fid = fopen(\"measurements.csv\", \"w\");\nfprintf(fid, \"10,11,12,13\\n14,15,16,17\\n18,19,20,21\\n22,23,24,25\\n\");\nfclose(fid);\n\nblock = csvread(\"measurements.csv\", 0, 0, [1 1 2 3])\ndelete(\"measurements.csv\");", "output": "block =\n 15 16 17\n 19 20 21", "keywords": ["csvread", "csv", "comma-separated values", "numeric import", "range", "header"], "suggestedPath": "/csvread-3.m" }, { "id": "csvread:4", "builtinKey": "csvread", "builtinTitle": "csvread", "builtinSlug": "csvread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Read A Block Using Excel-Style Range Notation", "summary": "Read numeric data from a comma-separated text file with MATLAB-compatible zero-based ranges.", "code": "fid = fopen(\"measurements2.csv\", \"w\");\nfprintf(fid, \"10,11,12\\n14,15,16\\n18,19,20\\n\");\nfclose(fid);\n\nsub = csvread(\"measurements2.csv\", 0, 0, \"B2:C3\")\ndelete(\"measurements2.csv\");", "output": "sub =\n 15 16\n 19 20", "keywords": ["csvread", "csv", "comma-separated values", "numeric import", "range", "header"], "suggestedPath": "/csvread-4.m" }, { "id": "csvread:5", "builtinKey": "csvread", "builtinTitle": "csvread", "builtinSlug": "csvread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Handle Empty Fields As Zeros", "summary": "Read numeric data from a comma-separated text file with MATLAB-compatible zero-based ranges.", "code": "fid = fopen(\"with_blanks.csv\", \"w\");\nfprintf(fid, \"1,,3\\n,5,\\n7,8,\\n\");\nfclose(fid);\n\nM = csvread(\"with_blanks.csv\")\ndelete(\"with_blanks.csv\");", "output": "M =\n 1 0 3\n 0 5 0\n 7 8 0", "keywords": ["csvread", "csv", "comma-separated values", "numeric import", "range", "header"], "suggestedPath": "/csvread-5.m" }, { "id": "csvread:6", "builtinKey": "csvread", "builtinTitle": "csvread", "builtinSlug": "csvread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Read Numeric Data From A File In The Home Directory", "summary": "Read numeric data from a comma-separated text file with MATLAB-compatible zero-based ranges.", "code": "homePath = fullfile(getenv(\"HOME\"), \"runmat_csvread_home.csv\");\nfid = fopen(homePath, \"w\");\nfprintf(fid, \"9,10\\n11,12\\n\");\nfclose(fid);\n\nM = csvread(fullfile(\"~\", \"runmat_csvread_home.csv\"), 0, 0);\ndisp(M);\ndelete(homePath);", "output": "M =\n 9 10\n 11 12", "keywords": ["csvread", "csv", "comma-separated values", "numeric import", "range", "header"], "suggestedPath": "/csvread-6.m" }, { "id": "csvread:7", "builtinKey": "csvread", "builtinTitle": "csvread", "builtinSlug": "csvread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Detect Errors When Text Appears In Numeric Columns", "summary": "Read numeric data from a comma-separated text file with MATLAB-compatible zero-based ranges.", "code": "fid = fopen(\"bad.csv\", \"w\");\nfprintf(fid, \"1,2,3\\n4,error,6\\n\");\nfclose(fid);\n\ntry\n csvread(\"bad.csv\");\ncatch err\n disp(err.message);\nend\ndelete(\"bad.csv\");", "output": "csvread: nonnumeric token error at row 2 column 2", "keywords": ["csvread", "csv", "comma-separated values", "numeric import", "range", "header"], "suggestedPath": "/csvread-7.m" }, { "id": "csvwrite:1", "builtinKey": "csvwrite", "builtinTitle": "csvwrite", "builtinSlug": "csvwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Writing a numeric matrix to CSV", "summary": "Write numeric matrices to comma-separated text files using MATLAB-compatible offsets.", "code": "A = [1 2 3; 4 5 6];\ncsvwrite(\"scores.csv\", A)", "keywords": ["csvwrite", "csv", "write", "comma-separated values", "numeric export", "row offset", "column offset"], "suggestedPath": "/csvwrite-1.m" }, { "id": "csvwrite:2", "builtinKey": "csvwrite", "builtinTitle": "csvwrite", "builtinSlug": "csvwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Starting output after a header row", "summary": "Write numeric matrices to comma-separated text files using MATLAB-compatible offsets.", "code": "fid = fopen(\"with_header.csv\", \"w\");\nfprintf(fid, \"Name,Jan,Feb\\nalpha,1,2\\nbeta,3,4\\n\");\nfclose(fid);\n\ncsvwrite(\"with_header.csv\", [10 20; 30 40], 1, 0)", "keywords": ["csvwrite", "csv", "write", "comma-separated values", "numeric export", "row offset", "column offset"], "suggestedPath": "/csvwrite-2.m" }, { "id": "csvwrite:3", "builtinKey": "csvwrite", "builtinTitle": "csvwrite", "builtinSlug": "csvwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Skipping leading columns before data", "summary": "Write numeric matrices to comma-separated text files using MATLAB-compatible offsets.", "code": "B = magic(3);\ncsvwrite(\"offset_columns.csv\", B, 0, 2)", "keywords": ["csvwrite", "csv", "write", "comma-separated values", "numeric export", "row offset", "column offset"], "suggestedPath": "/csvwrite-3.m" }, { "id": "csvwrite:4", "builtinKey": "csvwrite", "builtinTitle": "csvwrite", "builtinSlug": "csvwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Exporting logical masks as numeric zeros and ones", "summary": "Write numeric matrices to comma-separated text files using MATLAB-compatible offsets.", "code": "mask = [true false true; false true false];\ncsvwrite(\"mask.csv\", mask)", "keywords": ["csvwrite", "csv", "write", "comma-separated values", "numeric export", "row offset", "column offset"], "suggestedPath": "/csvwrite-4.m" }, { "id": "csvwrite:5", "builtinKey": "csvwrite", "builtinTitle": "csvwrite", "builtinSlug": "csvwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Writing GPU-resident data without manual gather", "summary": "Write numeric matrices to comma-separated text files using MATLAB-compatible offsets.", "code": "G = gpuArray(single([0.1 0.2 0.3]));\nbytes = csvwrite(\"gpu_values.csv\", G)", "output": "bytes = 12", "keywords": ["csvwrite", "csv", "write", "comma-separated values", "numeric export", "row offset", "column offset"], "suggestedPath": "/csvwrite-5.m" }, { "id": "csvwrite:6", "builtinKey": "csvwrite", "builtinTitle": "csvwrite", "builtinSlug": "csvwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Persisting a scalar value for downstream tools", "summary": "Write numeric matrices to comma-separated text files using MATLAB-compatible offsets.", "code": "total = sum(rand(5));\ncsvwrite(\"scalar.csv\", total)", "keywords": ["csvwrite", "csv", "write", "comma-separated values", "numeric export", "row offset", "column offset"], "suggestedPath": "/csvwrite-6.m" }, { "id": "ctranspose:1", "builtinKey": "ctranspose", "builtinTitle": "ctranspose", "builtinSlug": "ctranspose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Conjugate transpose of a complex matrix", "summary": "Swap the first two dimensions of arrays and conjugate complex values.", "code": "Z = [1+2i 3-4i; 5+0i 6-7i];\nH = ctranspose(Z)", "output": "H =\n 1 - 2i 5 - 0i\n 3 + 4i 6 + 7i", "keywords": ["ctranspose", "conjugate transpose", "hermitian", "gpu", "matrix transpose"], "suggestedPath": "/ctranspose-1.m" }, { "id": "ctranspose:2", "builtinKey": "ctranspose", "builtinTitle": "ctranspose", "builtinSlug": "ctranspose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Conjugate transpose of a real matrix equals the plain transpose", "summary": "Swap the first two dimensions of arrays and conjugate complex values.", "code": "A = [1 2 3; 4 5 6];\nB = ctranspose(A)", "output": "B =\n 1 4\n 2 5\n 3 6", "keywords": ["ctranspose", "conjugate transpose", "hermitian", "gpu", "matrix transpose"], "suggestedPath": "/ctranspose-2.m" }, { "id": "ctranspose:3", "builtinKey": "ctranspose", "builtinTitle": "ctranspose", "builtinSlug": "ctranspose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Conjugate transpose turns row vectors into column vectors", "summary": "Swap the first two dimensions of arrays and conjugate complex values.", "code": "row = [1-2i, 3+4i, 5];\ncol = ctranspose(row);\nsize(col)", "output": "ans = [3 1]", "keywords": ["ctranspose", "conjugate transpose", "hermitian", "gpu", "matrix transpose"], "suggestedPath": "/ctranspose-3.m" }, { "id": "ctranspose:4", "builtinKey": "ctranspose", "builtinTitle": "ctranspose", "builtinSlug": "ctranspose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Conjugate transpose of a complex scalar", "summary": "Swap the first two dimensions of arrays and conjugate complex values.", "code": "z = 2 + 3i;\nresult = ctranspose(z)", "output": "result = 2 - 3i", "keywords": ["ctranspose", "conjugate transpose", "hermitian", "gpu", "matrix transpose"], "suggestedPath": "/ctranspose-4.m" }, { "id": "ctranspose:5", "builtinKey": "ctranspose", "builtinTitle": "ctranspose", "builtinSlug": "ctranspose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Conjugate transpose of text data preserves characters", "summary": "Swap the first two dimensions of arrays and conjugate complex values.", "code": "C = ['r' 'u' 'n'; 'm' 'a' 't'];\nCT = ctranspose(C)", "output": "CT =\n 'rm'\n 'ua'\n 'nt'", "keywords": ["ctranspose", "conjugate transpose", "hermitian", "gpu", "matrix transpose"], "suggestedPath": "/ctranspose-5.m" }, { "id": "ctranspose:6", "builtinKey": "ctranspose", "builtinTitle": "ctranspose", "builtinSlug": "ctranspose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Conjugate transpose of a gpuArray without leaving the device", "summary": "Swap the first two dimensions of arrays and conjugate complex values.", "code": "G = gpuArray(rand(1024, 64) + 1i * rand(1024, 64));\nGT = ctranspose(G)", "keywords": ["ctranspose", "conjugate transpose", "hermitian", "gpu", "matrix transpose"], "suggestedPath": "/ctranspose-6.m" }, { "id": "cummax:1", "builtinKey": "cummax", "builtinTitle": "cummax", "builtinSlug": "cummax", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Tracking column-wise running maxima", "summary": "Running maximum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "A = [4 2 7; 3 5 1];\n[Y, I] = cummax(A);\ndisp(Y);\ndisp(I)", "output": "Y =\n 4 2 7\n 4 5 7\nI =\n 1 1 1\n 1 2 1", "keywords": ["cummax", "cumulative maximum", "running maximum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummax-1.m" }, { "id": "cummax:2", "builtinKey": "cummax", "builtinTitle": "cummax", "builtinSlug": "cummax", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Requesting running maxima across rows", "summary": "Running maximum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "A = [4 2 7; 3 5 1];\n[Y, I] = cummax(A, 2);\ndisp(Y);\ndisp(I)", "output": "Y =\n 4 4 7\n 3 5 5\nI =\n 1 1 3\n 1 2 2", "keywords": ["cummax", "cumulative maximum", "running maximum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummax-2.m" }, { "id": "cummax:3", "builtinKey": "cummax", "builtinTitle": "cummax", "builtinSlug": "cummax", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Getting cumulative maxima in reverse order", "summary": "Running maximum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "v = [8 3 6 2];\n[Y, I] = cummax(v, \"reverse\")", "output": "Y = [8 6 6 2]\nI = [1 3 3 4]", "keywords": ["cummax", "cumulative maximum", "running maximum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummax-3.m" }, { "id": "cummax:4", "builtinKey": "cummax", "builtinTitle": "cummax", "builtinSlug": "cummax", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring NaN values in running maxima", "summary": "Running maximum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "v = [NaN 5 NaN 3];\n[Y, I] = cummax(v, \"omitnan\")", "output": "Y = [NaN 5 5 5]\nI = [NaN 2 2 2]", "keywords": ["cummax", "cumulative maximum", "running maximum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummax-4.m" }, { "id": "cummax:5", "builtinKey": "cummax", "builtinTitle": "cummax", "builtinSlug": "cummax", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Capturing running maxima and indices on the GPU", "summary": "Running maximum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray([3 1 4 1 5]);\n[Y, I] = cummax(G);\nhostY = gather(Y)\nhostI = gather(I)", "output": "hostY = [3 3 4 4 5];\nhostI = [1 1 3 3 5]", "keywords": ["cummax", "cumulative maximum", "running maximum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummax-5.m" }, { "id": "cummin:1", "builtinKey": "cummin", "builtinTitle": "cummin", "builtinSlug": "cummin", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Tracking column-wise running minima", "summary": "Running minimum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "A = [4 2 7; 3 5 1];\n[Y, I] = cummin(A)", "output": "Y =\n 4 2 7\n 3 2 1\nI =\n 1 1 1\n 2 1 2", "keywords": ["cummin", "cumulative minimum", "running minimum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummin-1.m" }, { "id": "cummin:2", "builtinKey": "cummin", "builtinTitle": "cummin", "builtinSlug": "cummin", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Requesting running minima across rows", "summary": "Running minimum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "A = [4 2 7; 3 5 1];\n[Y, I] = cummin(A, 2)", "output": "Y =\n 4 2 2\n 3 3 1\nI =\n 1 2 2\n 1 1 3", "keywords": ["cummin", "cumulative minimum", "running minimum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummin-2.m" }, { "id": "cummin:3", "builtinKey": "cummin", "builtinTitle": "cummin", "builtinSlug": "cummin", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Getting cumulative minima in reverse order", "summary": "Running minimum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "v = [8 3 6 2];\n[Y, I] = cummin(v, \"reverse\")", "output": "Y = [2 2 2 2]\nI = [4 4 4 4]", "keywords": ["cummin", "cumulative minimum", "running minimum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummin-3.m" }, { "id": "cummin:4", "builtinKey": "cummin", "builtinTitle": "cummin", "builtinSlug": "cummin", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring NaN values in running minima", "summary": "Running minimum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "v = [NaN 5 NaN 3];\n[Y, I] = cummin(v, \"omitnan\")", "output": "Y = [NaN 5 5 3]\nI = [NaN 2 2 4]", "keywords": ["cummin", "cumulative minimum", "running minimum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummin-4.m" }, { "id": "cummin:5", "builtinKey": "cummin", "builtinTitle": "cummin", "builtinSlug": "cummin", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Capturing running minima and indices on the GPU", "summary": "Running minimum and index tracking for scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray([3 1 4 1 5]);\n[Y, I] = cummin(G);\nhostY = gather(Y);\nhostI = gather(I)", "keywords": ["cummin", "cumulative minimum", "running minimum", "reverse", "omitnan", "indices", "gpu"], "suggestedPath": "/cummin-5.m" }, { "id": "cumprod:1", "builtinKey": "cumprod", "builtinTitle": "cumprod", "builtinSlug": "cumprod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Running products down each column (default dimension)", "summary": "Cumulative product of scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 2 3; 4 5 6];\ncolumnProducts = cumprod(A)", "output": "columnProducts =\n 1 2 3\n 4 10 18", "keywords": ["cumprod", "cumulative product", "running product", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumprod-1.m" }, { "id": "cumprod:2", "builtinKey": "cumprod", "builtinTitle": "cumprod", "builtinSlug": "cumprod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Tracking cumulative products across rows", "summary": "Cumulative product of scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 2 3; 4 5 6];\nrowProducts = cumprod(A, 2)", "output": "rowProducts =\n 1 2 6\n 4 20 120", "keywords": ["cumprod", "cumulative product", "running product", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumprod-2.m" }, { "id": "cumprod:3", "builtinKey": "cumprod", "builtinTitle": "cumprod", "builtinSlug": "cumprod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Reversing the accumulation direction", "summary": "Cumulative product of scalars, vectors, matrices, or N-D tensors.", "code": "v = [2 3 4 5];\nreverseProducts = cumprod(v, \"reverse\")", "output": "reverseProducts =\n 120 60 20 5", "keywords": ["cumprod", "cumulative product", "running product", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumprod-3.m" }, { "id": "cumprod:4", "builtinKey": "cumprod", "builtinTitle": "cumprod", "builtinSlug": "cumprod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring NaN values while multiplying", "summary": "Cumulative product of scalars, vectors, matrices, or N-D tensors.", "code": "v = [2 NaN 4 NaN 3];\nrunning = cumprod(v, \"omitnan\")", "output": "running =\n 2 2 8 8 24", "keywords": ["cumprod", "cumulative product", "running product", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumprod-4.m" }, { "id": "cumprod:5", "builtinKey": "cumprod", "builtinTitle": "cumprod", "builtinSlug": "cumprod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Computing a cumulative product inside a GPU workflow", "summary": "Cumulative product of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray(1 + 0.1*rand(1, 5));\ntotals = cumprod(G);\nhostResult = gather(totals)", "keywords": ["cumprod", "cumulative product", "running product", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumprod-5.m" }, { "id": "cumsum:1", "builtinKey": "cumsum", "builtinTitle": "cumsum", "builtinSlug": "cumsum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Running totals down each column (default dimension)", "summary": "Cumulative sum of scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 2 3; 4 5 6];\ncolumnTotals = cumsum(A)", "output": "columnTotals =\n 1 2 3\n 5 7 9", "keywords": ["cumsum", "cumulative sum", "running total", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumsum-1.m" }, { "id": "cumsum:2", "builtinKey": "cumsum", "builtinTitle": "cumsum", "builtinSlug": "cumsum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Tracking cumulative sums across rows", "summary": "Cumulative sum of scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 2 3; 4 5 6];\nrowTotals = cumsum(A, 2)", "output": "rowTotals =\n 1 3 6\n 4 9 15", "keywords": ["cumsum", "cumulative sum", "running total", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumsum-2.m" }, { "id": "cumsum:3", "builtinKey": "cumsum", "builtinTitle": "cumsum", "builtinSlug": "cumsum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Reversing the direction of accumulation", "summary": "Cumulative sum of scalars, vectors, matrices, or N-D tensors.", "code": "v = [1 3 5 7];\nreverseTotals = cumsum(v, \"reverse\")", "output": "reverseTotals =\n 16 15 12 7", "keywords": ["cumsum", "cumulative sum", "running total", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumsum-3.m" }, { "id": "cumsum:4", "builtinKey": "cumsum", "builtinTitle": "cumsum", "builtinSlug": "cumsum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring NaN values while accumulating", "summary": "Cumulative sum of scalars, vectors, matrices, or N-D tensors.", "code": "v = [2 NaN 5 NaN 1];\nrunning = cumsum(v, \"omitnan\")", "output": "running =\n 2 2 7 7 8", "keywords": ["cumsum", "cumulative sum", "running total", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumsum-4.m" }, { "id": "cumsum:5", "builtinKey": "cumsum", "builtinTitle": "cumsum", "builtinSlug": "cumsum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Computing a cumulative sum inside a GPU workflow", "summary": "Cumulative sum of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray(rand(1, 5));\ntotals = cumsum(G);\nhostResult = gather(totals)", "keywords": ["cumsum", "cumulative sum", "running total", "reverse", "omitnan", "gpu"], "suggestedPath": "/cumsum-5.m" }, { "id": "deconv:1", "builtinKey": "deconv", "builtinTitle": "deconv", "builtinSlug": "deconv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Recovering a factor from a polynomial product", "summary": "Divide one polynomial (or 1-D sequence) by another, returning the quotient and remainder.", "code": "p = conv([1 2], [1 -3 2]); % Multiply two polynomials\n[q, r] = deconv(p, [1 2]) % Divide by the first factor", "output": "q = [1 -3 2];\nr = 0", "keywords": ["deconv", "deconvolution", "polynomial division", "signal", "gpu"], "suggestedPath": "/deconv-1.m" }, { "id": "deconv:2", "builtinKey": "deconv", "builtinTitle": "deconv", "builtinSlug": "deconv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Obtaining a non-zero remainder", "summary": "Divide one polynomial (or 1-D sequence) by another, returning the quotient and remainder.", "code": "[q, r] = deconv([1 4 7], [1 2])", "output": "q = [1 2];\nr = [3]", "keywords": ["deconv", "deconvolution", "polynomial division", "signal", "gpu"], "suggestedPath": "/deconv-2.m" }, { "id": "deconv:3", "builtinKey": "deconv", "builtinTitle": "deconv", "builtinSlug": "deconv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Dividing by a longer sequence", "summary": "Divide one polynomial (or 1-D sequence) by another, returning the quotient and remainder.", "code": "[q, r] = deconv([3 5], [1 0 2])", "output": "q = 0;\nr = [3 5]", "keywords": ["deconv", "deconvolution", "polynomial division", "signal", "gpu"], "suggestedPath": "/deconv-3.m" }, { "id": "deconv:4", "builtinKey": "deconv", "builtinTitle": "deconv", "builtinSlug": "deconv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Handling leading zeros explicitly", "summary": "Divide one polynomial (or 1-D sequence) by another, returning the quotient and remainder.", "code": "b = [0 0 1 2];\na = [0 1 1];\n[q, r] = deconv(b, a)", "output": "q = [1];\nr = [1]", "keywords": ["deconv", "deconvolution", "polynomial division", "signal", "gpu"], "suggestedPath": "/deconv-4.m" }, { "id": "deconv:5", "builtinKey": "deconv", "builtinTitle": "deconv", "builtinSlug": "deconv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Complex polynomial division", "summary": "Divide one polynomial (or 1-D sequence) by another, returning the quotient and remainder.", "code": "b = [1+2i 3-4i 2];\na = [1-i 2+i];\n[q, r] = deconv(b, a)", "output": "q = [-0.5+1.5i 6-0.5i];\nr = [-10.5-5i]", "keywords": ["deconv", "deconvolution", "polynomial division", "signal", "gpu"], "suggestedPath": "/deconv-5.m" }, { "id": "deconv:6", "builtinKey": "deconv", "builtinTitle": "deconv", "builtinSlug": "deconv", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "GPU inputs with automatic host fallback", "summary": "Divide one polynomial (or 1-D sequence) by another, returning the quotient and remainder.", "code": "b = gpuArray([1 3 3 1]);\na = gpuArray([1 1]);\n[q, r] = deconv(b, a); % Quotient stays on the GPU when possible\nr = gather(r); % Explicitly gather the remainder if needed on the host", "keywords": ["deconv", "deconvolution", "polynomial division", "signal", "gpu"], "suggestedPath": "/deconv-6.m" }, { "id": "delete:1", "builtinKey": "delete", "builtinTitle": "delete", "builtinSlug": "delete", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Deleting a single temporary file", "summary": "Remove files using MATLAB-compatible wildcard expansion, array inputs, and error diagnostics.", "code": "fname = \"scratch.txt\";\nfid = fopen(fname, \"w\");\nfclose(fid);\ndelete(fname)", "keywords": ["delete", "remove file", "wildcard delete", "cleanup", "temporary files", "MATLAB delete"], "suggestedPath": "/delete-1.m" }, { "id": "delete:2", "builtinKey": "delete", "builtinTitle": "delete", "builtinSlug": "delete", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Removing multiple files with a wildcard pattern", "summary": "Remove files using MATLAB-compatible wildcard expansion, array inputs, and error diagnostics.", "code": "logs = [\"log-01.txt\", \"log-02.txt\"];\nfor i = 1:numel(logs)\n fid = fopen(logs(i), \"w\");\n fclose(fid);\nend\nfor i = 1:numel(logs)\n delete(logs(i));\nend", "keywords": ["delete", "remove file", "wildcard delete", "cleanup", "temporary files", "MATLAB delete"], "suggestedPath": "/delete-2.m" }, { "id": "delete:3", "builtinKey": "delete", "builtinTitle": "delete", "builtinSlug": "delete", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Deleting files listed in a string array", "summary": "Remove files using MATLAB-compatible wildcard expansion, array inputs, and error diagnostics.", "code": "files = [\"stageA.dat\", \"stageB.dat\"];\nfor i = 1:numel(files)\n fid = fopen(files(i), \"w\");\n fclose(fid);\nend\ndelete(files)", "keywords": ["delete", "remove file", "wildcard delete", "cleanup", "temporary files", "MATLAB delete"], "suggestedPath": "/delete-3.m" }, { "id": "delete:4", "builtinKey": "delete", "builtinTitle": "delete", "builtinSlug": "delete", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handling missing files safely with try/catch", "summary": "Remove files using MATLAB-compatible wildcard expansion, array inputs, and error diagnostics.", "code": "try\n delete(\"missing-file.txt\");\ncatch err\n disp(err.identifier)\n disp(err.message)\nend", "keywords": ["delete", "remove file", "wildcard delete", "cleanup", "temporary files", "MATLAB delete"], "suggestedPath": "/delete-4.m" }, { "id": "delete:5", "builtinKey": "delete", "builtinTitle": "delete", "builtinSlug": "delete", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Cleaning up build artifacts stored under your home folder", "summary": "Remove files using MATLAB-compatible wildcard expansion, array inputs, and error diagnostics.", "code": "delete(\"~/runmat/build/*.o\")", "keywords": ["delete", "remove file", "wildcard delete", "cleanup", "temporary files", "MATLAB delete"], "suggestedPath": "/delete-5.m" }, { "id": "delete:6", "builtinKey": "delete", "builtinTitle": "delete", "builtinSlug": "delete", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Deleting char-matrix filenames generated programmatically", "summary": "Remove files using MATLAB-compatible wildcard expansion, array inputs, and error diagnostics.", "code": "names = char(\"stage1.tmp\", \"stage2.tmp\");\nfor row = 1:size(names, 1)\n fname = strtrim(names(row, :));\n fid = fopen(fname, \"w\");\n fclose(fid);\nend\ndelete(names)", "keywords": ["delete", "remove file", "wildcard delete", "cleanup", "temporary files", "MATLAB delete"], "suggestedPath": "/delete-6.m" }, { "id": "delete:7", "builtinKey": "delete", "builtinTitle": "delete", "builtinSlug": "delete", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Deleting graphics handles after use", "summary": "Remove files using MATLAB-compatible wildcard expansion, array inputs, and error diagnostics.", "code": "fig = figure;\ndelete(fig);\ntf = isvalid(fig)", "output": "tf =\n 0", "keywords": ["delete", "remove file", "wildcard delete", "cleanup", "temporary files", "MATLAB delete"], "suggestedPath": "/delete-7.m" }, { "id": "det:1", "builtinKey": "det", "builtinTitle": "det", "builtinSlug": "det", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Determinant Of A 2x2 Matrix", "summary": "Compute the determinant of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "A = [4 -2; 1 3];\nd = det(A)", "output": "d = 14", "keywords": ["det", "determinant", "linear algebra", "matrix", "gpu"], "suggestedPath": "/det-1.m" }, { "id": "det:2", "builtinKey": "det", "builtinTitle": "det", "builtinSlug": "det", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Checking Zero Determinant For Singular Matrix", "summary": "Compute the determinant of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "B = [1 2; 2 4];\nd = det(B)", "output": "d = 0", "keywords": ["det", "determinant", "linear algebra", "matrix", "gpu"], "suggestedPath": "/det-2.m" }, { "id": "det:3", "builtinKey": "det", "builtinTitle": "det", "builtinSlug": "det", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Determinant Of A Complex Matrix", "summary": "Compute the determinant of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "C = [1+2i 0; 3i 4-1i];\nd = det(C)", "output": "d = 6 + 7i", "keywords": ["det", "determinant", "linear algebra", "matrix", "gpu"], "suggestedPath": "/det-3.m" }, { "id": "det:4", "builtinKey": "det", "builtinTitle": "det", "builtinSlug": "det", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Determinant Equals Product Of Diagonal For Triangular Matrix", "summary": "Compute the determinant of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "U = [3 2 1; 0 5 -1; 0 0 2];\nd = det(U)", "output": "d = 30", "keywords": ["det", "determinant", "linear algebra", "matrix", "gpu"], "suggestedPath": "/det-4.m" }, { "id": "det:5", "builtinKey": "det", "builtinTitle": "det", "builtinSlug": "det", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Determinant Of An Empty Matrix", "summary": "Compute the determinant of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "d = det([])", "output": "d = 1", "keywords": ["det", "determinant", "linear algebra", "matrix", "gpu"], "suggestedPath": "/det-5.m" }, { "id": "det:6", "builtinKey": "det", "builtinTitle": "det", "builtinSlug": "det", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Using `det` With `gpuArray` Data", "summary": "Compute the determinant of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "G = gpuArray([2 0 0; 0 3 0; 1 0 4]);\nd_gpu = det(G); % stays on the GPU when a provider is active\nd = gather(d_gpu)", "output": "d = 24", "keywords": ["det", "determinant", "linear algebra", "matrix", "gpu"], "suggestedPath": "/det-6.m" }, { "id": "diag:1", "builtinKey": "diag", "builtinTitle": "diag", "builtinSlug": "diag", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Creating a diagonal matrix from a vector", "summary": "Create diagonal matrices from vectors or extract diagonals from matrices.", "code": "v = [4 5 6];\nD = diag(v)", "output": "D =\n 4 0 0\n 0 5 0\n 0 0 6", "keywords": ["diag", "diagonal", "matrix", "extraction", "gpu"], "suggestedPath": "/diag-1.m" }, { "id": "diag:2", "builtinKey": "diag", "builtinTitle": "diag", "builtinSlug": "diag", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Placing a vector on an upper diagonal", "summary": "Create diagonal matrices from vectors or extract diagonals from matrices.", "code": "v = [1 2 3];\nU = diag(v, 1)", "output": "U =\n 0 1 0 0\n 0 0 2 0\n 0 0 0 3\n 0 0 0 0", "keywords": ["diag", "diagonal", "matrix", "extraction", "gpu"], "suggestedPath": "/diag-2.m" }, { "id": "diag:3", "builtinKey": "diag", "builtinTitle": "diag", "builtinSlug": "diag", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Extracting a subdiagonal as a column vector", "summary": "Create diagonal matrices from vectors or extract diagonals from matrices.", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nd = diag(A, -1)", "output": "d =\n 4\n 8", "keywords": ["diag", "diagonal", "matrix", "extraction", "gpu"], "suggestedPath": "/diag-3.m" }, { "id": "diag:4", "builtinKey": "diag", "builtinTitle": "diag", "builtinSlug": "diag", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Building a diagonal matrix from a logical mask", "summary": "Create diagonal matrices from vectors or extract diagonals from matrices.", "code": "mask = logical([1 0 1 0]);\nM = diag(mask)", "output": "M =\n 1 0 0 0\n 0 0 0 0\n 0 0 1 0\n 0 0 0 0", "keywords": ["diag", "diagonal", "matrix", "extraction", "gpu"], "suggestedPath": "/diag-4.m" }, { "id": "diag:5", "builtinKey": "diag", "builtinTitle": "diag", "builtinSlug": "diag", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Keeping diagonal results on the GPU", "summary": "Create diagonal matrices from vectors or extract diagonals from matrices.", "code": "G = gpuArray([2; 4; 8]);\nD = diag(G);\nfirstTwo = gather(D(1:2, 1:2))", "output": "firstTwo =\n 2 0\n 0 4", "keywords": ["diag", "diagonal", "matrix", "extraction", "gpu"], "suggestedPath": "/diag-5.m" }, { "id": "diag:6", "builtinKey": "diag", "builtinTitle": "diag", "builtinSlug": "diag", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Returning a vector without creating a matrix", "summary": "Create diagonal matrices from vectors or extract diagonals from matrices.", "code": "v = [10 20 30];\nd = diag(v, 'vector')", "output": "d =\n 10\n 20\n 30", "keywords": ["diag", "diagonal", "matrix", "extraction", "gpu"], "suggestedPath": "/diag-6.m" }, { "id": "diag:7", "builtinKey": "diag", "builtinTitle": "diag", "builtinSlug": "diag", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Creating a rectangular diagonal matrix with `sz`", "summary": "Create diagonal matrices from vectors or extract diagonals from matrices.", "code": "v = [1 2];\nR = diag(v, [2 4])", "output": "R =\n 1 0 0 0\n 0 2 0 0", "keywords": ["diag", "diagonal", "matrix", "extraction", "gpu"], "suggestedPath": "/diag-7.m" }, { "id": "diag:8", "builtinKey": "diag", "builtinTitle": "diag", "builtinSlug": "diag", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Matching residency and type with `'like'`", "summary": "Create diagonal matrices from vectors or extract diagonals from matrices.", "code": "G = gpuArray([1 3 5]');\nD = diag([1 2 3], 'like', G)", "keywords": ["diag", "diagonal", "matrix", "extraction", "gpu"], "suggestedPath": "/diag-8.m" }, { "id": "diff:1", "builtinKey": "diff", "builtinTitle": "diff", "builtinSlug": "diff", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Computing first differences of a vector", "summary": "Forward finite differences of scalars, vectors, matrices, or N-D tensors.", "code": "v = [3 4 9 15];\nd1 = diff(v)", "output": "d1 = [1 5 6]", "keywords": ["diff", "difference", "finite difference", "nth difference", "gpu"], "suggestedPath": "/diff-1.m" }, { "id": "diff:2", "builtinKey": "diff", "builtinTitle": "diff", "builtinSlug": "diff", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Taking second-order differences", "summary": "Forward finite differences of scalars, vectors, matrices, or N-D tensors.", "code": "v = [1 4 9 16 25];\nd2 = diff(v, 2)", "output": "d2 = [2 2 2]", "keywords": ["diff", "difference", "finite difference", "nth difference", "gpu"], "suggestedPath": "/diff-2.m" }, { "id": "diff:3", "builtinKey": "diff", "builtinTitle": "diff", "builtinSlug": "diff", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Selecting the working dimension explicitly", "summary": "Forward finite differences of scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 2 3; 4 5 6];\nrowDiff = diff(A, 1, 2)", "output": "rowDiff =\n 1 1\n 1 1", "keywords": ["diff", "difference", "finite difference", "nth difference", "gpu"], "suggestedPath": "/diff-3.m" }, { "id": "diff:4", "builtinKey": "diff", "builtinTitle": "diff", "builtinSlug": "diff", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Running `diff` on GPU arrays", "summary": "Forward finite differences of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray([1 4 9 16]);\ngDiff = diff(G);\nresult = gather(gDiff)", "output": "result = [3 5 7]", "keywords": ["diff", "difference", "finite difference", "nth difference", "gpu"], "suggestedPath": "/diff-4.m" }, { "id": "diff:5", "builtinKey": "diff", "builtinTitle": "diff", "builtinSlug": "diff", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "N exceeding the dimension length returns an empty array", "summary": "Forward finite differences of scalars, vectors, matrices, or N-D tensors.", "code": "v = (1:3)';\nemptyResult = diff(v, 5)", "output": "emptyResult =\n 0×1 empty double column vector", "keywords": ["diff", "difference", "finite difference", "nth difference", "gpu"], "suggestedPath": "/diff-5.m" }, { "id": "diff:6", "builtinKey": "diff", "builtinTitle": "diff", "builtinSlug": "diff", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Applying `diff` to character data", "summary": "Forward finite differences of scalars, vectors, matrices, or N-D tensors.", "code": "codes = diff('ACEG')", "output": "codes = [2 2 2]", "keywords": ["diff", "difference", "finite difference", "nth difference", "gpu"], "suggestedPath": "/diff-6.m" }, { "id": "dir:1", "builtinKey": "dir", "builtinTitle": "dir", "builtinSlug": "dir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "List Files In The Current Folder", "summary": "Return file and folder information in a MATLAB-compatible struct array.", "code": "fid = fopen(\"README.md\", \"w\"); fclose(fid);\nmkdir(\"src\");\nlisting = dir;\n{listing.name}", "output": " {'.'} {'..'} {'README.md'} {'src'}", "keywords": ["dir", "list files", "folder contents", "metadata", "wildcard", "struct array"], "suggestedPath": "/dir-1.m" }, { "id": "dir:2", "builtinKey": "dir", "builtinTitle": "dir", "builtinSlug": "dir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "List Only MATLAB Files Using Wildcards", "summary": "Return file and folder information in a MATLAB-compatible struct array.", "code": "fid = fopen(\"solver.m\", \"w\"); fclose(fid);\nfid = fopen(\"test_helper.m\", \"w\"); fclose(fid);\nscripts = dir(\"*.m\");\ncellstr({scripts.name})", "output": " {'solver.m'}\n {'test_helper.m'}", "keywords": ["dir", "list files", "folder contents", "metadata", "wildcard", "struct array"], "suggestedPath": "/dir-2.m" }, { "id": "dir:3", "builtinKey": "dir", "builtinTitle": "dir", "builtinSlug": "dir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Capture Metadata For A Specific File", "summary": "Return file and folder information in a MATLAB-compatible struct array.", "code": "info = dir(\"data/results.csv\");\ninfo.bytes % file size in bytes\ninfo.isdir % false", "keywords": ["dir", "list files", "folder contents", "metadata", "wildcard", "struct array"], "suggestedPath": "/dir-3.m" }, { "id": "dir:4", "builtinKey": "dir", "builtinTitle": "dir", "builtinSlug": "dir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "List The Contents Of A Specific Folder", "summary": "Return file and folder information in a MATLAB-compatible struct array.", "code": "mkdir(\"tmp\");\nfid = fopen(fullfile(\"tmp\", \"tmpfile.txt\"), \"w\"); fclose(fid);\nmkdir(fullfile(\"tmp\", \"subdir\"));\ntmp = dir(fullfile(pwd, \"tmp\"));\n{tmp.name}'", "output": " '.' '..' 'tmpfile.txt' 'subdir'", "keywords": ["dir", "list files", "folder contents", "metadata", "wildcard", "struct array"], "suggestedPath": "/dir-4.m" }, { "id": "dir:5", "builtinKey": "dir", "builtinTitle": "dir", "builtinSlug": "dir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Combine Folder And Pattern Arguments", "summary": "Return file and folder information in a MATLAB-compatible struct array.", "code": "mkdir(\"assets\");\nfid = fopen(fullfile(\"assets\", \"logo.png\"), \"w\"); fclose(fid);\nfid = fopen(fullfile(\"assets\", \"splash.png\"), \"w\"); fclose(fid);\nimages = dir(\"assets\", \"*.png\");\n{images.name}", "output": " {'logo.png'} {'splash.png'}", "keywords": ["dir", "list files", "folder contents", "metadata", "wildcard", "struct array"], "suggestedPath": "/dir-5.m" }, { "id": "dir:6", "builtinKey": "dir", "builtinTitle": "dir", "builtinSlug": "dir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use Tilde Expansion For Home Directory", "summary": "Return file and folder information in a MATLAB-compatible struct array.", "code": "home_listing = dir(\"~\")", "output": "home_listing(1).folder\nans =\n '/'", "keywords": ["dir", "list files", "folder contents", "metadata", "wildcard", "struct array"], "suggestedPath": "/dir-6.m" }, { "id": "dir:7", "builtinKey": "dir", "builtinTitle": "dir", "builtinSlug": "dir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handle Missing Matches Gracefully", "summary": "Return file and folder information in a MATLAB-compatible struct array.", "code": "if isempty(dir(\"*.cache\"))\n disp(\"No cache files found.\");\nend", "output": "No cache files found.", "keywords": ["dir", "list files", "folder contents", "metadata", "wildcard", "struct array"], "suggestedPath": "/dir-7.m" }, { "id": "disp:1", "builtinKey": "disp", "builtinTitle": "disp", "builtinSlug": "disp", "category": "io", "categoryPath": ["io"], "exampleTitle": "Printing a message in the Command Window", "summary": "Display scalars, arrays, structs, cells, and gpuArray values in the Command Window without returning output.", "code": "disp(\"Simulation complete.\")", "output": "Simulation complete.", "keywords": ["disp", "display", "print", "console", "gpu"], "suggestedPath": "/disp-1.m" }, { "id": "disp:2", "builtinKey": "disp", "builtinTitle": "disp", "builtinSlug": "disp", "category": "io", "categoryPath": ["io"], "exampleTitle": "Displaying numeric vectors with MATLAB spacing", "summary": "Display scalars, arrays, structs, cells, and gpuArray values in the Command Window without returning output.", "code": "angles = [0 pi/6 pi/4 pi/3];\ndisp(angles)", "output": " 0 0.5236 0.7854 1.0472", "keywords": ["disp", "display", "print", "console", "gpu"], "suggestedPath": "/disp-2.m" }, { "id": "disp:3", "builtinKey": "disp", "builtinTitle": "disp", "builtinSlug": "disp", "category": "io", "categoryPath": ["io"], "exampleTitle": "Showing a matrix without variable names", "summary": "Display scalars, arrays, structs, cells, and gpuArray values in the Command Window without returning output.", "code": "A = [1 23 456; 78 9 10];\ndisp(A)", "output": " 1 23 456\n 78 9 10", "keywords": ["disp", "display", "print", "console", "gpu"], "suggestedPath": "/disp-3.m" }, { "id": "disp:4", "builtinKey": "disp", "builtinTitle": "disp", "builtinSlug": "disp", "category": "io", "categoryPath": ["io"], "exampleTitle": "Printing struct fields in the Command Window", "summary": "Display scalars, arrays, structs, cells, and gpuArray values in the Command Window without returning output.", "code": "cfg = struct(\"solver\", \"bicgstab\", \"tolerance\", 1e-8);\ndisp(cfg)", "output": " solver: \"bicgstab\"\n tolerance: 1e-08", "keywords": ["disp", "display", "print", "console", "gpu"], "suggestedPath": "/disp-4.m" }, { "id": "disp:5", "builtinKey": "disp", "builtinTitle": "disp", "builtinSlug": "disp", "category": "io", "categoryPath": ["io"], "exampleTitle": "Displaying gpuArray data without manual gather", "summary": "Display scalars, arrays, structs, cells, and gpuArray values in the Command Window without returning output.", "code": "G = gpuArray([1 2; 3 4]);\ndisp(G); % RunMat gathers and prints host-formatted output automatically", "output": " 1 2\n 3 4", "keywords": ["disp", "display", "print", "console", "gpu"], "suggestedPath": "/disp-5.m" }, { "id": "disp:6", "builtinKey": "disp", "builtinTitle": "disp", "builtinSlug": "disp", "category": "io", "categoryPath": ["io"], "exampleTitle": "Showing string and character arrays", "summary": "Display scalars, arrays, structs, cells, and gpuArray values in the Command Window without returning output.", "code": "names = [\"alpha\" \"beta\"; \"gamma\" \"delta\"];\ndisp(names);\ndisp('RunMat')", "output": "\"alpha\" \"beta\"\n\"gamma\" \"delta\"\nRunMat", "keywords": ["disp", "display", "print", "console", "gpu"], "suggestedPath": "/disp-6.m" }, { "id": "dlmread:1", "builtinKey": "dlmread", "builtinTitle": "dlmread", "builtinSlug": "dlmread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Reading comma-delimited data by default", "summary": "Read numeric data from a delimiter-separated text file with MATLAB-compatible zero-based offsets.", "code": "writematrix([1 2 3; 4 5 6], \"samples.csv\");\nM = dlmread(\"samples.csv\")\ndelete(\"samples.csv\");", "output": "M =\n 1 2 3\n 4 5 6", "keywords": ["dlmread", "delimiter", "numeric import", "ascii", "range"], "suggestedPath": "/dlmread-1.m" }, { "id": "dlmread:2", "builtinKey": "dlmread", "builtinTitle": "dlmread", "builtinSlug": "dlmread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Importing semicolon-separated values", "summary": "Read numeric data from a delimiter-separated text file with MATLAB-compatible zero-based offsets.", "code": "fid = fopen(\"scores.txt\", \"w\");\nfprintf(fid, \"1;2;3\\n4;5;6\\n\");\nfclose(fid);\n\nM = dlmread(\"scores.txt\", \";\")\ndelete(\"scores.txt\");", "output": "M =\n 1 2 3\n 4 5 6", "keywords": ["dlmread", "delimiter", "numeric import", "ascii", "range"], "suggestedPath": "/dlmread-2.m" }, { "id": "dlmread:3", "builtinKey": "dlmread", "builtinTitle": "dlmread", "builtinSlug": "dlmread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Using tab characters as the delimiter", "summary": "Read numeric data from a delimiter-separated text file with MATLAB-compatible zero-based offsets.", "code": "fid = fopen(\"tabs.txt\", \"w\");\nfprintf(fid, \"10\\t11\\t12\\n13\\t14\\t15\\n\");\nfclose(fid);\n\nM = dlmread(\"tabs.txt\", \"\\t\")\ndelete(\"tabs.txt\");", "output": "M =\n 10 11 12\n 13 14 15", "keywords": ["dlmread", "delimiter", "numeric import", "ascii", "range"], "suggestedPath": "/dlmread-3.m" }, { "id": "dlmread:4", "builtinKey": "dlmread", "builtinTitle": "dlmread", "builtinSlug": "dlmread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Skipping a header row and column (zero-based offsets)", "summary": "Read numeric data from a delimiter-separated text file with MATLAB-compatible zero-based offsets.", "code": "fid = fopen(\"with_header.txt\", \"w\");\nfprintf(fid, \"Label,Jan,Feb\\nalpha,1,2\\nbeta,3,4\\n\");\nfclose(fid);\n\nM = dlmread(\"with_header.txt\", \",\", 1, 1)\ndelete(\"with_header.txt\");", "output": "M =\n 1 2\n 3 4", "keywords": ["dlmread", "delimiter", "numeric import", "ascii", "range"], "suggestedPath": "/dlmread-4.m" }, { "id": "dlmread:5", "builtinKey": "dlmread", "builtinTitle": "dlmread", "builtinSlug": "dlmread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Extracting a rectangular range", "summary": "Read numeric data from a delimiter-separated text file with MATLAB-compatible zero-based offsets.", "code": "fid = fopen(\"block.txt\", \"w\");\nfprintf(fid, \"10,11,12,13\\n14,15,16,17\\n18,19,20,21\\n\");\nfclose(fid);\n\nsub = dlmread(\"block.txt\", \",\", [1 1 2 3])\ndelete(\"block.txt\");", "output": "sub =\n 15 16 17\n 19 20 21", "keywords": ["dlmread", "delimiter", "numeric import", "ascii", "range"], "suggestedPath": "/dlmread-5.m" }, { "id": "dlmread:6", "builtinKey": "dlmread", "builtinTitle": "dlmread", "builtinSlug": "dlmread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Treating empty fields as zeros", "summary": "Read numeric data from a delimiter-separated text file with MATLAB-compatible zero-based offsets.", "code": "fid = fopen(\"blanks.txt\", \"w\");\nfprintf(fid, \"1,,3\\n,5,\\n7,8,\\n\");\nfclose(fid);\n\nM = dlmread(\"blanks.txt\")\ndelete(\"blanks.txt\");", "output": "M =\n 1 0 3\n 0 5 0\n 7 8 0", "keywords": ["dlmread", "delimiter", "numeric import", "ascii", "range"], "suggestedPath": "/dlmread-6.m" }, { "id": "dlmread:7", "builtinKey": "dlmread", "builtinTitle": "dlmread", "builtinSlug": "dlmread", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Using a numeric ASCII code for the delimiter", "summary": "Read numeric data from a delimiter-separated text file with MATLAB-compatible zero-based offsets.", "code": "fid = fopen(\"pipe.txt\", \"w\");\nfprintf(fid, \"5|6|7\\n8|9|10\\n\");\nfclose(fid);\n\nM = dlmread(\"pipe.txt\", double('|'))\ndelete(\"pipe.txt\");", "output": "M =\n 5 6 7\n 8 9 10", "keywords": ["dlmread", "delimiter", "numeric import", "ascii", "range"], "suggestedPath": "/dlmread-7.m" }, { "id": "dlmwrite:1", "builtinKey": "dlmwrite", "builtinTitle": "dlmwrite", "builtinSlug": "dlmwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Writing a numeric matrix with the default comma delimiter", "summary": "Write numeric matrices to delimiter-separated text files with MATLAB-compatible precision and offset controls.", "code": "A = [1 2 3; 4 5 6];\ndlmwrite(\"scores.csv\", A)", "keywords": ["dlmwrite", "delimiter", "precision", "newline", "append", "roffset", "coffset"], "suggestedPath": "/dlmwrite-1.m" }, { "id": "dlmwrite:2", "builtinKey": "dlmwrite", "builtinTitle": "dlmwrite", "builtinSlug": "dlmwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Using a semicolon delimiter and positional offsets", "summary": "Write numeric matrices to delimiter-separated text files with MATLAB-compatible precision and offset controls.", "code": "B = magic(3);\ndlmwrite(\"offset.txt\", B, \";\", 1, 2)", "keywords": ["dlmwrite", "delimiter", "precision", "newline", "append", "roffset", "coffset"], "suggestedPath": "/dlmwrite-2.m" }, { "id": "dlmwrite:3", "builtinKey": "dlmwrite", "builtinTitle": "dlmwrite", "builtinSlug": "dlmwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Appending data with explicit row and column offsets", "summary": "Write numeric matrices to delimiter-separated text files with MATLAB-compatible precision and offset controls.", "code": "dlmwrite(\"log.txt\", 1:3);\ndlmwrite(\"log.txt\", 10:12, \"-append\", \"roffset\", 1, \"coffset\", 1)", "keywords": ["dlmwrite", "delimiter", "precision", "newline", "append", "roffset", "coffset"], "suggestedPath": "/dlmwrite-3.m" }, { "id": "dlmwrite:4", "builtinKey": "dlmwrite", "builtinTitle": "dlmwrite", "builtinSlug": "dlmwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Controlling precision with significant digits", "summary": "Write numeric matrices to delimiter-separated text files with MATLAB-compatible precision and offset controls.", "code": "vals = [12.34567, pi];\ndlmwrite(\"precision3.csv\", vals, \"precision\", 3)", "keywords": ["dlmwrite", "delimiter", "precision", "newline", "append", "roffset", "coffset"], "suggestedPath": "/dlmwrite-4.m" }, { "id": "dlmwrite:5", "builtinKey": "dlmwrite", "builtinTitle": "dlmwrite", "builtinSlug": "dlmwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Emitting fixed-point values with a printf-style format string", "summary": "Write numeric matrices to delimiter-separated text files with MATLAB-compatible precision and offset controls.", "code": "dlmwrite(\"fixed.txt\", rand(2, 2), \"precision\", \"%.6f\", \"delimiter\", \"\\t\")", "keywords": ["dlmwrite", "delimiter", "precision", "newline", "append", "roffset", "coffset"], "suggestedPath": "/dlmwrite-5.m" }, { "id": "dlmwrite:6", "builtinKey": "dlmwrite", "builtinTitle": "dlmwrite", "builtinSlug": "dlmwrite", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Selecting the Windows line ending while writing GPU data", "summary": "Write numeric matrices to delimiter-separated text files with MATLAB-compatible precision and offset controls.", "code": "G = gpuArray(single([1.5; 2.5; 3.5]));\ndlmwrite(\"gpu_pc.txt\", G, \"newline\", \"pc\")", "output": "% Data is gathered from the GPU and written using CR/LF line endings.", "keywords": ["dlmwrite", "delimiter", "precision", "newline", "append", "roffset", "coffset"], "suggestedPath": "/dlmwrite-6.m" }, { "id": "dot:1", "builtinKey": "dot", "builtinTitle": "dot", "builtinSlug": "dot", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Computing the dot product of row vectors", "summary": "Compute dot products (inner products) of real or complex inputs, optionally along a chosen dimension.", "code": "A = [1 2 3];\nB = [4 5 6];\nval = dot(A, B)", "output": "val = 32", "keywords": ["dot", "inner product", "linear algebra", "gpu", "dimension"], "suggestedPath": "/dot-1.m" }, { "id": "dot:2", "builtinKey": "dot", "builtinTitle": "dot", "builtinSlug": "dot", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Dotting column vectors to obtain a scalar", "summary": "Compute dot products (inner products) of real or complex inputs, optionally along a chosen dimension.", "code": "u = [1; 3; 5];\nv = [2; 4; 6];\nval = dot(u, v)", "output": "val = 44", "keywords": ["dot", "inner product", "linear algebra", "gpu", "dimension"], "suggestedPath": "/dot-2.m" }, { "id": "dot:3", "builtinKey": "dot", "builtinTitle": "dot", "builtinSlug": "dot", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Applying `dot` along a chosen dimension", "summary": "Compute dot products (inner products) of real or complex inputs, optionally along a chosen dimension.", "code": "X = [1 2 3; 4 5 6];\nY = [6 5 4; 3 2 1];\ncols = dot(X, Y, 1) % collapse rows\nrows = dot(X, Y, 2) % collapse columns", "output": "cols = [18 20 18];\nrows = [28; 28]", "keywords": ["dot", "inner product", "linear algebra", "gpu", "dimension"], "suggestedPath": "/dot-3.m" }, { "id": "dot:4", "builtinKey": "dot", "builtinTitle": "dot", "builtinSlug": "dot", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Dotting complex vectors uses conjugation on the first input", "summary": "Compute dot products (inner products) of real or complex inputs, optionally along a chosen dimension.", "code": "a = [1+2i, 3-4i];\nb = [2-3i, -1+5i];\nval = dot(a, b)", "output": "val = -27 + 4i", "keywords": ["dot", "inner product", "linear algebra", "gpu", "dimension"], "suggestedPath": "/dot-4.m" }, { "id": "dot:5", "builtinKey": "dot", "builtinTitle": "dot", "builtinSlug": "dot", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Evaluating `dot` on `gpuArray` inputs", "summary": "Compute dot products (inner products) of real or complex inputs, optionally along a chosen dimension.", "code": "G1 = gpuArray([1 2 3 4]);\nG2 = gpuArray([4 3 2 1]);\nG = dot(G1, G2);\nresult = gather(G)", "output": "result = 20", "keywords": ["dot", "inner product", "linear algebra", "gpu", "dimension"], "suggestedPath": "/dot-5.m" }, { "id": "double:1", "builtinKey": "double", "builtinTitle": "double", "builtinSlug": "double", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert integers to double precision", "summary": "Convert numeric values, logical masks, characters, and gpuArray handles to double precision.", "code": "ints = int32([1 2 3]);\ndoubles = double(ints)", "output": "doubles = [1 2 3]", "keywords": ["double", "float64", "cast", "convert to double", "gpuArray double"], "suggestedPath": "/double-1.m" }, { "id": "double:2", "builtinKey": "double", "builtinTitle": "double", "builtinSlug": "double", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Promote logical masks for arithmetic", "summary": "Convert numeric values, logical masks, characters, and gpuArray handles to double precision.", "code": "mask = logical([0 1 0 1]);\nweights = double(mask)", "output": "weights = [0 1 0 1]", "keywords": ["double", "float64", "cast", "convert to double", "gpuArray double"], "suggestedPath": "/double-2.m" }, { "id": "double:3", "builtinKey": "double", "builtinTitle": "double", "builtinSlug": "double", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert character arrays to Unicode code points", "summary": "Convert numeric values, logical masks, characters, and gpuArray handles to double precision.", "code": "codes = double('RunMat')", "output": "codes = [82 117 110 77 97 116]", "keywords": ["double", "float64", "cast", "convert to double", "gpuArray double"], "suggestedPath": "/double-3.m" }, { "id": "double:4", "builtinKey": "double", "builtinTitle": "double", "builtinSlug": "double", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Preserve complex numbers while promoting precision", "summary": "Convert numeric values, logical masks, characters, and gpuArray handles to double precision.", "code": "z = [1+2i, 3-4i];\nresult = double(z)", "output": "result = [1+2i 3-4i]", "keywords": ["double", "float64", "cast", "convert to double", "gpuArray double"], "suggestedPath": "/double-4.m" }, { "id": "double:5", "builtinKey": "double", "builtinTitle": "double", "builtinSlug": "double", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert single-precision gpuArray data to double", "summary": "Convert numeric values, logical masks, characters, and gpuArray handles to double precision.", "code": "G = single(gpuArray(1:4));\nH = double(G);\ngather(H)", "output": "ans = [1 2 3 4]", "keywords": ["double", "float64", "cast", "convert to double", "gpuArray double"], "suggestedPath": "/double-5.m" }, { "id": "double:6", "builtinKey": "double", "builtinTitle": "double", "builtinSlug": "double", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Handle double precision with `'like'` prototypes", "summary": "Convert numeric values, logical masks, characters, and gpuArray handles to double precision.", "code": "proto = gpuArray.zeros(1, 1, 'double');\nout = double([pi 0], 'like', proto)", "output": "out =\n 1×2 gpuArray double\n 3.1416 0", "keywords": ["double", "float64", "cast", "convert to double", "gpuArray double"], "suggestedPath": "/double-6.m" }, { "id": "double:7", "builtinKey": "double", "builtinTitle": "double", "builtinSlug": "double", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Promote matrices without changing shape", "summary": "Convert numeric values, logical masks, characters, and gpuArray handles to double precision.", "code": "A = single([1.5 2.25; 3.75 4.5]);\nB = double(A)", "output": "B = [1.5 2.25; 3.75 4.5]", "keywords": ["double", "float64", "cast", "convert to double", "gpuArray double"], "suggestedPath": "/double-7.m" }, { "id": "eig:1", "builtinKey": "eig", "builtinTitle": "eig", "builtinSlug": "eig", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Computing Eigenvalues of a 2x2 Matrix", "summary": "Eigenvalue decomposition with MATLAB-compatible multi-output forms.", "code": "A = [2 1; 0 3];\nd = eig(A)", "output": "d = [2; 3]", "keywords": ["eig", "eigenvalues", "eigenvectors", "linalg", "gpu"], "suggestedPath": "/eig-1.m" }, { "id": "eig:2", "builtinKey": "eig", "builtinTitle": "eig", "builtinSlug": "eig", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Diagonalizing a Matrix with Two Outputs", "summary": "Eigenvalue decomposition with MATLAB-compatible multi-output forms.", "code": "A = [0 1; -2 -3];\n[V,D] = eig(A);\nrecon = V * D / V", "keywords": ["eig", "eigenvalues", "eigenvectors", "linalg", "gpu"], "suggestedPath": "/eig-2.m" }, { "id": "eig:3", "builtinKey": "eig", "builtinTitle": "eig", "builtinSlug": "eig", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Retrieving Left Eigenvectors with Three Outputs", "summary": "Eigenvalue decomposition with MATLAB-compatible multi-output forms.", "code": "A = [4 2; 1 3];\n[V,D,W] = eig(A);\ncheck = W' * A - D * W'", "keywords": ["eig", "eigenvalues", "eigenvectors", "linalg", "gpu"], "suggestedPath": "/eig-3.m" }, { "id": "eig:4", "builtinKey": "eig", "builtinTitle": "eig", "builtinSlug": "eig", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Eigenvalues of a Complex-Valued Matrix", "summary": "Eigenvalue decomposition with MATLAB-compatible multi-output forms.", "code": "A = [1+2i, 2-1i; 0, -3i];\n[V,D] = eig(A);\ndiag(D) % Complex eigenvalues", "keywords": ["eig", "eigenvalues", "eigenvectors", "linalg", "gpu"], "suggestedPath": "/eig-4.m" }, { "id": "eig:5", "builtinKey": "eig", "builtinTitle": "eig", "builtinSlug": "eig", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Eigenvalues of a Diagonal Matrix", "summary": "Eigenvalue decomposition with MATLAB-compatible multi-output forms.", "code": "A = diag([10, -2, 7]);\nd = eig(A)", "keywords": ["eig", "eigenvalues", "eigenvectors", "linalg", "gpu"], "suggestedPath": "/eig-5.m" }, { "id": "eig:6", "builtinKey": "eig", "builtinTitle": "eig", "builtinSlug": "eig", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Handling Repeated Eigenvalues", "summary": "Eigenvalue decomposition with MATLAB-compatible multi-output forms.", "code": "A = [3 1 0; 0 3 0; 0 0 5];\nd = eig(A)", "keywords": ["eig", "eigenvalues", "eigenvectors", "linalg", "gpu"], "suggestedPath": "/eig-6.m" }, { "id": "eig:7", "builtinKey": "eig", "builtinTitle": "eig", "builtinSlug": "eig", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Using the 'nobalance' Option", "summary": "Eigenvalue decomposition with MATLAB-compatible multi-output forms.", "code": "A = [1e6 1; 0 1e-6];\nd_balanced = eig(A);\nd_nobalance = eig(A, 'nobalance')", "keywords": ["eig", "eigenvalues", "eigenvectors", "linalg", "gpu"], "suggestedPath": "/eig-7.m" }, { "id": "eig:8", "builtinKey": "eig", "builtinTitle": "eig", "builtinSlug": "eig", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Returning Eigenvalues as a Vector with Two Outputs", "summary": "Eigenvalue decomposition with MATLAB-compatible multi-output forms.", "code": "A = [0 1; -2 -3];\n[V,d] = eig(A, 'vector');\nsize(d) % 2 x 1 column vector", "keywords": ["eig", "eigenvalues", "eigenvectors", "linalg", "gpu"], "suggestedPath": "/eig-8.m" }, { "id": "eig:9", "builtinKey": "eig", "builtinTitle": "eig", "builtinSlug": "eig", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Running eig on a gpuArray", "summary": "Eigenvalue decomposition with MATLAB-compatible multi-output forms.", "code": "G = gpuArray(randn(128));\nd = eig(G); % Real spectra stay on the GPU when the provider implements eig\nisa(d, 'gpuArray') % logical 1 when the provider kept the result on device", "keywords": ["eig", "eigenvalues", "eigenvectors", "linalg", "gpu"], "suggestedPath": "/eig-9.m" }, { "id": "endswith:1", "builtinKey": "endswith", "builtinTitle": "endsWith", "builtinSlug": "endswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Check if a filename ends with an extension", "summary": "Check whether text inputs end with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "tf = endsWith(\"report.pdf\", \".pdf\")", "output": "tf = logical\n 1", "keywords": ["endswith", "suffix", "string array", "ignorecase", "text search"], "suggestedPath": "/endswith-1.m" }, { "id": "endswith:2", "builtinKey": "endswith", "builtinTitle": "endsWith", "builtinSlug": "endswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Perform a case-insensitive suffix test", "summary": "Check whether text inputs end with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "tf = endsWith(\"RunMat\", \"MAT\", 'IgnoreCase', true)", "output": "tf = logical\n 1", "keywords": ["endswith", "suffix", "string array", "ignorecase", "text search"], "suggestedPath": "/endswith-2.m" }, { "id": "endswith:3", "builtinKey": "endswith", "builtinTitle": "endsWith", "builtinSlug": "endswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Apply a scalar suffix to every element of a string array", "summary": "Check whether text inputs end with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "labels = [\"alpha\" \"beta\" \"gamma\"];\ntf = endsWith(labels, \"ma\")", "output": "tf = 1×3 logical array\n 0 0 1", "keywords": ["endswith", "suffix", "string array", "ignorecase", "text search"], "suggestedPath": "/endswith-3.m" }, { "id": "endswith:4", "builtinKey": "endswith", "builtinTitle": "endsWith", "builtinSlug": "endswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Use element-wise suffixes with implicit expansion", "summary": "Check whether text inputs end with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "names = [\"hydrogen\"; \"helium\"; \"lithium\"];\nsuffixes = [\"gen\"; \"ium\"; \"ium\"];\ntf = endsWith(names, suffixes)", "output": "tf = 3×1 logical array\n 1\n 1\n 1", "keywords": ["endswith", "suffix", "string array", "ignorecase", "text search"], "suggestedPath": "/endswith-4.m" }, { "id": "endswith:5", "builtinKey": "endswith", "builtinTitle": "endsWith", "builtinSlug": "endswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Test suffixes for a cell array of character vectors", "summary": "Check whether text inputs end with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "C = {'Mercury', 'Venus', 'Mars'};\ntf = endsWith(C, 's')", "output": "tf = 1×3 logical array\n 0 1 1", "keywords": ["endswith", "suffix", "string array", "ignorecase", "text search"], "suggestedPath": "/endswith-5.m" }, { "id": "endswith:6", "builtinKey": "endswith", "builtinTitle": "endsWith", "builtinSlug": "endswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Provide multiple suffixes as a column vector", "summary": "Check whether text inputs end with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "tf = endsWith(\"saturn\", ['n'; 'x'; 'r'])", "output": "tf = 3×1 logical array\n 1\n 0\n 0", "keywords": ["endswith", "suffix", "string array", "ignorecase", "text search"], "suggestedPath": "/endswith-6.m" }, { "id": "endswith:7", "builtinKey": "endswith", "builtinTitle": "endsWith", "builtinSlug": "endswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Handle empty patterns and missing values", "summary": "Check whether text inputs end with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "texts = [\"\", \"<missing>\"];\ntf = endsWith(texts, \"\")", "output": "tf = 1×2 logical array\n 1 0", "keywords": ["endswith", "suffix", "string array", "ignorecase", "text search"], "suggestedPath": "/endswith-7.m" }, { "id": "eq:1", "builtinKey": "eq", "builtinTitle": "eq", "builtinSlug": "eq", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Check If Two Scalars Are Equal", "summary": "Element-wise equality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "flag = eq(42, 42)", "output": "flag =\n 1", "keywords": ["eq", "==", "equality", "logical comparison", "gpuArray equality"], "suggestedPath": "/eq-1.m" }, { "id": "eq:2", "builtinKey": "eq", "builtinTitle": "eq", "builtinSlug": "eq", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare Two Vectors Element-Wise", "summary": "Element-wise equality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "A = [1 2 3 4];\nB = [1 0 3 5];\nmask = eq(A, B)", "output": "mask =\n 1×4 logical array\n 1 0 1 0", "keywords": ["eq", "==", "equality", "logical comparison", "gpuArray equality"], "suggestedPath": "/eq-2.m" }, { "id": "eq:3", "builtinKey": "eq", "builtinTitle": "eq", "builtinSlug": "eq", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Apply Equality With Implicit Expansion", "summary": "Element-wise equality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "M = [1 2 3; 4 5 6];\nsel = eq(M, 2)", "output": "sel =\n 2×3 logical array\n 0 1 0\n 0 0 0", "keywords": ["eq", "==", "equality", "logical comparison", "gpuArray equality"], "suggestedPath": "/eq-3.m" }, { "id": "eq:4", "builtinKey": "eq", "builtinTitle": "eq", "builtinSlug": "eq", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare Character Data To Numeric Codes", "summary": "Element-wise equality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "letters = ['A' 'B' 'C'];\nisA = eq(letters, 65)", "output": "isA =\n 1×3 logical array\n 1 0 0", "keywords": ["eq", "==", "equality", "logical comparison", "gpuArray equality"], "suggestedPath": "/eq-4.m" }, { "id": "eq:5", "builtinKey": "eq", "builtinTitle": "eq", "builtinSlug": "eq", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare String Arrays To A Scalar String", "summary": "Element-wise equality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "names = [\"alice\" \"bob\" \"alice\"];\nmatches = eq(names, \"alice\")", "output": "matches =\n 1×3 logical array\n 1 0 1", "keywords": ["eq", "==", "equality", "logical comparison", "gpuArray equality"], "suggestedPath": "/eq-5.m" }, { "id": "eq:6", "builtinKey": "eq", "builtinTitle": "eq", "builtinSlug": "eq", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Run `eq` Directly On `gpuArray` Inputs", "summary": "Element-wise equality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "G1 = gpuArray([1 2 3]);\nG2 = gpuArray([1 0 3]);\ndeviceResult = eq(G1, G2)\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1 0 1\nhostResult =\n 1 0 1", "keywords": ["eq", "==", "equality", "logical comparison", "gpuArray equality"], "suggestedPath": "/eq-6.m" }, { "id": "erase:1", "builtinKey": "erase", "builtinTitle": "erase", "builtinSlug": "erase", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Remove a single word from a string scalar", "summary": "Remove substring occurrences from strings, character arrays, and cell arrays with MATLAB-compatible semantics.", "code": "txt = \"RunMat accelerates MATLAB code\";\nclean = erase(txt, \"accelerates \")", "output": "clean = \"RunMat MATLAB code\"", "keywords": ["erase", "remove substring", "delete text", "string manipulation", "character array"], "suggestedPath": "/erase-1.m" }, { "id": "erase:2", "builtinKey": "erase", "builtinTitle": "erase", "builtinSlug": "erase", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Remove multiple substrings from each element of a string array", "summary": "Remove substring occurrences from strings, character arrays, and cell arrays with MATLAB-compatible semantics.", "code": "labels = [\"GPU pipeline\"; \"CPU pipeline\"];\nresult = erase(labels, [\"GPU \", \"CPU \"])", "output": "result = 2×1 string\n \"pipeline\"\n \"pipeline\"", "keywords": ["erase", "remove substring", "delete text", "string manipulation", "character array"], "suggestedPath": "/erase-2.m" }, { "id": "erase:3", "builtinKey": "erase", "builtinTitle": "erase", "builtinSlug": "erase", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Erase characters from a character array while preserving padding", "summary": "Remove substring occurrences from strings, character arrays, and cell arrays with MATLAB-compatible semantics.", "code": "chars = char(\"workspace\", \"snapshots\");\ntrimmed = erase(chars, \"s\")", "output": "trimmed =\n\n 2×8 char array\n\n 'workpace'\n 'naphot '", "keywords": ["erase", "remove substring", "delete text", "string manipulation", "character array"], "suggestedPath": "/erase-3.m" }, { "id": "erase:4", "builtinKey": "erase", "builtinTitle": "erase", "builtinSlug": "erase", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Remove substrings from a cell array of text", "summary": "Remove substring occurrences from strings, character arrays, and cell arrays with MATLAB-compatible semantics.", "code": "C = {'Kernel Planner', \"GPU Fusion\"};\nout = erase(C, [\"Kernel \", \"GPU \"])", "output": "out = 1×2 cell array\n {'Planner'} {\"Fusion\"}", "keywords": ["erase", "remove substring", "delete text", "string manipulation", "character array"], "suggestedPath": "/erase-4.m" }, { "id": "erase:5", "builtinKey": "erase", "builtinTitle": "erase", "builtinSlug": "erase", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Provide an empty pattern list to leave the text unchanged", "summary": "Remove substring occurrences from strings, character arrays, and cell arrays with MATLAB-compatible semantics.", "code": "data = [\"alpha\", \"beta\"];\nunchanged = erase(data, string.empty)", "output": "unchanged = 1×2 string\n \"alpha\" \"beta\"", "keywords": ["erase", "remove substring", "delete text", "string manipulation", "character array"], "suggestedPath": "/erase-5.m" }, { "id": "erase:6", "builtinKey": "erase", "builtinTitle": "erase", "builtinSlug": "erase", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Remove delimiters before splitting text", "summary": "Remove substring occurrences from strings, character arrays, and cell arrays with MATLAB-compatible semantics.", "code": "path = \"runmat/bin:runmat/lib\";\nclean = erase(path, \":\")\nparts = split(clean, \"runmat/\")", "output": "clean = \"runmat/binrunmat/lib\"\nparts = 1×3 string\n \"\" \"bin\" \"lib\"", "keywords": ["erase", "remove substring", "delete text", "string manipulation", "character array"], "suggestedPath": "/erase-6.m" }, { "id": "erasebetween:1", "builtinKey": "erasebetween", "builtinTitle": "eraseBetween", "builtinSlug": "erasebetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Removing text between substrings", "summary": "Delete text that lies between boundary markers while matching MATLAB-compatible name-value options.", "code": "txt = \"The quick brown fox\";\nresult = eraseBetween(txt, \"quick\", \" fox\")", "output": "result = \"The quick fox\"", "keywords": ["eraseBetween", "delete substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/erasebetween-1.m" }, { "id": "erasebetween:2", "builtinKey": "erasebetween", "builtinTitle": "eraseBetween", "builtinSlug": "erasebetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Deleting substrings across a string array", "summary": "Delete text that lies between boundary markers while matching MATLAB-compatible name-value options.", "code": "str = [\"The quick brown fox jumps\"; \"over the lazy dog\"];\nstarts = [\"quick\"; \"the\"];\nends = [\" fox\"; \" dog\"];\ntrimmed = eraseBetween(str, starts, ends)", "output": "trimmed = 2×1 string\n \"The quick fox jumps\"\n \"over the dog\"", "keywords": ["eraseBetween", "delete substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/erasebetween-2.m" }, { "id": "erasebetween:3", "builtinKey": "erasebetween", "builtinTitle": "eraseBetween", "builtinSlug": "erasebetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Removing characters between numeric positions", "summary": "Delete text that lies between boundary markers while matching MATLAB-compatible name-value options.", "code": "name = \"Edgar Allen Poe\";\nshort = eraseBetween(name, 6, 11)", "output": "short = \"Edgar Poe\"", "keywords": ["eraseBetween", "delete substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/erasebetween-3.m" }, { "id": "erasebetween:4", "builtinKey": "erasebetween", "builtinTitle": "eraseBetween", "builtinSlug": "erasebetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Using inclusive boundaries to drop the markers", "summary": "Delete text that lies between boundary markers while matching MATLAB-compatible name-value options.", "code": "sentence = \"The quick brown fox jumps over the lazy dog\";\ncollapsed = eraseBetween(sentence, \" brown\", \"lazy\", \"Boundaries\", \"inclusive\")", "output": "collapsed = \"The quick dog\"", "keywords": ["eraseBetween", "delete substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/erasebetween-4.m" }, { "id": "erasebetween:5", "builtinKey": "erasebetween", "builtinTitle": "eraseBetween", "builtinSlug": "erasebetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Operating on character arrays while preserving padding", "summary": "Delete text that lies between boundary markers while matching MATLAB-compatible name-value options.", "code": "chars = char(\"Server<GPU>\", \"Engine<CPU>\");\ntrimmed = eraseBetween(chars, \"<\", \">\", \"Boundaries\", \"inclusive\")", "output": "trimmed =\n\n 2×6 char array\n\n \"Server\"\n \"Engine\"", "keywords": ["eraseBetween", "delete substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/erasebetween-5.m" }, { "id": "erasebetween:6", "builtinKey": "erasebetween", "builtinTitle": "eraseBetween", "builtinSlug": "erasebetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Preserving element types in cell arrays", "summary": "Delete text that lies between boundary markers while matching MATLAB-compatible name-value options.", "code": "C = {'alpha<1>', \"beta<2>\";\n 'gamma<3>', \"delta<4>\"};\nclean = eraseBetween(C, \"<\", \">\", \"Boundaries\", \"inclusive\")", "output": "clean =\n 2×2 cell array\n {'alpha'} {\"beta\"}\n {'gamma'} {\"delta\"}", "keywords": ["eraseBetween", "delete substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/erasebetween-6.m" }, { "id": "erasebetween:7", "builtinKey": "erasebetween", "builtinTitle": "eraseBetween", "builtinSlug": "erasebetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Handling missing strings safely", "summary": "Delete text that lies between boundary markers while matching MATLAB-compatible name-value options.", "code": "texts = [missing, \"Planner<GPU>\"];\nresult = eraseBetween(texts, \"<\", \">\")", "output": "result = 1×2 string\n \"<missing>\" \"Planner\"", "keywords": ["eraseBetween", "delete substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/erasebetween-7.m" }, { "id": "error:1", "builtinKey": "error", "builtinTitle": "error", "builtinSlug": "error", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Throwing an error with a simple message", "summary": "Throw an exception with an identifier and a formatted diagnostic message.", "code": "try\n error(\"Computation failed.\");\ncatch err\n fprintf(\"%s -> %s\\n\", err.identifier, err.message);\nend", "keywords": ["error", "exception", "throw", "diagnostics", "message"], "suggestedPath": "/error-1.m" }, { "id": "error:2", "builtinKey": "error", "builtinTitle": "error", "builtinSlug": "error", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Throwing an error with a custom identifier", "summary": "Throw an exception with an identifier and a formatted diagnostic message.", "code": "try\n error(\"runmat:examples:invalidState\", \"State vector is empty.\");\ncatch err\n fprintf(\"%s\\n\", err.identifier);\nend", "keywords": ["error", "exception", "throw", "diagnostics", "message"], "suggestedPath": "/error-2.m" }, { "id": "error:3", "builtinKey": "error", "builtinTitle": "error", "builtinSlug": "error", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Formatting values inside the error message", "summary": "Throw an exception with an identifier and a formatted diagnostic message.", "code": "value = 42;\ntry\n error(\"RunMat:demo:badValue\", \"Value %d is outside [%d, %d].\", value, 0, 10);\ncatch err\n disp(err.message);\nend", "keywords": ["error", "exception", "throw", "diagnostics", "message"], "suggestedPath": "/error-3.m" }, { "id": "error:4", "builtinKey": "error", "builtinTitle": "error", "builtinSlug": "error", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Rethrowing an existing MException", "summary": "Throw an exception with an identifier and a formatted diagnostic message.", "code": "try\n try\n error(\"RunMat:inner:failure\", \"Inner failure.\");\n catch inner\n error(inner); % propagate with original identifier/message\n end\ncatch err\n fprintf(\"%s\\n\", err.identifier);\nend", "keywords": ["error", "exception", "throw", "diagnostics", "message"], "suggestedPath": "/error-4.m" }, { "id": "error:5", "builtinKey": "error", "builtinTitle": "error", "builtinSlug": "error", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Using a legacy message struct", "summary": "Throw an exception with an identifier and a formatted diagnostic message.", "code": "S.identifier = \"toolbox:demo:badInput\";\nS.message = \"Inputs must be positive integers.\";\ntry\n error(S);\ncatch err\n fprintf(\"%s\\n\", err.identifier);\nend", "keywords": ["error", "exception", "throw", "diagnostics", "message"], "suggestedPath": "/error-5.m" }, { "id": "errorbar:1", "builtinKey": "errorbar", "builtinTitle": "errorbar", "builtinSlug": "errorbar", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Plot symmetric vertical error bars", "summary": "Plot data with symmetric or asymmetric error bars for uncertainty, intervals, and MATLAB `errorbar` workflows.", "code": "x = 1:5;\ny = [2 3 2.5 4 3.5];\nerr = [0.2 0.3 0.1 0.4 0.2];\nerrorbar(x, y, err, err);", "keywords": ["errorbar", "error bars", "uncertainty plot", "confidence interval plot", "matlab errorbar"], "suggestedPath": "/errorbar-1.m" }, { "id": "errorbar:2", "builtinKey": "errorbar", "builtinTitle": "errorbar", "builtinSlug": "errorbar", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Plot asymmetric both-direction error bars", "summary": "Plot data with symmetric or asymmetric error bars for uncertainty, intervals, and MATLAB `errorbar` workflows.", "code": "x = 1:4;\ny = [3 4 2 5];\nxn = [0.1 0.2 0.1 0.3];\nxp = [0.2 0.3 0.2 0.4];\nyn = [0.3 0.2 0.4 0.2];\nyp = [0.4 0.3 0.5 0.3];\nerrorbar(x, y, xn, xp, yn, yp);", "keywords": ["errorbar", "error bars", "uncertainty plot", "confidence interval plot", "matlab errorbar"], "suggestedPath": "/errorbar-2.m" }, { "id": "errorbar:3", "builtinKey": "errorbar", "builtinTitle": "errorbar", "builtinSlug": "errorbar", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Style an error-bar object and label it for the legend", "summary": "Plot data with symmetric or asymmetric error bars for uncertainty, intervals, and MATLAB `errorbar` workflows.", "code": "x = 1:5;\ny = [1 2 1.5 3 2.5];\nh = errorbar(x, y, 0.2*ones(size(x)), 0.2*ones(size(x)));\nset(h, 'LineWidth', 2, 'DisplayName', 'measurement');\nlegend;", "keywords": ["errorbar", "error bars", "uncertainty plot", "confidence interval plot", "matlab errorbar"], "suggestedPath": "/errorbar-3.m" }, { "id": "exist:1", "builtinKey": "exist", "builtinTitle": "exist", "builtinSlug": "exist", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "How to check if a workspace variable exists", "summary": "Determine whether a variable, file, folder, built-in function, or class exists and return MATLAB-compatible identifiers.", "code": "alpha = 3.14;\nstatus = exist(\"alpha\", \"var\")", "output": "status =\n 1", "keywords": ["exist", "file exists", "variable exists", "folder exists", "builtin exists"], "suggestedPath": "/exist-1.m" }, { "id": "exist:2", "builtinKey": "exist", "builtinTitle": "exist", "builtinSlug": "exist", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "How to determine if a built-in function is available", "summary": "Determine whether a variable, file, folder, built-in function, or class exists and return MATLAB-compatible identifiers.", "code": "code = exist(\"sin\")", "output": "code =\n 5", "keywords": ["exist", "file exists", "variable exists", "folder exists", "builtin exists"], "suggestedPath": "/exist-2.m" }, { "id": "exist:3", "builtinKey": "exist", "builtinTitle": "exist", "builtinSlug": "exist", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "How to test whether an M-file is on the MATLAB path", "summary": "Determine whether a variable, file, folder, built-in function, or class exists and return MATLAB-compatible identifiers.", "code": "status = exist(\"utilities/process_data\", \"file\")", "output": "status =\n 2", "keywords": ["exist", "file exists", "variable exists", "folder exists", "builtin exists"], "suggestedPath": "/exist-3.m" }, { "id": "exist:4", "builtinKey": "exist", "builtinTitle": "exist", "builtinSlug": "exist", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "How to verify a folder exists before creating logs", "summary": "Determine whether a variable, file, folder, built-in function, or class exists and return MATLAB-compatible identifiers.", "code": "mkdir(\"logs\");\nstatus = exist(\"logs\", \"dir\")", "output": "status =\n 7", "keywords": ["exist", "file exists", "variable exists", "folder exists", "builtin exists"], "suggestedPath": "/exist-4.m" }, { "id": "exist:5", "builtinKey": "exist", "builtinTitle": "exist", "builtinSlug": "exist", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "How to detect class definitions in packages", "summary": "Determine whether a variable, file, folder, built-in function, or class exists and return MATLAB-compatible identifiers.", "code": "status = exist(\"pkg.Widget\", \"class\")", "output": "status =\n 8", "keywords": ["exist", "file exists", "variable exists", "folder exists", "builtin exists"], "suggestedPath": "/exist-5.m" }, { "id": "exist:6", "builtinKey": "exist", "builtinTitle": "exist", "builtinSlug": "exist", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "How to inspect compiled MEX fallbacks", "summary": "Determine whether a variable, file, folder, built-in function, or class exists and return MATLAB-compatible identifiers.", "code": "if exist(\"fastfft\", \"mex\")\n disp(\"Using compiled fastfft.\");\nelse\n disp(\"Falling back to MATLAB implementation.\");\nend", "output": "% Prints which implementation will be executed based on the presence of fastfft.mex*.", "keywords": ["exist", "file exists", "variable exists", "folder exists", "builtin exists"], "suggestedPath": "/exist-6.m" }, { "id": "exp:1", "builtinKey": "exp", "builtinTitle": "exp", "builtinSlug": "exp", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Calculate the exponential of a scalar value", "summary": "Element-wise exponential of scalars, vectors, matrices, or N-D tensors.", "code": "y = exp(1)", "output": "y = 2.7183", "keywords": ["exp", "exponential", "elementwise", "gpu", "complex"], "suggestedPath": "/exp-1.m" }, { "id": "exp:2", "builtinKey": "exp", "builtinTitle": "exp", "builtinSlug": "exp", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Apply the exponential function to a vector of growth rates", "summary": "Element-wise exponential of scalars, vectors, matrices, or N-D tensors.", "code": "rates = [-1 -0.5 0 0.5 1];\nfactor = exp(rates)", "output": "factor = [0.3679 0.6065 1 1.6487 2.7183]", "keywords": ["exp", "exponential", "elementwise", "gpu", "complex"], "suggestedPath": "/exp-2.m" }, { "id": "exp:3", "builtinKey": "exp", "builtinTitle": "exp", "builtinSlug": "exp", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Exponentiate every element of a matrix", "summary": "Element-wise exponential of scalars, vectors, matrices, or N-D tensors.", "code": "A = [0 1 2; 3 4 5];\nB = exp(A)", "output": "B = [1.0000 2.7183 7.3891; 20.0855 54.5982 148.4132]", "keywords": ["exp", "exponential", "elementwise", "gpu", "complex"], "suggestedPath": "/exp-3.m" }, { "id": "exp:4", "builtinKey": "exp", "builtinTitle": "exp", "builtinSlug": "exp", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Compute the exponential of complex numbers", "summary": "Element-wise exponential of scalars, vectors, matrices, or N-D tensors.", "code": "z = [1+2i, -1+pi*i];\nw = exp(z)", "output": "w = [-1.1312 + 2.4717i, -0.3679 + 0.0000i]", "keywords": ["exp", "exponential", "elementwise", "gpu", "complex"], "suggestedPath": "/exp-4.m" }, { "id": "exp:5", "builtinKey": "exp", "builtinTitle": "exp", "builtinSlug": "exp", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Run element-wise exponential on GPU data", "summary": "Element-wise exponential of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray([0 1; 2 3]);\nout = exp(G);\nresult = gather(out)", "output": "result = [1.0000 2.7183; 7.3891 20.0855]", "keywords": ["exp", "exponential", "elementwise", "gpu", "complex"], "suggestedPath": "/exp-5.m" }, { "id": "exp:6", "builtinKey": "exp", "builtinTitle": "exp", "builtinSlug": "exp", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert character codes to exponentials", "summary": "Element-wise exponential of scalars, vectors, matrices, or N-D tensors.", "code": "C = 'ABC';\nY = exp(C)", "output": "Y = [1.6949e+28 4.6072e+28 1.2524e+29]", "keywords": ["exp", "exponential", "elementwise", "gpu", "complex"], "suggestedPath": "/exp-6.m" }, { "id": "expm1:1", "builtinKey": "expm1", "builtinTitle": "expm1", "builtinSlug": "expm1", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Maintaining precision for tiny growth rates", "summary": "Accurate element-wise computation of exp(x) - 1 for scalars, vectors, matrices, or N-D tensors.", "code": "x = 1e-12;\ny = expm1(x)", "output": "y = 1.0000000000005e-12", "keywords": ["expm1", "exp(x)-1", "exponential", "elementwise", "gpu", "precision"], "suggestedPath": "/expm1-1.m" }, { "id": "expm1:2", "builtinKey": "expm1", "builtinTitle": "expm1", "builtinSlug": "expm1", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Applying expm1 to model percentage growth", "summary": "Accurate element-wise computation of exp(x) - 1 for scalars, vectors, matrices, or N-D tensors.", "code": "rates = [-0.10 -0.05 0 0.05 0.10];\nfactors = expm1(rates)", "output": "factors = [-0.0952 -0.0488 0 0.0513 0.1052]", "keywords": ["expm1", "exp(x)-1", "exponential", "elementwise", "gpu", "precision"], "suggestedPath": "/expm1-2.m" }, { "id": "expm1:3", "builtinKey": "expm1", "builtinTitle": "expm1", "builtinSlug": "expm1", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Running expm1 on GPU arrays", "summary": "Accurate element-wise computation of exp(x) - 1 for scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray(linspace(-1, 1, 5));\nresult = expm1(G);\nout = gather(result)", "output": "out = [-0.6321 -0.3935 0 0.6487 1.7183]", "keywords": ["expm1", "exp(x)-1", "exponential", "elementwise", "gpu", "precision"], "suggestedPath": "/expm1-3.m" }, { "id": "expm1:4", "builtinKey": "expm1", "builtinTitle": "expm1", "builtinSlug": "expm1", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Using expm1 with complex numbers", "summary": "Accurate element-wise computation of exp(x) - 1 for scalars, vectors, matrices, or N-D tensors.", "code": "z = [1+1i, -1+pi*1i];\nw = expm1(z)", "output": "w = [0.4687 + 2.2874i, -1.3679 + 0.0000i]", "keywords": ["expm1", "exp(x)-1", "exponential", "elementwise", "gpu", "precision"], "suggestedPath": "/expm1-4.m" }, { "id": "expm1:5", "builtinKey": "expm1", "builtinTitle": "expm1", "builtinSlug": "expm1", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Applying expm1 to character data", "summary": "Accurate element-wise computation of exp(x) - 1 for scalars, vectors, matrices, or N-D tensors.", "code": "C = 'ABC';\nY = expm1(C)", "output": "Y = [1.6949e+28 4.6072e+28 1.2524e+29]", "keywords": ["expm1", "exp(x)-1", "exponential", "elementwise", "gpu", "precision"], "suggestedPath": "/expm1-5.m" }, { "id": "extractbetween:1", "builtinKey": "extractbetween", "builtinTitle": "extractBetween", "builtinSlug": "extractbetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Extract text between words in a string", "summary": "Extract text that lies between two boundary markers using string or position inputs.", "code": "txt = \"RunMat accelerates MATLAB workloads\";\nsegment = extractBetween(txt, \"RunMat \", \" workloads\")", "output": "segment = \"accelerates MATLAB\"", "keywords": ["extractBetween", "substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/extractbetween-1.m" }, { "id": "extractbetween:2", "builtinKey": "extractbetween", "builtinTitle": "extractBetween", "builtinSlug": "extractbetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Include boundary markers with the `'Boundaries'` option", "summary": "Extract text that lies between two boundary markers using string or position inputs.", "code": "path = \"snapshots/run/fusion.mat\";\nwithMarkers = extractBetween(path, \"snapshots/\", \".mat\", \"Boundaries\", \"inclusive\")", "output": "withMarkers = \"snapshots/run/fusion.mat\"", "keywords": ["extractBetween", "substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/extractbetween-2.m" }, { "id": "extractbetween:3", "builtinKey": "extractbetween", "builtinTitle": "extractBetween", "builtinSlug": "extractbetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Use numeric positions for 1-based indexing", "summary": "Extract text that lies between two boundary markers using string or position inputs.", "code": "name = \"Accelerator\";\nmiddle = extractBetween(name, 3, 7)", "output": "middle = \"celer\"", "keywords": ["extractBetween", "substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/extractbetween-3.m" }, { "id": "extractbetween:4", "builtinKey": "extractbetween", "builtinTitle": "extractBetween", "builtinSlug": "extractbetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Apply scalar text markers to each element of a string array", "summary": "Extract text that lies between two boundary markers using string or position inputs.", "code": "files = [\"runmat_accel.rs\", \"runmat_gc.rs\"; \"runmat_plot.rs\", \"runmat_cli.rs\"];\nstems = extractBetween(files, \"runmat_\", \".rs\")", "output": "stems = 2×2 string\n \"accel\" \"gc\"\n \"plot\" \"cli\"", "keywords": ["extractBetween", "substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/extractbetween-4.m" }, { "id": "extractbetween:5", "builtinKey": "extractbetween", "builtinTitle": "extractBetween", "builtinSlug": "extractbetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Work with character arrays while preserving row padding", "summary": "Extract text that lies between two boundary markers using string or position inputs.", "code": "chars = char(\"Device<GPU>\", \"Planner<Fusion>\");\ntokens = extractBetween(chars, \"<\", \">\")", "output": "tokens =\n\n 2×6 char array\n\n \"GPU \"\n \"Fusion\"", "keywords": ["extractBetween", "substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/extractbetween-5.m" }, { "id": "extractbetween:6", "builtinKey": "extractbetween", "builtinTitle": "extractBetween", "builtinSlug": "extractbetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Preserve element types in cell arrays", "summary": "Extract text that lies between two boundary markers using string or position inputs.", "code": "C = {'<missing>', 'A[B]C'; \"Planner <Fusion>\", \"Device<GPU>\"};\nout = extractBetween(C, \"<\", \">\")", "output": "out =\n 2×2 cell array\n {'<missing>'} {'B'}\n {\"Fusion\"} {\"GPU\"}", "keywords": ["extractBetween", "substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/extractbetween-6.m" }, { "id": "extractbetween:7", "builtinKey": "extractbetween", "builtinTitle": "extractBetween", "builtinSlug": "extractbetween", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Handle missing strings without throwing errors", "summary": "Extract text that lies between two boundary markers using string or position inputs.", "code": "txt = [\"<missing>\", \"Planner<GPU>\"];\ntokens = extractBetween(txt, \"<\", \">\")", "output": "tokens = 1×2 string\n \"<missing>\" \"GPU\"", "keywords": ["extractBetween", "substring", "boundaries", "inclusive", "exclusive", "string array"], "suggestedPath": "/extractbetween-7.m" }, { "id": "eye:1", "builtinKey": "eye", "builtinTitle": "eye", "builtinSlug": "eye", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 3-by-3 identity matrix", "summary": "Create identity matrices and N-D identity tensors.", "code": "I = eye(3)", "output": "I =\n 1 0 0\n 0 1 0\n 0 0 1", "keywords": ["eye", "identity", "matrix", "gpu", "like", "logical"], "suggestedPath": "/eye-1.m" }, { "id": "eye:2", "builtinKey": "eye", "builtinTitle": "eye", "builtinSlug": "eye", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Generating a rectangular identity matrix", "summary": "Create identity matrices and N-D identity tensors.", "code": "J = eye(2, 4)", "output": "J =\n 1 0 0 0\n 0 1 0 0", "keywords": ["eye", "identity", "matrix", "gpu", "like", "logical"], "suggestedPath": "/eye-2.m" }, { "id": "eye:3", "builtinKey": "eye", "builtinTitle": "eye", "builtinSlug": "eye", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Replicating an identity matrix across pages", "summary": "Create identity matrices and N-D identity tensors.", "code": "K = eye(2, 3, 2) % Two 2x3 identity slices stacked along the third dimension", "output": "K(:, :, 1) =\n 1 0 0\n 0 1 0\n\nK(:, :, 2) =\n 1 0 0\n 0 1 0", "keywords": ["eye", "identity", "matrix", "gpu", "like", "logical"], "suggestedPath": "/eye-3.m" }, { "id": "eye:4", "builtinKey": "eye", "builtinTitle": "eye", "builtinSlug": "eye", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a logical identity mask", "summary": "Create identity matrices and N-D identity tensors.", "code": "mask = eye(4, 'logical')", "output": "mask =\n 1 0 0 0\n 0 1 0 0\n 0 0 1 0\n 0 0 0 1", "keywords": ["eye", "identity", "matrix", "gpu", "like", "logical"], "suggestedPath": "/eye-4.m" }, { "id": "eye:5", "builtinKey": "eye", "builtinTitle": "eye", "builtinSlug": "eye", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Matching type and residency with `'like'`", "summary": "Create identity matrices and N-D identity tensors.", "code": "G = gpuArray(rand(128)); % Prototype on the GPU\nI = eye(size(G, 1), 'like', G)", "keywords": ["eye", "identity", "matrix", "gpu", "like", "logical"], "suggestedPath": "/eye-5.m" }, { "id": "factorial:1", "builtinKey": "factorial", "builtinTitle": "factorial", "builtinSlug": "factorial", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Factorial of a single integer value", "summary": "Element-wise factorial for non-negative integers with MATLAB-compatible NaN/Inf behaviour.", "code": "y = factorial(5)", "output": "y = 120", "keywords": ["factorial", "combinatorics", "n!", "permutations", "gpu", "like"], "suggestedPath": "/factorial-1.m" }, { "id": "factorial:2", "builtinKey": "factorial", "builtinTitle": "factorial", "builtinSlug": "factorial", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Factorial of zero returns one", "summary": "Element-wise factorial for non-negative integers with MATLAB-compatible NaN/Inf behaviour.", "code": "factorial(0)", "output": "ans = 1", "keywords": ["factorial", "combinatorics", "n!", "permutations", "gpu", "like"], "suggestedPath": "/factorial-2.m" }, { "id": "factorial:3", "builtinKey": "factorial", "builtinTitle": "factorial", "builtinSlug": "factorial", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Factorial across a vector of non-negative integers", "summary": "Element-wise factorial for non-negative integers with MATLAB-compatible NaN/Inf behaviour.", "code": "vals = factorial([0 1 3 5])", "output": "vals = [1 1 6 120]", "keywords": ["factorial", "combinatorics", "n!", "permutations", "gpu", "like"], "suggestedPath": "/factorial-3.m" }, { "id": "factorial:4", "builtinKey": "factorial", "builtinTitle": "factorial", "builtinSlug": "factorial", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Detecting invalid non-integer inputs", "summary": "Element-wise factorial for non-negative integers with MATLAB-compatible NaN/Inf behaviour.", "code": "result = factorial([2.5 -1 4])", "output": "result = [NaN NaN 24]", "keywords": ["factorial", "combinatorics", "n!", "permutations", "gpu", "like"], "suggestedPath": "/factorial-4.m" }, { "id": "factorial:5", "builtinKey": "factorial", "builtinTitle": "factorial", "builtinSlug": "factorial", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Handling large inputs that overflow to infinity", "summary": "Element-wise factorial for non-negative integers with MATLAB-compatible NaN/Inf behaviour.", "code": "big = factorial(171)", "output": "big = Inf", "keywords": ["factorial", "combinatorics", "n!", "permutations", "gpu", "like"], "suggestedPath": "/factorial-5.m" }, { "id": "factorial:6", "builtinKey": "factorial", "builtinTitle": "factorial", "builtinSlug": "factorial", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Using factorial with `gpuArray` inputs", "summary": "Element-wise factorial for non-negative integers with MATLAB-compatible NaN/Inf behaviour.", "code": "G = gpuArray(uint16([3 4 5]));\nR = factorial(G);\nhost = gather(R)", "output": "host = [6 24 120]", "keywords": ["factorial", "combinatorics", "n!", "permutations", "gpu", "like"], "suggestedPath": "/factorial-6.m" }, { "id": "factorial:7", "builtinKey": "factorial", "builtinTitle": "factorial", "builtinSlug": "factorial", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Keeping results on the GPU with `'like'`", "summary": "Element-wise factorial for non-negative integers with MATLAB-compatible NaN/Inf behaviour.", "code": "proto = gpuArray.zeros(1, 1, 'single');\ndeviceResult = factorial([3 4], 'like', proto);\ngathered = gather(deviceResult)", "output": "gathered =\n 1x2 single\n 6 24", "keywords": ["factorial", "combinatorics", "n!", "permutations", "gpu", "like"], "suggestedPath": "/factorial-7.m" }, { "id": "false:1", "builtinKey": "false", "builtinTitle": "false", "builtinSlug": "false", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 2x3 logical array of false values", "summary": "Create logical arrays filled with false values.", "code": "mask = false(2, 3)", "output": "mask = [0 0 0; 0 0 0]", "keywords": ["false", "logical", "array", "mask"], "suggestedPath": "/false-1.m" }, { "id": "false:2", "builtinKey": "false", "builtinTitle": "false", "builtinSlug": "false", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a logical array from a size vector", "summary": "Create logical arrays filled with false values.", "code": "dims = [1 4 2];\nmask = false(dims)", "output": "mask =\n 1x4x2 logical array\n 0 0 0 0\n 0 0 0 0", "keywords": ["false", "logical", "array", "mask"], "suggestedPath": "/false-2.m" }, { "id": "false:3", "builtinKey": "false", "builtinTitle": "false", "builtinSlug": "false", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a false mask with the same size as an existing array", "summary": "Create logical arrays filled with false values.", "code": "A = rand(2, 2);\nmask = false(A)", "output": "mask =\n 2x2 logical array\n 0 0\n 0 0", "keywords": ["false", "logical", "array", "mask"], "suggestedPath": "/false-3.m" }, { "id": "fclose:1", "builtinKey": "fclose", "builtinTitle": "fclose", "builtinSlug": "fclose", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Close a file after writing data", "summary": "Close one file, multiple files, or all files opened with fopen.", "code": "[fid, msg] = fopen('results.txt', 'w');\nif fid == -1\n error('Failed to open file: %s', msg);\nend\nfprintf(fid, 'Simulation complete\\n');\nstatus = fclose(fid)", "output": "status = 0", "keywords": ["fclose", "file", "close", "io", "identifier"], "suggestedPath": "/fclose-1.m" }, { "id": "fclose:2", "builtinKey": "fclose", "builtinTitle": "fclose", "builtinSlug": "fclose", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Close all open files at once", "summary": "Close one file, multiple files, or all files opened with fopen.", "code": "% Close every file except stdin/stdout/stderr\nstatus = fclose('all')", "output": "status = 0", "keywords": ["fclose", "file", "close", "io", "identifier"], "suggestedPath": "/fclose-2.m" }, { "id": "fclose:3", "builtinKey": "fclose", "builtinTitle": "fclose", "builtinSlug": "fclose", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Handle invalid file identifiers gracefully", "summary": "Close one file, multiple files, or all files opened with fopen.", "code": "[status, message] = fclose(9999);\nif status == -1\n fprintf('Close failed: %s\\n', message);\nend", "output": "status = -1;\nmessage = 'Invalid file identifier. Use fopen to generate a valid file ID.'", "keywords": ["fclose", "file", "close", "io", "identifier"], "suggestedPath": "/fclose-3.m" }, { "id": "fclose:4", "builtinKey": "fclose", "builtinTitle": "fclose", "builtinSlug": "fclose", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Close multiple file identifiers together", "summary": "Close one file, multiple files, or all files opened with fopen.", "code": "fids = fopen('all');\nstatus = fclose(fids)", "output": "status = 0", "keywords": ["fclose", "file", "close", "io", "identifier"], "suggestedPath": "/fclose-4.m" }, { "id": "fclose:5", "builtinKey": "fclose", "builtinTitle": "fclose", "builtinSlug": "fclose", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Detect failures with the second output", "summary": "Close one file, multiple files, or all files opened with fopen.", "code": "[fid, msg] = fopen('data.bin', 'r');\nassert(fid ~= -1, msg);\nfclose(fid);\n[status, message] = fclose(fid); % closes again, returns -1 and an error string", "output": "status = -1;\nmessage = 'Invalid file identifier. Use fopen to generate a valid file ID.'", "keywords": ["fclose", "file", "close", "io", "identifier"], "suggestedPath": "/fclose-5.m" }, { "id": "fclose:6", "builtinKey": "fclose", "builtinTitle": "fclose", "builtinSlug": "fclose", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Close files using the no-argument form", "summary": "Close one file, multiple files, or all files opened with fopen.", "code": "% Equivalent to fclose('all')\nstatus = fclose()", "output": "status = 0", "keywords": ["fclose", "file", "close", "io", "identifier"], "suggestedPath": "/fclose-6.m" }, { "id": "feof:1", "builtinKey": "feof", "builtinTitle": "feof", "builtinSlug": "feof", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Check for end-of-file while reading line by line", "summary": "Query whether the file position indicator of a file identifier is at end-of-file.", "code": "[fid, msg] = fopen('log.txt', 'r');\nassert(fid ~= -1, msg);\nwhile ~feof(fid)\n line = fgets(fid);\n disp(line);\nend\nfclose(fid)", "keywords": ["feof", "end of file", "io", "file identifier"], "suggestedPath": "/feof-1.m" }, { "id": "feof:2", "builtinKey": "feof", "builtinTitle": "feof", "builtinSlug": "feof", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Detect the end of a binary stream read with fread", "summary": "Query whether the file position indicator of a file identifier is at end-of-file.", "code": "[fid, msg] = fopen('payload.bin', 'rb');\nassert(fid ~= -1, msg);\nwhile ~feof(fid)\n chunk = fread(fid, 1024, 'uint8');\n process(chunk);\nend\nfclose(fid)", "keywords": ["feof", "end of file", "io", "file identifier"], "suggestedPath": "/feof-2.m" }, { "id": "feof:3", "builtinKey": "feof", "builtinTitle": "feof", "builtinSlug": "feof", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Handle empty files gracefully", "summary": "Query whether the file position indicator of a file identifier is at end-of-file.", "code": "[fid, msg] = fopen('empty.txt', 'r');\nassert(fid ~= -1, msg);\nisAtEnd = feof(fid); % returns true immediately because the file is empty\nfclose(fid)", "keywords": ["feof", "end of file", "io", "file identifier"], "suggestedPath": "/feof-3.m" }, { "id": "feof:4", "builtinKey": "feof", "builtinTitle": "feof", "builtinSlug": "feof", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Protect against invalid identifiers", "summary": "Query whether the file position indicator of a file identifier is at end-of-file.", "code": "try\n feof(9999);\ncatch err\n disp(err.message);\nend", "keywords": ["feof", "end of file", "io", "file identifier"], "suggestedPath": "/feof-4.m" }, { "id": "feof:5", "builtinKey": "feof", "builtinTitle": "feof", "builtinSlug": "feof", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Guard reads that rely on gpuArray identifiers", "summary": "Query whether the file position indicator of a file identifier is at end-of-file.", "code": "fid = gpuArray(int32(fopen('samples.dat', 'rb')));\ntf = feof(fid); % argument is gathered automatically before the check", "keywords": ["feof", "end of file", "io", "file identifier"], "suggestedPath": "/feof-5.m" }, { "id": "fft:1", "builtinKey": "fft", "builtinTitle": "fft", "builtinSlug": "fft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Computing the FFT of a real time-domain vector", "summary": "Compute the discrete Fourier transform (DFT) of vectors, matrices, or N-D tensors.", "code": "x = [1 2 3 4];\nY = fft(x)", "output": "Y =\n Columns 1 through 4\n 10 + 0i -2 + 2i -2 + 0i -2 - 2i", "keywords": ["fft", "fourier transform", "complex", "zero padding", "gpu"], "suggestedPath": "/fft-1.m" }, { "id": "fft:2", "builtinKey": "fft", "builtinTitle": "fft", "builtinSlug": "fft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Applying fft column-wise to a matrix", "summary": "Compute the discrete Fourier transform (DFT) of vectors, matrices, or N-D tensors.", "code": "A = [1 2 3; 4 5 6];\nF = fft(A)", "output": "F =\n 5 + 0i 7 + 0i 9 + 0i\n -3 + 0i -3 + 0i -3 + 0i", "keywords": ["fft", "fourier transform", "complex", "zero padding", "gpu"], "suggestedPath": "/fft-2.m" }, { "id": "fft:3", "builtinKey": "fft", "builtinTitle": "fft", "builtinSlug": "fft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Zero-padding before the FFT", "summary": "Compute the discrete Fourier transform (DFT) of vectors, matrices, or N-D tensors.", "code": "x = [1 2 3];\nY = fft(x, 5)", "keywords": ["fft", "fourier transform", "complex", "zero padding", "gpu"], "suggestedPath": "/fft-3.m" }, { "id": "fft:4", "builtinKey": "fft", "builtinTitle": "fft", "builtinSlug": "fft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Selecting the transform dimension for a row vector", "summary": "Compute the discrete Fourier transform (DFT) of vectors, matrices, or N-D tensors.", "code": "x = [1 2 3 4];\nY = fft(x, [], 2)", "keywords": ["fft", "fourier transform", "complex", "zero padding", "gpu"], "suggestedPath": "/fft-4.m" }, { "id": "fft:5", "builtinKey": "fft", "builtinTitle": "fft", "builtinSlug": "fft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "FFT of a complex-valued signal", "summary": "Compute the discrete Fourier transform (DFT) of vectors, matrices, or N-D tensors.", "code": "t = 0:3;\nx = exp(1i * pi/2 * t);\nY = fft(x)", "keywords": ["fft", "fourier transform", "complex", "zero padding", "gpu"], "suggestedPath": "/fft-5.m" }, { "id": "fft:6", "builtinKey": "fft", "builtinTitle": "fft", "builtinSlug": "fft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "FFT with gpuArray inputs", "summary": "Compute the discrete Fourier transform (DFT) of vectors, matrices, or N-D tensors.", "code": "g = gpuArray(rand(1, 1024)); % Residency is on the GPU\nG = fft(g); % Falls back to host if provider FFT hooks are unavailable\nresult = gather(G)", "keywords": ["fft", "fourier transform", "complex", "zero padding", "gpu"], "suggestedPath": "/fft-6.m" }, { "id": "fft2:1", "builtinKey": "fft2", "builtinTitle": "fft2", "builtinSlug": "fft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Computing the 2-D FFT of a small matrix", "summary": "Compute the two-dimensional discrete Fourier transform (DFT) of numeric or complex data.", "code": "X = [1 2; 3 4];\nY = fft2(X)", "output": "Y =\n 10 + 0i -2 + 0i\n -4 + 0i 0 + 0i", "keywords": ["fft2", "2d fft", "two dimensional fourier transform", "image frequency analysis", "gpu"], "suggestedPath": "/fft2-1.m" }, { "id": "fft2:2", "builtinKey": "fft2", "builtinTitle": "fft2", "builtinSlug": "fft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Zero-padding an image patch before `fft2`", "summary": "Compute the two-dimensional discrete Fourier transform (DFT) of numeric or complex data.", "code": "patch = [1 0 1; 0 1 0; 1 0 1];\nF = fft2(patch, 8, 8)", "keywords": ["fft2", "2d fft", "two dimensional fourier transform", "image frequency analysis", "gpu"], "suggestedPath": "/fft2-2.m" }, { "id": "fft2:3", "builtinKey": "fft2", "builtinTitle": "fft2", "builtinSlug": "fft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Specifying transform lengths with a size vector", "summary": "Compute the two-dimensional discrete Fourier transform (DFT) of numeric or complex data.", "code": "X = rand(4, 6);\nF = fft2(X, [8 4]); % pad rows to 8 and truncate columns to 4", "keywords": ["fft2", "2d fft", "two dimensional fourier transform", "image frequency analysis", "gpu"], "suggestedPath": "/fft2-3.m" }, { "id": "fft2:4", "builtinKey": "fft2", "builtinTitle": "fft2", "builtinSlug": "fft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Using `fft2` on `gpuArray` data", "summary": "Compute the two-dimensional discrete Fourier transform (DFT) of numeric or complex data.", "code": "G = gpuArray(rand(256, 256));\nF = fft2(G);\nR = gather(F)", "keywords": ["fft2", "2d fft", "two dimensional fourier transform", "image frequency analysis", "gpu"], "suggestedPath": "/fft2-4.m" }, { "id": "fft2:5", "builtinKey": "fft2", "builtinTitle": "fft2", "builtinSlug": "fft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Applying `fft2` to each slice of a 3-D volume", "summary": "Compute the two-dimensional discrete Fourier transform (DFT) of numeric or complex data.", "code": "V = rand(64, 64, 10);\nspectra = fft2(V)", "keywords": ["fft2", "2d fft", "two dimensional fourier transform", "image frequency analysis", "gpu"], "suggestedPath": "/fft2-5.m" }, { "id": "fft2:6", "builtinKey": "fft2", "builtinTitle": "fft2", "builtinSlug": "fft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Verifying `fft2` against sequential `fft` calls", "summary": "Compute the two-dimensional discrete Fourier transform (DFT) of numeric or complex data.", "code": "X = rand(5, 7);\nsequential = fft(fft(X, [], 1), [], 2);\ndirect = fft2(X)", "keywords": ["fft2", "2d fft", "two dimensional fourier transform", "image frequency analysis", "gpu"], "suggestedPath": "/fft2-6.m" }, { "id": "fftshift:1", "builtinKey": "fftshift", "builtinTitle": "fftshift", "builtinSlug": "fftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Centering the spectrum of a 1-D FFT result with even length", "summary": "Shift zero-frequency components to the center of a spectrum.", "code": "x = [0 1 2 3 4 5 6 7];\nfx = fft(x);\ny = fftshift(fx)", "output": "y = [-4 -4-1.6569i -4-4i -4-9.6569i 28 -4+9.6569i -4+4i -4+1.6569i]", "keywords": ["fftshift", "fourier transform", "frequency centering", "spectrum", "gpu"], "suggestedPath": "/fftshift-1.m" }, { "id": "fftshift:2", "builtinKey": "fftshift", "builtinTitle": "fftshift", "builtinSlug": "fftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Handling odd-length vectors", "summary": "Shift zero-frequency components to the center of a spectrum.", "code": "x = 1:5;\ny = fftshift(x)", "output": "y = [4 5 1 2 3]", "keywords": ["fftshift", "fourier transform", "frequency centering", "spectrum", "gpu"], "suggestedPath": "/fftshift-2.m" }, { "id": "fftshift:3", "builtinKey": "fftshift", "builtinTitle": "fftshift", "builtinSlug": "fftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Centering both axes of a 2-D FFT", "summary": "Shift zero-frequency components to the center of a spectrum.", "code": "A = [1 2 3; 4 5 6];\nC = fftshift(A)", "output": "C =\n 6 4 5\n 3 1 2", "keywords": ["fftshift", "fourier transform", "frequency centering", "spectrum", "gpu"], "suggestedPath": "/fftshift-3.m" }, { "id": "fftshift:4", "builtinKey": "fftshift", "builtinTitle": "fftshift", "builtinSlug": "fftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Shifting only one dimension of a matrix", "summary": "Shift zero-frequency components to the center of a spectrum.", "code": "A = [1 2 3; 4 5 6];\nrowCentered = fftshift(A, 1) % shift rows only", "output": "rowCentered =\n 4 5 6\n 1 2 3", "keywords": ["fftshift", "fourier transform", "frequency centering", "spectrum", "gpu"], "suggestedPath": "/fftshift-4.m" }, { "id": "fftshift:5", "builtinKey": "fftshift", "builtinTitle": "fftshift", "builtinSlug": "fftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Applying `fftshift` to a gpuArray spectrum", "summary": "Shift zero-frequency components to the center of a spectrum.", "code": "G = gpuArray(0:7);\ncentered = fftshift(G);\nH = gather(centered)", "output": "H = [4 5 6 7 0 1 2 3]", "keywords": ["fftshift", "fourier transform", "frequency centering", "spectrum", "gpu"], "suggestedPath": "/fftshift-5.m" }, { "id": "fgets:1", "builtinKey": "fgets", "builtinTitle": "fgets", "builtinSlug": "fgets", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Read the first line of a file", "summary": "Read the next line from a file, keeping newline characters in the result.", "code": "fname = tempname;\nfid = fopen(fname, 'w');\nfprintf(fid, 'RunMat\\nSecond line\\n');\nfclose(fid);\n\nfid = fopen(fname, 'r');\nline = fgets(fid);\nfclose(fid);\ndelete(fname);\n\ndouble(line)", "output": "ans =\n 82 117 110 77 97 116 10", "keywords": ["fgets", "text file", "line input", "newline"], "suggestedPath": "/fgets-1.m" }, { "id": "fgets:2", "builtinKey": "fgets", "builtinTitle": "fgets", "builtinSlug": "fgets", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Limit the number of characters returned", "summary": "Read the next line from a file, keeping newline characters in the result.", "code": "fname = tempname;\nfid = fopen(fname, 'w');\nfprintf(fid, 'Example line\\n');\nfclose(fid);\n\nfid = fopen(fname, 'r');\nsnippet = fgets(fid, 5);\nfclose(fid);\ndelete(fname);\n\nsnippet\ndouble(snippet)", "output": "snippet =\n 'Exam'\nans =\n 69 120 97 109", "keywords": ["fgets", "text file", "line input", "newline"], "suggestedPath": "/fgets-2.m" }, { "id": "fgets:3", "builtinKey": "fgets", "builtinTitle": "fgets", "builtinSlug": "fgets", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Retrieve line terminators separately", "summary": "Read the next line from a file, keeping newline characters in the result.", "code": "fname = tempname;\nfid = fopen(fname, 'w');\nfprintf(fid, 'Windows line\\r\\n');\nfclose(fid);\n\nfid = fopen(fname, 'r');\n[line, ltout] = fgets(fid);\nfclose(fid);\ndelete(fname);\n\ncontent = line(1:end-numel(ltout));\nterminators = double(ltout);\n\ncontent\nterminators", "output": "content =\n 'Windows line'\nterminators =\n 13 10", "keywords": ["fgets", "text file", "line input", "newline"], "suggestedPath": "/fgets-3.m" }, { "id": "fgets:4", "builtinKey": "fgets", "builtinTitle": "fgets", "builtinSlug": "fgets", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Handle lines without a trailing newline", "summary": "Read the next line from a file, keeping newline characters in the result.", "code": "fname = tempname;\nfid = fopen(fname, 'w');\nfprintf(fid, 'last line');\nfclose(fid);\n\nfid = fopen(fname, 'r');\n[line1, lt1] = fgets(fid);\nline2 = fgets(fid);\nfclose(fid);\ndelete(fname);\n\nline1\nlt1\nline2", "output": "line1 =\n 'last line'\nlt1 =\n []\nline2 =\n -1", "keywords": ["fgets", "text file", "line input", "newline"], "suggestedPath": "/fgets-4.m" }, { "id": "fgets:5", "builtinKey": "fgets", "builtinTitle": "fgets", "builtinSlug": "fgets", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Detect end of file using the return value", "summary": "Read the next line from a file, keeping newline characters in the result.", "code": "fname = tempname;\nfid = fopen(fname, 'w');\nfprintf(fid, 'one\\n');\nfprintf(fid, 'two\\n');\nfclose(fid);\n\nfid = fopen(fname, 'r');\ntline = fgets(fid);\nwhile tline ~= -1\n fprintf('> %s', tline);\n tline = fgets(fid);\nend\nfclose(fid);\ndelete(fname)", "output": "> one\n> two", "keywords": ["fgets", "text file", "line input", "newline"], "suggestedPath": "/fgets-5.m" }, { "id": "fgets:6", "builtinKey": "fgets", "builtinTitle": "fgets", "builtinSlug": "fgets", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Read Latin-1 encoded text", "summary": "Read the next line from a file, keeping newline characters in the result.", "code": "fname = tempname;\nfid = fopen(fname, 'w', 'n', 'latin1');\nfprintf(fid, 'Español\\n');\nfclose(fid);\n\nfid = fopen(fname, 'r', 'n', 'latin1');\nline = fgets(fid);\nfclose(fid);\ndelete(fname);\n\ntext = line(1:end-1);\ncodes = double(text);\n\ntext\ncodes", "output": "text =\n 'Español'\ncodes =\n 69 115 112 97 241 111 108", "keywords": ["fgets", "text file", "line input", "newline"], "suggestedPath": "/fgets-6.m" }, { "id": "fieldnames:1", "builtinKey": "fieldnames", "builtinTitle": "fieldnames", "builtinSlug": "fieldnames", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Listing the fields of a scalar structure", "summary": "List the field names of structs, struct arrays, or objects.", "code": "s = struct(\"name\", \"Ada\", \"score\", 42);\nfields = fieldnames(s)", "output": "fields =\n {'name'}\n {'score'}", "keywords": ["fieldnames", "struct", "introspection", "struct array", "object", "handle", "properties"], "suggestedPath": "/fieldnames-1.m" }, { "id": "fieldnames:2", "builtinKey": "fieldnames", "builtinTitle": "fieldnames", "builtinSlug": "fieldnames", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Inspecting field names before accessing values", "summary": "List the field names of structs, struct arrays, or objects.", "code": "stats = struct(\"min\", 1.2, \"max\", 9.8);\nif any(strcmp(fieldnames(stats), \"median\"))\n disp(stats.median);\nelse\n disp(\"median not available\");\nend", "output": "median not available", "keywords": ["fieldnames", "struct", "introspection", "struct array", "object", "handle", "properties"], "suggestedPath": "/fieldnames-2.m" }, { "id": "fieldnames:3", "builtinKey": "fieldnames", "builtinTitle": "fieldnames", "builtinSlug": "fieldnames", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Gathering field names from a struct array", "summary": "List the field names of structs, struct arrays, or objects.", "code": "people = struct(\"name\", {\"Ada\", \"Grace\"}, \"id\", {101, 102});\nfields = fieldnames(people)", "output": "fields =\n {'id'}\n {'name'}", "keywords": ["fieldnames", "struct", "introspection", "struct array", "object", "handle", "properties"], "suggestedPath": "/fieldnames-3.m" }, { "id": "fieldnames:4", "builtinKey": "fieldnames", "builtinTitle": "fieldnames", "builtinSlug": "fieldnames", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Listing the properties of an object", "summary": "List the field names of structs, struct arrays, or objects.", "code": "% Save this class in Counter.m before running the example:\n% classdef Counter\n% properties\n% Value = 0\n% Step = 1\n% end\n% end\nc = Counter;\nprops = fieldnames(c)", "output": "props =\n {'Step'}\n {'Value'}", "keywords": ["fieldnames", "struct", "introspection", "struct array", "object", "handle", "properties"], "suggestedPath": "/fieldnames-4.m" }, { "id": "fieldnames:5", "builtinKey": "fieldnames", "builtinTitle": "fieldnames", "builtinSlug": "fieldnames", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Discovering fields inside nested structs", "summary": "List the field names of structs, struct arrays, or objects.", "code": "config.database = struct(\"host\", \"db.local\", \"port\", 5432);\nnames = fieldnames(config.database)", "output": "names =\n {'host'}\n {'port'}", "keywords": ["fieldnames", "struct", "introspection", "struct array", "object", "handle", "properties"], "suggestedPath": "/fieldnames-5.m" }, { "id": "fieldnames:6", "builtinKey": "fieldnames", "builtinTitle": "fieldnames", "builtinSlug": "fieldnames", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Handling empty structs safely", "summary": "List the field names of structs, struct arrays, or objects.", "code": "emptyScalar = struct();\nemptyArray = struct(\"id\", {});\nfs = fieldnames(emptyScalar);\nfa = fieldnames(emptyArray)", "output": "fs =\n 0x1 empty cell array\n\nfa =\n 0x1 empty cell array", "keywords": ["fieldnames", "struct", "introspection", "struct array", "object", "handle", "properties"], "suggestedPath": "/fieldnames-6.m" }, { "id": "fileread:1", "builtinKey": "fileread", "builtinTitle": "fileread", "builtinSlug": "fileread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Read Entire File Into A Character Vector", "summary": "Read the entire contents of a text file into a 1-by-N character vector.", "code": "text = fileread(\"LICENSE.md\")", "output": "text =\n Character vector containing the full license text", "keywords": ["fileread", "io", "read file", "text file", "character vector"], "suggestedPath": "/fileread-1.m" }, { "id": "fileread:2", "builtinKey": "fileread", "builtinTitle": "fileread", "builtinSlug": "fileread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Read A File Using A Relative Path", "summary": "Read the entire contents of a text file into a 1-by-N character vector.", "code": "text = fileread(\"data/config.json\")", "output": "text =\n Returns the JSON file contents as a character vector", "keywords": ["fileread", "io", "read file", "text file", "character vector"], "suggestedPath": "/fileread-2.m" }, { "id": "fileread:3", "builtinKey": "fileread", "builtinTitle": "fileread", "builtinSlug": "fileread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Preserve Extended ASCII Bytes", "summary": "Read the entire contents of a text file into a 1-by-N character vector.", "code": "bytes = fileread(\"fixtures/high_ascii.txt\");\ndouble_values = double(bytes)", "output": "double_values =\n 65 66 67", "keywords": ["fileread", "io", "read file", "text file", "character vector"], "suggestedPath": "/fileread-3.m" }, { "id": "fileread:4", "builtinKey": "fileread", "builtinTitle": "fileread", "builtinSlug": "fileread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Convert File Contents To A String Scalar", "summary": "Read the entire contents of a text file into a 1-by-N character vector.", "code": "raw = fileread(\"README.md\");\ndoc = string(raw)", "output": "doc =\n \"RunMat docs\"", "keywords": ["fileread", "io", "read file", "text file", "character vector"], "suggestedPath": "/fileread-4.m" }, { "id": "fileread:5", "builtinKey": "fileread", "builtinTitle": "fileread", "builtinSlug": "fileread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Read A File With UTF-8 Decoding Explicitly", "summary": "Read the entire contents of a text file into a 1-by-N character vector.", "code": "text = fileread(\"data/report.txt\", 'Encoding', 'utf-8')", "output": "text =\n Character vector decoded using UTF-8.", "keywords": ["fileread", "io", "read file", "text file", "character vector"], "suggestedPath": "/fileread-5.m" }, { "id": "fileread:6", "builtinKey": "fileread", "builtinTitle": "fileread", "builtinSlug": "fileread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Handle Missing Files With Try/Catch", "summary": "Read the entire contents of a text file into a 1-by-N character vector.", "code": "try\n fileread(\"missing.txt\");\ncatch err\n disp(err.message);\nend", "output": "fileread: unable to read 'missing.txt': readFile: not found", "keywords": ["fileread", "io", "read file", "text file", "character vector"], "suggestedPath": "/fileread-6.m" }, { "id": "filewrite:1", "builtinKey": "filewrite", "builtinTitle": "filewrite", "builtinSlug": "filewrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write Text To A New File", "summary": "Write text or raw bytes to a file with optional encoding and write-mode control.", "code": "bytes = filewrite(\"notes.txt\", \"Hello, RunMat!\")", "output": "bytes = 14", "keywords": ["filewrite", "io", "write file", "text file", "append", "encoding"], "suggestedPath": "/filewrite-1.m" }, { "id": "filewrite:2", "builtinKey": "filewrite", "builtinTitle": "filewrite", "builtinSlug": "filewrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Append Text Without Overwriting", "summary": "Write text or raw bytes to a file with optional encoding and write-mode control.", "code": "filewrite(\"log.txt\", \"First line\\n\");\nbytes = filewrite(\"log.txt\", \"Second line\\n\", 'WriteMode', 'append')", "output": "bytes = 13", "keywords": ["filewrite", "io", "write file", "text file", "append", "encoding"], "suggestedPath": "/filewrite-2.m" }, { "id": "filewrite:3", "builtinKey": "filewrite", "builtinTitle": "filewrite", "builtinSlug": "filewrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Specify A Particular Encoding", "summary": "Write text or raw bytes to a file with optional encoding and write-mode control.", "code": "bytes = filewrite(\"latin1.txt\", ['E' 's' 'p' 'a' char(241) 'a'], 'Encoding', 'latin1')", "output": "bytes = 6", "keywords": ["filewrite", "io", "write file", "text file", "append", "encoding"], "suggestedPath": "/filewrite-3.m" }, { "id": "filewrite:4", "builtinKey": "filewrite", "builtinTitle": "filewrite", "builtinSlug": "filewrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write Raw Bytes From A Numeric Array", "summary": "Write text or raw bytes to a file with optional encoding and write-mode control.", "code": "payload = [1 2 3 255];\nbytes = filewrite(\"data.bin\", payload, 'Encoding', 'raw')", "output": "bytes = 4", "keywords": ["filewrite", "io", "write file", "text file", "append", "encoding"], "suggestedPath": "/filewrite-4.m" }, { "id": "filewrite:5", "builtinKey": "filewrite", "builtinTitle": "filewrite", "builtinSlug": "filewrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Export A String Array As Newline-Separated Text", "summary": "Write text or raw bytes to a file with optional encoding and write-mode control.", "code": "lines = [\"alpha\", \"beta\", \"gamma\"];\nbytes = filewrite(\"items.txt\", lines)", "output": "bytes = 16", "keywords": ["filewrite", "io", "write file", "text file", "append", "encoding"], "suggestedPath": "/filewrite-5.m" }, { "id": "filewrite:6", "builtinKey": "filewrite", "builtinTitle": "filewrite", "builtinSlug": "filewrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Handle Invalid ASCII Characters", "summary": "Write text or raw bytes to a file with optional encoding and write-mode control.", "code": "try\n filewrite(\"ascii.txt\", ['c' 'a' 'f' char(233)], 'Encoding', 'ascii');\ncatch err\n disp(err.message);\nend", "output": "filewrite: character 'é' (U+00E9) cannot be encoded as ASCII", "keywords": ["filewrite", "io", "write file", "text file", "append", "encoding"], "suggestedPath": "/filewrite-6.m" }, { "id": "fill:1", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 3x3 matrix of 2.5s", "summary": "Create MATLAB arrays filled with a constant value.", "code": "A = fill(2.5, 3)", "output": "A = [2.5 2.5 2.5; 2.5 2.5 2.5; 2.5 2.5 2.5]", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-1.m" }, { "id": "fill:2", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Filling a rectangular matrix with -4", "summary": "Create MATLAB arrays filled with a constant value.", "code": "B = fill(-4, 2, 5)", "output": "B = [-4 -4 -4 -4 -4; -4 -4 -4 -4 -4]", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-2.m" }, { "id": "fill:3", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Filling using a size vector", "summary": "Create MATLAB arrays filled with a constant value.", "code": "sz = [2 3 4];\nC = fill(10, sz)", "output": "size(C) % 2-by-3-by-4", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-3.m" }, { "id": "fill:4", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a logical mask with `fill`", "summary": "Create MATLAB arrays filled with a constant value.", "code": "mask = fill(3, 4, 1, 'logical')", "output": "mask = [1; 1; 1; 1]", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-4.m" }, { "id": "fill:5", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Matching an existing array with `'like'`", "summary": "Create MATLAB arrays filled with a constant value.", "code": "prototype = rand(2, 3, 'like', gpuArray(1));\nD = fill(pi, 2, 3, 'like', prototype);\ngather(D)", "output": "3.1416 3.1416 3.1416 3.1416 3.1416 3.1416", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-5.m" }, { "id": "fill:6", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Filling a complex array", "summary": "Create MATLAB arrays filled with a constant value.", "code": "E = fill(1 + 2i, 2, 2, 'complex')", "output": "E = [1+2i 1+2i; 1+2i 1+2i]", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-6.m" }, { "id": "fill:7", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Using a prototype to infer shape automatically", "summary": "Create MATLAB arrays filled with a constant value.", "code": "F = rand(4, 2);\nG = fill(7, F)", "output": "isequal(size(G), [4 2]) % true", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-7.m" }, { "id": "fill:8", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Filling an empty matrix", "summary": "Create MATLAB arrays filled with a constant value.", "code": "H = fill(0, 0, 5)", "output": "size(H) % 0-by-5", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-8.m" }, { "id": "fill:9", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Keeping GPU residency without explicit `gpuArray`", "summary": "Create MATLAB arrays filled with a constant value.", "code": "A = rand(512, 512);\nJ = fill(0.5, size(A), 'like', gpuArray(A))", "output": "isa(J, 'gpuArray') % true", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-9.m" }, { "id": "fill:10", "builtinKey": "fill", "builtinTitle": "fill", "builtinSlug": "fill", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Filling with boolean semantics", "summary": "Create MATLAB arrays filled with a constant value.", "code": "K = fill(false, [2 2], 'logical')", "output": "K = [0 0; 0 0]", "keywords": ["fill", "constant", "array", "gpu", "like"], "suggestedPath": "/fill-10.m" }, { "id": "filter:1", "builtinKey": "filter", "builtinTitle": "filter", "builtinSlug": "filter", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Smoothing a signal with an FIR moving-average filter", "summary": "Apply an IIR/FIR digital filter to scalars, vectors, or tensors with MATLAB-compatible semantics.", "code": "b = ones(1, 3) / 3;\na = 1;\nx = [1 5 2 0 3];\ny = filter(b, a, x)", "output": "y =\n 0.3333 2.0000 2.6667 2.3333 1.6667", "keywords": ["filter", "IIR", "FIR", "difference equation", "initial conditions", "gpu"], "suggestedPath": "/filter-1.m" }, { "id": "filter:2", "builtinKey": "filter", "builtinTitle": "filter", "builtinSlug": "filter", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Applying a first-order IIR low-pass filter", "summary": "Apply an IIR/FIR digital filter to scalars, vectors, or tensors with MATLAB-compatible semantics.", "code": "alpha = 0.8;\nb = 1 - alpha;\na = [1 -alpha];\nimp = [1 zeros(1, 4)];\ny = filter(b, a, imp)", "output": "y =\n 0.2000 0.1600 0.1280 0.1024 0.0819", "keywords": ["filter", "IIR", "FIR", "difference equation", "initial conditions", "gpu"], "suggestedPath": "/filter-2.m" }, { "id": "filter:3", "builtinKey": "filter", "builtinTitle": "filter", "builtinSlug": "filter", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Continuing a filtered stream with explicit initial conditions", "summary": "Apply an IIR/FIR digital filter to scalars, vectors, or tensors with MATLAB-compatible semantics.", "code": "b = ones(1, 3) / 3;\na = 1;\nx1 = [1 5 2];\n[y1, zf] = filter(b, a, x1); % First chunk\n\nx2 = [0 3];\n[y2, zf2] = filter(b, a, x2, zf); % Resume with stored state", "output": "y1 = [0.3333 2.0000 2.6667]\nzf = [2.3333 0.6667]\n\ny2 = [2.3333 1.6667]\nzf2 = [1.0000 1.0000]", "keywords": ["filter", "IIR", "FIR", "difference equation", "initial conditions", "gpu"], "suggestedPath": "/filter-3.m" }, { "id": "filter:4", "builtinKey": "filter", "builtinTitle": "filter", "builtinSlug": "filter", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Filtering along matrix rows (dimension 2)", "summary": "Apply an IIR/FIR digital filter to scalars, vectors, or tensors with MATLAB-compatible semantics.", "code": "X = [1 2 3 4;\n 0 1 0 1];\nb = [1 -1]; % simple differentiator\na = 1;\nY = filter(b, a, X, [], 2)", "output": "Y =\n 1 1 1 1\n 0 1 -1 1", "keywords": ["filter", "IIR", "FIR", "difference equation", "initial conditions", "gpu"], "suggestedPath": "/filter-4.m" }, { "id": "filter:5", "builtinKey": "filter", "builtinTitle": "filter", "builtinSlug": "filter", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Filtering complex-valued data", "summary": "Apply an IIR/FIR digital filter to scalars, vectors, or tensors with MATLAB-compatible semantics.", "code": "b = [1 1i];\na = 1;\nt = 0:3;\nx = exp(1i * pi/4 * t);\ny = filter(b, a, x)", "output": "y =\n 1.0000 + 0.0000i 0.7071 + 1.7071i -0.7071 + 1.7071i -1.7071 + 0.7071i", "keywords": ["filter", "IIR", "FIR", "difference equation", "initial conditions", "gpu"], "suggestedPath": "/filter-5.m" }, { "id": "filter:6", "builtinKey": "filter", "builtinTitle": "filter", "builtinSlug": "filter", "category": "math/signal", "categoryPath": ["math", "signal"], "exampleTitle": "Executing a real filter on the GPU", "summary": "Apply an IIR/FIR digital filter to scalars, vectors, or tensors with MATLAB-compatible semantics.", "code": "g = gpuArray([1 5 2 0 3]);\nb = ones(1, 3) / 3;\na = 1;\n[y_gpu, zf_gpu] = filter(b, a, g);\ny = gather(y_gpu)", "output": "y =\n 0.3333 2.0000 2.6667 2.3333 1.6667", "keywords": ["filter", "IIR", "FIR", "difference equation", "initial conditions", "gpu"], "suggestedPath": "/filter-6.m" }, { "id": "filter2:1", "builtinKey": "filter2", "builtinTitle": "filter2", "builtinSlug": "filter2", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Averaging a matrix with a 3x3 kernel", "summary": "Apply 2-D correlation or convolution using MATLAB-compatible semantics.", "code": "H = ones(3) / 9;\nX = [1 2 3; 4 5 6; 7 8 9];\nY = filter2(H, X)", "output": "Y =\n 1.3333 2.3333 1.7778\n 3.0000 5.0000 3.6667\n 2.6667 4.3333 3.1111", "keywords": ["filter2", "correlation", "convolution", "image filtering", "gpu"], "suggestedPath": "/filter2-1.m" }, { "id": "filter2:2", "builtinKey": "filter2", "builtinTitle": "filter2", "builtinSlug": "filter2", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Requesting the full correlation result", "summary": "Apply 2-D correlation or convolution using MATLAB-compatible semantics.", "code": "H = [1 2; 3 4];\nX = [4 1; 2 0];\nY = filter2(H, X, 'full')", "output": "Y =\n 16 16 3\n 16 12 1\n 4 2 0", "keywords": ["filter2", "correlation", "convolution", "image filtering", "gpu"], "suggestedPath": "/filter2-2.m" }, { "id": "filter2:3", "builtinKey": "filter2", "builtinTitle": "filter2", "builtinSlug": "filter2", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Restricting the result to the valid interior", "summary": "Apply 2-D correlation or convolution using MATLAB-compatible semantics.", "code": "H = ones(3);\nX = magic(5);\nY = filter2(H, X, 'valid')", "output": "Y =\n 100 98 116\n 99 117 135\n 118 136 134", "keywords": ["filter2", "correlation", "convolution", "image filtering", "gpu"], "suggestedPath": "/filter2-3.m" }, { "id": "filter2:4", "builtinKey": "filter2", "builtinTitle": "filter2", "builtinSlug": "filter2", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Switching to convolution mode", "summary": "Apply 2-D correlation or convolution using MATLAB-compatible semantics.", "code": "H = [1 2; 3 4];\nX = [1 2 3; 4 5 6; 7 8 9];\nY = filter2(H, X, 'conv')", "output": "Y =\n 1 4 7\n 7 23 33\n 19 53 63", "keywords": ["filter2", "correlation", "convolution", "image filtering", "gpu"], "suggestedPath": "/filter2-4.m" }, { "id": "filter2:5", "builtinKey": "filter2", "builtinTitle": "filter2", "builtinSlug": "filter2", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Filtering data already on the GPU", "summary": "Apply 2-D correlation or convolution using MATLAB-compatible semantics.", "code": "H = gpuArray([1 0 -1; 1 0 -1; 1 0 -1]);\nX = gpuArray([1 2 3; 4 5 6; 7 8 9]);\nY = filter2(H, X);\nresult = gather(Y)", "output": "result =\n -7 -4 7\n -15 -6 15\n -13 -4 13", "keywords": ["filter2", "correlation", "convolution", "image filtering", "gpu"], "suggestedPath": "/filter2-5.m" }, { "id": "find:1", "builtinKey": "find", "builtinTitle": "find", "builtinSlug": "find", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Finding linear indices of nonzero elements", "summary": "Locate indices and values of nonzero elements in scalars, vectors, matrices, or N-D tensors.", "code": "A = [0 4 0; 7 0 9];\nk = find(A)", "output": "k =\n 2\n 4\n 6", "keywords": ["find", "nonzero", "indices", "row", "column", "gpu"], "suggestedPath": "/find-1.m" }, { "id": "find:2", "builtinKey": "find", "builtinTitle": "find", "builtinSlug": "find", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Limiting the number of matches", "summary": "Locate indices and values of nonzero elements in scalars, vectors, matrices, or N-D tensors.", "code": "A = [0 3 5 0 8];\nfirst_two = find(A, 2)", "output": "first_two =\n 2\n 3", "keywords": ["find", "nonzero", "indices", "row", "column", "gpu"], "suggestedPath": "/find-2.m" }, { "id": "find:3", "builtinKey": "find", "builtinTitle": "find", "builtinSlug": "find", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Locating the last nonzero element", "summary": "Locate indices and values of nonzero elements in scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 0 0 6 0 2];\nlast_index = find(A, 'last')", "output": "last_index =\n 6", "keywords": ["find", "nonzero", "indices", "row", "column", "gpu"], "suggestedPath": "/find-3.m" }, { "id": "find:4", "builtinKey": "find", "builtinTitle": "find", "builtinSlug": "find", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Retrieving row and column subscripts", "summary": "Locate indices and values of nonzero elements in scalars, vectors, matrices, or N-D tensors.", "code": "A = [0 4 0; 7 0 9];\n[rows, cols] = find(A)", "output": "rows =\n 2\n 1\n 2\n\ncols =\n 1\n 2\n 3", "keywords": ["find", "nonzero", "indices", "row", "column", "gpu"], "suggestedPath": "/find-4.m" }, { "id": "find:5", "builtinKey": "find", "builtinTitle": "find", "builtinSlug": "find", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Capturing values alongside indices (including complex inputs)", "summary": "Locate indices and values of nonzero elements in scalars, vectors, matrices, or N-D tensors.", "code": "Z = [0 1+2i; 0 0; 3-4i 0];\n[r, c, v] = find(Z)", "output": "r =\n 1\n 3\n\nc =\n 1\n 1\n\nv =\n 1.0000 + 2.0000i\n 3.0000 - 4.0000i", "keywords": ["find", "nonzero", "indices", "row", "column", "gpu"], "suggestedPath": "/find-5.m" }, { "id": "fix:1", "builtinKey": "fix", "builtinTitle": "fix", "builtinSlug": "fix", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Truncating positive and negative values toward zero", "summary": "Round scalars, vectors, matrices, or N-D tensors toward zero.", "code": "values = [-3.7 -2.4 -0.6 0 0.6 2.4 3.7];\ntruncated = fix(values)", "output": "truncated = [-3 -2 0 0 0 2 3]", "keywords": ["fix", "truncate", "rounding", "toward zero", "gpu"], "suggestedPath": "/fix-1.m" }, { "id": "fix:2", "builtinKey": "fix", "builtinTitle": "fix", "builtinSlug": "fix", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Removing fractional parts from a matrix", "summary": "Round scalars, vectors, matrices, or N-D tensors toward zero.", "code": "A = [1.9 4.1; -2.8 0.5];\nB = fix(A)", "output": "B = [1 4; -2 0]", "keywords": ["fix", "truncate", "rounding", "toward zero", "gpu"], "suggestedPath": "/fix-2.m" }, { "id": "fix:3", "builtinKey": "fix", "builtinTitle": "fix", "builtinSlug": "fix", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Keeping GPU residency when kernels are available", "summary": "Round scalars, vectors, matrices, or N-D tensors toward zero.", "code": "G = gpuArray(linspace(-2.4, 2.4, 6));\ntruncGpu = fix(G);\nhostValues = gather(truncGpu)", "output": "hostValues = [-2 -1 0 0 1 2]", "keywords": ["fix", "truncate", "rounding", "toward zero", "gpu"], "suggestedPath": "/fix-3.m" }, { "id": "fix:4", "builtinKey": "fix", "builtinTitle": "fix", "builtinSlug": "fix", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Dropping fractional parts of complex numbers", "summary": "Round scalars, vectors, matrices, or N-D tensors toward zero.", "code": "z = [1.9 + 2.6i, -3.4 - 0.2i];\nfixed = fix(z)", "output": "fixed = [1 + 2i, -3 + 0i]", "keywords": ["fix", "truncate", "rounding", "toward zero", "gpu"], "suggestedPath": "/fix-4.m" }, { "id": "fix:5", "builtinKey": "fix", "builtinTitle": "fix", "builtinSlug": "fix", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Converting character arrays to truncated numeric codes", "summary": "Round scalars, vectors, matrices, or N-D tensors toward zero.", "code": "letters = ['A' 'B' 'C'];\ncodes = fix(letters)", "output": "codes = [65 66 67]", "keywords": ["fix", "truncate", "rounding", "toward zero", "gpu"], "suggestedPath": "/fix-5.m" }, { "id": "flip:1", "builtinKey": "flip", "builtinTitle": "flip", "builtinSlug": "flip", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reversing a Row Vector", "summary": "Reverse the order of elements along specific dimensions.", "code": "row = 1:5;\nrev = flip(row)", "output": "rev = [5 4 3 2 1]", "keywords": ["flip", "reverse", "dimension", "gpu", "horizontal", "vertical"], "suggestedPath": "/flip-1.m" }, { "id": "flip:2", "builtinKey": "flip", "builtinTitle": "flip", "builtinSlug": "flip", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reversing Matrix Rows (Vertical Flip)", "summary": "Reverse the order of elements along specific dimensions.", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nB = flip(A)", "output": "B =\n 7 8 9\n 4 5 6\n 1 2 3", "keywords": ["flip", "reverse", "dimension", "gpu", "horizontal", "vertical"], "suggestedPath": "/flip-2.m" }, { "id": "flip:3", "builtinKey": "flip", "builtinTitle": "flip", "builtinSlug": "flip", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Flipping Columns with the Horizontal Direction Keyword", "summary": "Reverse the order of elements along specific dimensions.", "code": "A = magic(3);\nH = flip(A, 'horizontal')", "output": "H =\n 2 7 6\n 9 5 1\n 4 3 8", "keywords": ["flip", "reverse", "dimension", "gpu", "horizontal", "vertical"], "suggestedPath": "/flip-3.m" }, { "id": "flip:4", "builtinKey": "flip", "builtinTitle": "flip", "builtinSlug": "flip", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Flipping Along Multiple Dimensions", "summary": "Reverse the order of elements along specific dimensions.", "code": "T = reshape(1:8, [2 2 2]);\nF = flip(T, [1 3])", "output": "F(:,:,1) =\n 3 4\n 1 2\n\nF(:,:,2) =\n 7 8\n 5 6", "keywords": ["flip", "reverse", "dimension", "gpu", "horizontal", "vertical"], "suggestedPath": "/flip-4.m" }, { "id": "flip:5", "builtinKey": "flip", "builtinTitle": "flip", "builtinSlug": "flip", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Flipping Character Data", "summary": "Reverse the order of elements along specific dimensions.", "code": "C = ['r','u','n'; 'm','a','t'];\nCt = flip(C, 'horizontal')", "output": "Ct =\n 'nur'\n 'tam'", "keywords": ["flip", "reverse", "dimension", "gpu", "horizontal", "vertical"], "suggestedPath": "/flip-5.m" }, { "id": "flip:6", "builtinKey": "flip", "builtinTitle": "flip", "builtinSlug": "flip", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Flipping gpuArray Data While Staying on the Device", "summary": "Reverse the order of elements along specific dimensions.", "code": "G = gpuArray(rand(4, 4));\nV = flip(G, 'vertical');\nisgpuarray(V)", "output": "ans = logical 1", "keywords": ["flip", "reverse", "dimension", "gpu", "horizontal", "vertical"], "suggestedPath": "/flip-6.m" }, { "id": "fliplr:1", "builtinKey": "fliplr", "builtinTitle": "fliplr", "builtinSlug": "fliplr", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reverse Columns of a Matrix", "summary": "Flip an array left-to-right along the second dimension.", "code": "A = [1 2 3; 4 5 6];\nB = fliplr(A)", "output": "B =\n 3 2 1\n 6 5 4", "keywords": ["fliplr", "flip", "horizontal", "matrix", "gpu"], "suggestedPath": "/fliplr-1.m" }, { "id": "fliplr:2", "builtinKey": "fliplr", "builtinTitle": "fliplr", "builtinSlug": "fliplr", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Mirror an Image Matrix Horizontally", "summary": "Flip an array left-to-right along the second dimension.", "code": "img = reshape(1:16, 4, 4);\nmirrored = fliplr(img)", "output": "mirrored =\n 4 3 2 1\n 8 7 6 5\n 12 11 10 9\n 16 15 14 13", "keywords": ["fliplr", "flip", "horizontal", "matrix", "gpu"], "suggestedPath": "/fliplr-2.m" }, { "id": "fliplr:3", "builtinKey": "fliplr", "builtinTitle": "fliplr", "builtinSlug": "fliplr", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Flip the Order of Polynomial Coefficients", "summary": "Flip an array left-to-right along the second dimension.", "code": "c = [1 0 -2 5];\nrev = fliplr(c)", "output": "rev = [5 -2 0 1]", "keywords": ["fliplr", "flip", "horizontal", "matrix", "gpu"], "suggestedPath": "/fliplr-3.m" }, { "id": "fliplr:4", "builtinKey": "fliplr", "builtinTitle": "fliplr", "builtinSlug": "fliplr", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reverse Each Slice in a 3-D Array Along Columns", "summary": "Flip an array left-to-right along the second dimension.", "code": "T = reshape(1:24, [3 4 2]);\nF = fliplr(T)", "output": "F(:,:,1) =\n 4 3 2 1\n 8 7 6 5\n 12 11 10 9\n\nF(:,:,2) =\n 16 15 14 13\n 20 19 18 17\n 24 23 22 21", "keywords": ["fliplr", "flip", "horizontal", "matrix", "gpu"], "suggestedPath": "/fliplr-4.m" }, { "id": "fliplr:5", "builtinKey": "fliplr", "builtinTitle": "fliplr", "builtinSlug": "fliplr", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Preserve Column Vector Orientation", "summary": "Flip an array left-to-right along the second dimension.", "code": "col = (1:4)';\nsame = fliplr(col)", "output": "same =\n 1\n 2\n 3\n 4", "keywords": ["fliplr", "flip", "horizontal", "matrix", "gpu"], "suggestedPath": "/fliplr-5.m" }, { "id": "fliplr:6", "builtinKey": "fliplr", "builtinTitle": "fliplr", "builtinSlug": "fliplr", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Flip Characters in a Two-Row Char Array", "summary": "Flip an array left-to-right along the second dimension.", "code": "C = ['r','u','n'; 'm','a','t'];\nCt = fliplr(C)", "output": "Ct =\n 'nur'\n 'tam'", "keywords": ["fliplr", "flip", "horizontal", "matrix", "gpu"], "suggestedPath": "/fliplr-6.m" }, { "id": "fliplr:7", "builtinKey": "fliplr", "builtinTitle": "fliplr", "builtinSlug": "fliplr", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Keep gpuArray Results on the Device While Flipping Columns", "summary": "Flip an array left-to-right along the second dimension.", "code": "G = gpuArray(rand(8, 8));\nH = fliplr(G)", "keywords": ["fliplr", "flip", "horizontal", "matrix", "gpu"], "suggestedPath": "/fliplr-7.m" }, { "id": "flipud:1", "builtinKey": "flipud", "builtinTitle": "flipud", "builtinSlug": "flipud", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reverse Rows of a Matrix", "summary": "Flip an array up-to-down along the first dimension.", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nB = flipud(A)", "output": "B =\n 7 8 9\n 4 5 6\n 1 2 3", "keywords": ["flipud", "flip", "vertical", "matrix", "gpu"], "suggestedPath": "/flipud-1.m" }, { "id": "flipud:2", "builtinKey": "flipud", "builtinTitle": "flipud", "builtinSlug": "flipud", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reverse a Column Vector", "summary": "Flip an array up-to-down along the first dimension.", "code": "col = (1:4)';\nrev = flipud(col)", "output": "rev =\n 4\n 3\n 2\n 1", "keywords": ["flipud", "flip", "vertical", "matrix", "gpu"], "suggestedPath": "/flipud-2.m" }, { "id": "flipud:3", "builtinKey": "flipud", "builtinTitle": "flipud", "builtinSlug": "flipud", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Flip the First Dimension of a 3-D Tensor", "summary": "Flip an array up-to-down along the first dimension.", "code": "T = reshape(1:24, [3 4 2]);\nF = flipud(T)", "output": "F(:,:,1) =\n 3 6 9 12\n 2 5 8 11\n 1 4 7 10\n\nF(:,:,2) =\n 15 18 21 24\n 14 17 20 23\n 13 16 19 22", "keywords": ["flipud", "flip", "vertical", "matrix", "gpu"], "suggestedPath": "/flipud-3.m" }, { "id": "flipud:4", "builtinKey": "flipud", "builtinTitle": "flipud", "builtinSlug": "flipud", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Flip Characters in a Char Array Vertically", "summary": "Flip an array up-to-down along the first dimension.", "code": "C = ['run'; 'mat'];\nCv = flipud(C)", "output": "Cv =\n 'mat'\n 'run'", "keywords": ["flipud", "flip", "vertical", "matrix", "gpu"], "suggestedPath": "/flipud-4.m" }, { "id": "flipud:5", "builtinKey": "flipud", "builtinTitle": "flipud", "builtinSlug": "flipud", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Preserve Row Vector Orientation", "summary": "Flip an array up-to-down along the first dimension.", "code": "row = 1:5;\nsame = flipud(row)", "output": "same = [1 2 3 4 5]", "keywords": ["flipud", "flip", "vertical", "matrix", "gpu"], "suggestedPath": "/flipud-5.m" }, { "id": "flipud:6", "builtinKey": "flipud", "builtinTitle": "flipud", "builtinSlug": "flipud", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Keep gpuArray Results on the Device While Flipping Rows", "summary": "Flip an array up-to-down along the first dimension.", "code": "G = gpuArray(rand(8, 8));\nH = flipud(G);\nisequal(gather(H), flipud(gather(G))) % illustrative verification", "keywords": ["flipud", "flip", "vertical", "matrix", "gpu"], "suggestedPath": "/flipud-6.m" }, { "id": "floor:1", "builtinKey": "floor", "builtinTitle": "floor", "builtinSlug": "floor", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Flooring positive and negative scalars", "summary": "Round scalars, vectors, matrices, or N-D tensors toward negative infinity or to specified digits.", "code": "x = [-2.7, -0.3, 0, 0.8, 3.9];\ny = floor(x)", "output": "y = [-3, -1, 0, 0, 3]", "keywords": ["floor", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/floor-1.m" }, { "id": "floor:2", "builtinKey": "floor", "builtinTitle": "floor", "builtinSlug": "floor", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Flooring every element of a matrix", "summary": "Round scalars, vectors, matrices, or N-D tensors toward negative infinity or to specified digits.", "code": "A = [1.2 4.7; -3.4 5.0];\nB = floor(A)", "output": "B = [1 4; -4 5]", "keywords": ["floor", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/floor-2.m" }, { "id": "floor:3", "builtinKey": "floor", "builtinTitle": "floor", "builtinSlug": "floor", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Flooring fractions stored in a tensor", "summary": "Round scalars, vectors, matrices, or N-D tensors toward negative infinity or to specified digits.", "code": "t = reshape([-1.8, -0.2, 0.4, 1.9, 2.1, 3.6], [3, 2]);\nfloored = floor(t)", "output": "floored =\n [-2 1;\n -1 2;\n 0 3]", "keywords": ["floor", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/floor-3.m" }, { "id": "floor:4", "builtinKey": "floor", "builtinTitle": "floor", "builtinSlug": "floor", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Flooring values to a fixed number of decimal places", "summary": "Round scalars, vectors, matrices, or N-D tensors toward negative infinity or to specified digits.", "code": "temps = [21.456 19.995 22.501];\nfloored = floor(temps, 2)", "output": "floored = [21.45 19.99 22.50]", "keywords": ["floor", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/floor-4.m" }, { "id": "floor:5", "builtinKey": "floor", "builtinTitle": "floor", "builtinSlug": "floor", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Flooring to significant digits", "summary": "Round scalars, vectors, matrices, or N-D tensors toward negative infinity or to specified digits.", "code": "measurements = [0.001234 12.3456 98765];\nsig2 = floor(measurements, 2, 'significant')", "output": "sig2 = [0.0012 12.0 98000]", "keywords": ["floor", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/floor-5.m" }, { "id": "floor:6", "builtinKey": "floor", "builtinTitle": "floor", "builtinSlug": "floor", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Flooring complex numbers component-wise", "summary": "Round scalars, vectors, matrices, or N-D tensors toward negative infinity or to specified digits.", "code": "z = [1.7 + 2.1i, -0.2 - 3.9i];\nresult = floor(z)", "output": "result = [1 + 2i, -1 - 4i]", "keywords": ["floor", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/floor-6.m" }, { "id": "floor:7", "builtinKey": "floor", "builtinTitle": "floor", "builtinSlug": "floor", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Keeping GPU data on device when the provider supports `unary_floor`", "summary": "Round scalars, vectors, matrices, or N-D tensors toward negative infinity or to specified digits.", "code": "G = gpuArray([1.8 -0.2 0.0; -1.1 2.5 -3.4]);\nfloored = floor(G);\nH = gather(floored)", "output": "H =\n [ 1 -1 0;\n -2 2 -4]", "keywords": ["floor", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/floor-7.m" }, { "id": "floor:8", "builtinKey": "floor", "builtinTitle": "floor", "builtinSlug": "floor", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Forcing GPU residency with a `'like'` prototype", "summary": "Round scalars, vectors, matrices, or N-D tensors toward negative infinity or to specified digits.", "code": "A = [1.8 -0.2; 2.7 3.4];\nproto = gpuArray(0);\nG = floor(A, 'like', proto); % Result remains on the GPU\nresult = gather(G)", "output": "result =\n [ 1 -1;\n 2 3]", "keywords": ["floor", "rounding", "digits", "significant digits", "gpu", "like"], "suggestedPath": "/floor-8.m" }, { "id": "fopen:1", "builtinKey": "fopen", "builtinTitle": "fopen", "builtinSlug": "fopen", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Open a File for Reading", "summary": "Open a file and obtain a MATLAB-compatible file identifier.", "code": "[fid, message] = fopen('data/input.txt', 'r');\nif fid == -1\n error('Failed to open file: %s', message);\nend", "keywords": ["fopen", "file", "io", "permission", "encoding", "machine format"], "suggestedPath": "/fopen-1.m" }, { "id": "fopen:2", "builtinKey": "fopen", "builtinTitle": "fopen", "builtinSlug": "fopen", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write Text to a New File", "summary": "Open a file and obtain a MATLAB-compatible file identifier.", "code": "[fid, message] = fopen('logs/session.log', 'w');\nif fid == -1\n error('Failed to create log file: %s', message);\nend\nfprintf(fid, 'Session started\\n');\nfclose(fid)", "keywords": ["fopen", "file", "io", "permission", "encoding", "machine format"], "suggestedPath": "/fopen-2.m" }, { "id": "fopen:3", "builtinKey": "fopen", "builtinTitle": "fopen", "builtinSlug": "fopen", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Append Binary Data", "summary": "Open a file and obtain a MATLAB-compatible file identifier.", "code": "[fid, message] = fopen('signals.bin', 'ab+');\nif fid == -1\n error('Failed to open binary log: %s', message);\nend\nfwrite(fid, rand(1, 1024), 'double');\nfclose(fid)", "keywords": ["fopen", "file", "io", "permission", "encoding", "machine format"], "suggestedPath": "/fopen-3.m" }, { "id": "fopen:4", "builtinKey": "fopen", "builtinTitle": "fopen", "builtinSlug": "fopen", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Query File Metadata", "summary": "Open a file and obtain a MATLAB-compatible file identifier.", "code": "fid = fopen('config.json');\n[filename, permission, machinefmt, encoding] = fopen(fid);\ndisp(filename);\ndisp(permission);\nfclose(fid)", "keywords": ["fopen", "file", "io", "permission", "encoding", "machine format"], "suggestedPath": "/fopen-4.m" }, { "id": "fopen:5", "builtinKey": "fopen", "builtinTitle": "fopen", "builtinSlug": "fopen", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "List All Open Files", "summary": "Open a file and obtain a MATLAB-compatible file identifier.", "code": "[fid_list, names] = fopen('all');\ndisp(fid_list);\ndisp(names)", "keywords": ["fopen", "file", "io", "permission", "encoding", "machine format"], "suggestedPath": "/fopen-5.m" }, { "id": "fopen:6", "builtinKey": "fopen", "builtinTitle": "fopen", "builtinSlug": "fopen", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Handle Missing Files Gracefully", "summary": "Open a file and obtain a MATLAB-compatible file identifier.", "code": "[fid, message] = fopen('does_not_exist.txt', 'r');\nif fid == -1\n fprintf('Failed to open file: %s\\n', message);\nend", "keywords": ["fopen", "file", "io", "permission", "encoding", "machine format"], "suggestedPath": "/fopen-6.m" }, { "id": "fopen:7", "builtinKey": "fopen", "builtinTitle": "fopen", "builtinSlug": "fopen", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Specify Machine Format and Encoding", "summary": "Open a file and obtain a MATLAB-compatible file identifier.", "code": "[fid, message, machinefmt, encoding] = fopen('report.txt', 'w', 'ieee-le', 'latin1');\nif fid == -1\n error('Failed to open report: %s', message);\nend\nfprintf(fid, 'olá mundo');\nfclose(fid)", "keywords": ["fopen", "file", "io", "permission", "encoding", "machine format"], "suggestedPath": "/fopen-7.m" }, { "id": "fprintf:1", "builtinKey": "fprintf", "builtinTitle": "fprintf", "builtinSlug": "fprintf", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write Formatted Text To A File", "summary": "Write formatted text to files or standard output/error using MATLAB-compatible semantics.", "code": "[fid, msg] = fopen('report.txt', 'w');\nassert(fid ~= -1, msg);\nfprintf(fid, 'Total: %d (%.2f%%)\\n', 42, 87.5);\nfclose(fid)", "keywords": ["fprintf", "format", "printf", "write file", "stdout", "stderr", "encoding"], "suggestedPath": "/fprintf-1.m" }, { "id": "fprintf:2", "builtinKey": "fprintf", "builtinTitle": "fprintf", "builtinSlug": "fprintf", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Use Standard Output Without An Explicit File Identifier", "summary": "Write formatted text to files or standard output/error using MATLAB-compatible semantics.", "code": "n = 42;\nfprintf('Processed %d items\\n', n)", "keywords": ["fprintf", "format", "printf", "write file", "stdout", "stderr", "encoding"], "suggestedPath": "/fprintf-2.m" }, { "id": "fprintf:3", "builtinKey": "fprintf", "builtinTitle": "fprintf", "builtinSlug": "fprintf", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write To Standard Error Using The Stream Name", "summary": "Write formatted text to files or standard output/error using MATLAB-compatible semantics.", "code": "iter = 100;\nfprintf('stderr', 'Warning: iteration limit reached (%d steps)\\n', iter)", "keywords": ["fprintf", "format", "printf", "write file", "stdout", "stderr", "encoding"], "suggestedPath": "/fprintf-3.m" }, { "id": "fprintf:4", "builtinKey": "fprintf", "builtinTitle": "fprintf", "builtinSlug": "fprintf", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Format A Matrix In Column-Major Order", "summary": "Write formatted text to files or standard output/error using MATLAB-compatible semantics.", "code": "A = [1 2 3; 4 5 6];\nfprintf('%d %d\\n', A)", "keywords": ["fprintf", "format", "printf", "write file", "stdout", "stderr", "encoding"], "suggestedPath": "/fprintf-4.m" }, { "id": "fprintf:5", "builtinKey": "fprintf", "builtinTitle": "fprintf", "builtinSlug": "fprintf", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Respect File Encoding Constraints", "summary": "Write formatted text to files or standard output/error using MATLAB-compatible semantics.", "code": "[fid, msg] = fopen('ascii.txt', 'w', 'native', 'ascii');\nif fid == -1, error(msg); end\ntry\n fprintf(fid, 'café\\n');\ncatch err\n disp(err.message);\nend\nfclose(fid)", "keywords": ["fprintf", "format", "printf", "write file", "stdout", "stderr", "encoding"], "suggestedPath": "/fprintf-5.m" }, { "id": "fprintf:6", "builtinKey": "fprintf", "builtinTitle": "fprintf", "builtinSlug": "fprintf", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Format GPU-Resident Data Transparently", "summary": "Write formatted text to files or standard output/error using MATLAB-compatible semantics.", "code": "G = gpuArray([1.2 3.4 5.6]);\n[fid, msg] = fopen('gpu.txt', 'w');\nassert(fid ~= -1, msg);\nfprintf(fid, '%.1f,', G);\nfclose(fid)", "keywords": ["fprintf", "format", "printf", "write file", "stdout", "stderr", "encoding"], "suggestedPath": "/fprintf-6.m" }, { "id": "fread:1", "builtinKey": "fread", "builtinTitle": "fread", "builtinSlug": "fread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Reading double-precision values from a binary file", "summary": "Read binary data from a file identifier with MATLAB-compatible size, precision, skip, and machine-format semantics.", "code": "fid = fopen('numbers.bin', 'w+b');\nfwrite(fid, [1 2 3], 'double');\nfrewind(fid);\n\n[values, count] = fread(fid); % defaults to double precision\n% values is a 3x1 column vector [1; 2; 3], count == 3\n\nfclose(fid);\ndelete('numbers.bin')", "keywords": ["fread", "binary read", "io", "precision", "machine format", "skip"], "suggestedPath": "/fread-1.m" }, { "id": "fread:2", "builtinKey": "fread", "builtinTitle": "fread", "builtinSlug": "fread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Reading bytes with a specific element count", "summary": "Read binary data from a file identifier with MATLAB-compatible size, precision, skip, and machine-format semantics.", "code": "fid = fopen('payload.bin', 'w+b');\nfwrite(fid, uint8(1:6), 'uint8');\nfrewind(fid);\n\n[bytes, count] = fread(fid, 4, 'uint8');\n% bytes == [1; 2; 3; 4], count == 4\n\nfclose(fid);\ndelete('payload.bin')", "keywords": ["fread", "binary read", "io", "precision", "machine format", "skip"], "suggestedPath": "/fread-2.m" }, { "id": "fread:3", "builtinKey": "fread", "builtinTitle": "fread", "builtinSlug": "fread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Loading a two-dimensional block of `uint8` data", "summary": "Read binary data from a file identifier with MATLAB-compatible size, precision, skip, and machine-format semantics.", "code": "fid = fopen('frame.bin', 'w+b');\npayload = uint8(reshape(1:12, 3, 4));\nfwrite(fid, payload, 'uint8');\nfrewind(fid);\n\n[frame, count] = fread(fid, [3 4], 'uint8');\nframe = uint8(frame); % convert back to uint8 if needed\n\nfclose(fid);\ndelete('frame.bin')", "keywords": ["fread", "binary read", "io", "precision", "machine format", "skip"], "suggestedPath": "/fread-3.m" }, { "id": "fread:4", "builtinKey": "fread", "builtinTitle": "fread", "builtinSlug": "fread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Reading characters using the `*char` precision form", "summary": "Read binary data from a file identifier with MATLAB-compatible size, precision, skip, and machine-format semantics.", "code": "fid = fopen('message.txt', 'w+b');\nfwrite(fid, 'RunMat', 'char');\nfrewind(fid);\n\n[text, count] = fread(fid, '*char');\ntext = text.'; % row string 'RunMat'\n\nfclose(fid);\ndelete('message.txt')", "keywords": ["fread", "binary read", "io", "precision", "machine format", "skip"], "suggestedPath": "/fread-4.m" }, { "id": "fread:5", "builtinKey": "fread", "builtinTitle": "fread", "builtinSlug": "fread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Skipping bytes between samples", "summary": "Read binary data from a file identifier with MATLAB-compatible size, precision, skip, and machine-format semantics.", "code": "fid = fopen('interleaved.bin', 'w+b');\nfwrite(fid, uint8(1:12), 'uint8');\nfrewind(fid);\n\n[every_other, count] = fread(fid, 5, 'uint8', 1); % read one byte, skip one byte\n% every_other == [1; 3; 5; 7; 9]\n\nfclose(fid);\ndelete('interleaved.bin')", "keywords": ["fread", "binary read", "io", "precision", "machine format", "skip"], "suggestedPath": "/fread-5.m" }, { "id": "fread:6", "builtinKey": "fread", "builtinTitle": "fread", "builtinSlug": "fread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Respecting big-endian machine formats", "summary": "Read binary data from a file identifier with MATLAB-compatible size, precision, skip, and machine-format semantics.", "code": "fid = fopen('sensors.be', 'w+b', 'ieee-be');\nfwrite(fid, uint16([258 772]), 'uint16');\nfrewind(fid);\n\n[values, count] = fread(fid, [2 1], 'uint16');\n% values == [258; 772], count == 2\n\nfclose(fid);\ndelete('sensors.be')", "keywords": ["fread", "binary read", "io", "precision", "machine format", "skip"], "suggestedPath": "/fread-6.m" }, { "id": "fread:7", "builtinKey": "fread", "builtinTitle": "fread", "builtinSlug": "fread", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Matching GPU residency with `'like'`", "summary": "Read binary data from a file identifier with MATLAB-compatible size, precision, skip, and machine-format semantics.", "code": "fid = fopen('samples.bin', 'w+b');\nfwrite(fid, [2.5 4.5 6.5 8.5], 'double');\nfrewind(fid);\n\nprototype = gpuArray.zeros(4, 1);\n[values, count] = fread(fid, 4, 'double', 'like', prototype);\n% When a GPU provider is active, values stays on the GPU and count == 4.\n\nfclose(fid);\ndelete('samples.bin')", "keywords": ["fread", "binary read", "io", "precision", "machine format", "skip"], "suggestedPath": "/fread-7.m" }, { "id": "frewind:1", "builtinKey": "frewind", "builtinTitle": "frewind", "builtinSlug": "frewind", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write then rewind and read back binary data", "summary": "Rewind the file position indicator to the beginning of an open file.", "code": "fid = fopen('data.bin', 'w+b');\nfwrite(fid, [1 2 3], 'double');\nfrewind(fid);\nvalues = fread(fid, 'double');\nfclose(fid);\ndelete('data.bin')", "keywords": ["frewind", "file", "rewind", "seek", "io", "file identifier"], "suggestedPath": "/frewind-1.m" }, { "id": "frewind:2", "builtinKey": "frewind", "builtinTitle": "frewind", "builtinSlug": "frewind", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Read a text file twice without reopening", "summary": "Rewind the file position indicator to the beginning of an open file.", "code": "fid = fopen('notes.txt', 'r');\nfirst_line = fgets(fid);\nfrewind(fid);\nsame_line = fgets(fid);\nfclose(fid)", "keywords": ["frewind", "file", "rewind", "seek", "io", "file identifier"], "suggestedPath": "/frewind-2.m" }, { "id": "frewind:3", "builtinKey": "frewind", "builtinTitle": "frewind", "builtinSlug": "frewind", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Rewind a binary file opened for reading bytes", "summary": "Rewind the file position indicator to the beginning of an open file.", "code": "fid = fopen('payload.bin', 'w+b');\nfwrite(fid, uint8(1:6), 'uint8');\nfrewind(fid);\nbytes = fread(fid, 4, 'uint8');\nfclose(fid);\ndelete('payload.bin')", "keywords": ["frewind", "file", "rewind", "seek", "io", "file identifier"], "suggestedPath": "/frewind-3.m" }, { "id": "fspecial:1", "builtinKey": "fspecial", "builtinTitle": "fspecial", "builtinSlug": "fspecial", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Creating a box filter for local averaging", "summary": "Generate classical 2-D correlation kernels used in MATLAB image processing workflows.", "code": "H = fspecial(\"average\", 7); % 7x7 box filter with unit sum", "keywords": ["fspecial", "filter", "gaussian", "sobel", "motion", "laplacian", "disk"], "suggestedPath": "/fspecial-1.m" }, { "id": "fspecial:2", "builtinKey": "fspecial", "builtinTitle": "fspecial", "builtinSlug": "fspecial", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Building a Gaussian smoothing kernel", "summary": "Generate classical 2-D correlation kernels used in MATLAB image processing workflows.", "code": "H = fspecial(\"gaussian\", [5 5], 1.0)", "keywords": ["fspecial", "filter", "gaussian", "sobel", "motion", "laplacian", "disk"], "suggestedPath": "/fspecial-2.m" }, { "id": "fspecial:3", "builtinKey": "fspecial", "builtinTitle": "fspecial", "builtinSlug": "fspecial", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Generating a disk filter for circular blur", "summary": "Generate classical 2-D correlation kernels used in MATLAB image processing workflows.", "code": "H = fspecial(\"disk\", 4)", "keywords": ["fspecial", "filter", "gaussian", "sobel", "motion", "laplacian", "disk"], "suggestedPath": "/fspecial-3.m" }, { "id": "fspecial:4", "builtinKey": "fspecial", "builtinTitle": "fspecial", "builtinSlug": "fspecial", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Constructing a Laplacian-of-Gaussian edge detector", "summary": "Generate classical 2-D correlation kernels used in MATLAB image processing workflows.", "code": "H = fspecial(\"log\", [9 9], 1.4)", "keywords": ["fspecial", "filter", "gaussian", "sobel", "motion", "laplacian", "disk"], "suggestedPath": "/fspecial-4.m" }, { "id": "fspecial:5", "builtinKey": "fspecial", "builtinTitle": "fspecial", "builtinSlug": "fspecial", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Synthesising a motion blur kernel at 30 degrees", "summary": "Generate classical 2-D correlation kernels used in MATLAB image processing workflows.", "code": "H = fspecial(\"motion\", 15, 30)", "keywords": ["fspecial", "filter", "gaussian", "sobel", "motion", "laplacian", "disk"], "suggestedPath": "/fspecial-5.m" }, { "id": "fspecial:6", "builtinKey": "fspecial", "builtinTitle": "fspecial", "builtinSlug": "fspecial", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Tuning an unsharp mask for edge enhancement", "summary": "Generate classical 2-D correlation kernels used in MATLAB image processing workflows.", "code": "H = fspecial(\"unsharp\", 0.6)", "keywords": ["fspecial", "filter", "gaussian", "sobel", "motion", "laplacian", "disk"], "suggestedPath": "/fspecial-6.m" }, { "id": "fullfile:1", "builtinKey": "fullfile", "builtinTitle": "fullfile", "builtinSlug": "fullfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Join Relative Path Segments", "summary": "Build a platform-correct file path from multiple path segments.", "code": "p = fullfile(\"data\", \"raw\", \"sample.dat\")", "output": "p =\n data/raw/sample.dat", "keywords": ["fullfile", "join paths", "path assembly", "filesystem", "filesep"], "suggestedPath": "/fullfile-1.m" }, { "id": "fullfile:2", "builtinKey": "fullfile", "builtinTitle": "fullfile", "builtinSlug": "fullfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use `fullfile` With `pwd`", "summary": "Build a platform-correct file path from multiple path segments.", "code": "root = pwd;\nconfig = fullfile(root, \"config\", \"settings.json\")", "output": "% Returns a full path rooted at the current working folder", "keywords": ["fullfile", "join paths", "path assembly", "filesystem", "filesep"], "suggestedPath": "/fullfile-2.m" }, { "id": "fullfile:3", "builtinKey": "fullfile", "builtinTitle": "fullfile", "builtinSlug": "fullfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Build A Subfolder Path", "summary": "Build a platform-correct file path from multiple path segments.", "code": "logDir = fullfile(\"logs\", \"2026\");\nstatus = mkdir(logDir)", "output": "status =\n 1", "keywords": ["fullfile", "join paths", "path assembly", "filesystem", "filesep"], "suggestedPath": "/fullfile-3.m" }, { "id": "fullfile:4", "builtinKey": "fullfile", "builtinTitle": "fullfile", "builtinSlug": "fullfile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Create A File In A Nested Folder", "summary": "Build a platform-correct file path from multiple path segments.", "code": "mkdir(fullfile(\"data\", \"raw\"));\nfid = fopen(fullfile(\"data\", \"raw\", \"sample.dat\"), \"w\");\nfclose(fid)", "output": "% Creates data/raw/sample.dat", "keywords": ["fullfile", "join paths", "path assembly", "filesystem", "filesep"], "suggestedPath": "/fullfile-4.m" }, { "id": "fwrite:1", "builtinKey": "fwrite", "builtinTitle": "fwrite", "builtinSlug": "fwrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write unsigned bytes with the default precision", "summary": "Write binary data to a file identifier with MATLAB-compatible precision, skip, and machine-format semantics.", "code": "fid = fopen('bytes.bin', 'w+b');\ncount = fwrite(fid, [1 2 3 255]);\nfclose(fid);\ncount", "output": "count = 4", "keywords": ["fwrite", "binary write", "io", "precision", "machine format", "skip"], "suggestedPath": "/fwrite-1.m" }, { "id": "fwrite:2", "builtinKey": "fwrite", "builtinTitle": "fwrite", "builtinSlug": "fwrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write double-precision values", "summary": "Write binary data to a file identifier with MATLAB-compatible precision, skip, and machine-format semantics.", "code": "fid = fopen('values.bin', 'w+b');\ndata = [1.5 -2.25 42.0];\ncount = fwrite(fid, data, 'double');\nfclose(fid);\ncount", "output": "count = 3", "keywords": ["fwrite", "binary write", "io", "precision", "machine format", "skip"], "suggestedPath": "/fwrite-2.m" }, { "id": "fwrite:3", "builtinKey": "fwrite", "builtinTitle": "fwrite", "builtinSlug": "fwrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write 16-bit integers using big-endian byte ordering", "summary": "Write binary data to a file identifier with MATLAB-compatible precision, skip, and machine-format semantics.", "code": "fid = fopen('sensor.be', 'w+b', 'ieee-be');\ncount = fwrite(fid, [258 772], 'uint16');\nfclose(fid);\ncount", "output": "count = 2", "keywords": ["fwrite", "binary write", "io", "precision", "machine format", "skip"], "suggestedPath": "/fwrite-3.m" }, { "id": "fwrite:4", "builtinKey": "fwrite", "builtinTitle": "fwrite", "builtinSlug": "fwrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Insert padding bytes between samples", "summary": "Write binary data to a file identifier with MATLAB-compatible precision, skip, and machine-format semantics.", "code": "fid = fopen('spaced.bin', 'w+b');\ncount = fwrite(fid, [10 20 30], 'uint8', 1); % skip one byte between elements\nfclose(fid);\ncount", "output": "count = 3", "keywords": ["fwrite", "binary write", "io", "precision", "machine format", "skip"], "suggestedPath": "/fwrite-4.m" }, { "id": "fwrite:5", "builtinKey": "fwrite", "builtinTitle": "fwrite", "builtinSlug": "fwrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Write character data without manual conversions", "summary": "Write binary data to a file identifier with MATLAB-compatible precision, skip, and machine-format semantics.", "code": "fid = fopen('greeting.txt', 'w+b');\ncount = fwrite(fid, 'RunMat!', 'char');\nfclose(fid);\ncount", "output": "count = 7", "keywords": ["fwrite", "binary write", "io", "precision", "machine format", "skip"], "suggestedPath": "/fwrite-5.m" }, { "id": "fwrite:6", "builtinKey": "fwrite", "builtinTitle": "fwrite", "builtinSlug": "fwrite", "category": "io/filetext", "categoryPath": ["io", "filetext"], "exampleTitle": "Gather GPU data before writing", "summary": "Write binary data to a file identifier with MATLAB-compatible precision, skip, and machine-format semantics.", "code": "fid = fopen('gpu.bin', 'w+b');\nG = gpuArray([1 2 3 4]);\ncount = fwrite(fid, G, 'uint16');\nfclose(fid);\ncount", "output": "count = 4", "keywords": ["fwrite", "binary write", "io", "precision", "machine format", "skip"], "suggestedPath": "/fwrite-6.m" }, { "id": "gamma:1", "builtinKey": "gamma", "builtinTitle": "gamma", "builtinSlug": "gamma", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Converting integers to factorials automatically", "summary": "Element-wise gamma function for scalars, vectors, matrices, and complex inputs.", "code": "gamma(5)", "output": "ans = 24", "keywords": ["gamma", "factorial", "special function", "elementwise", "gpu", "complex"], "suggestedPath": "/gamma-1.m" }, { "id": "gamma:2", "builtinKey": "gamma", "builtinTitle": "gamma", "builtinSlug": "gamma", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Evaluating half-integer inputs", "summary": "Element-wise gamma function for scalars, vectors, matrices, and complex inputs.", "code": "gamma(0.5)", "output": "ans = 1.7725", "keywords": ["gamma", "factorial", "special function", "elementwise", "gpu", "complex"], "suggestedPath": "/gamma-2.m" }, { "id": "gamma:3", "builtinKey": "gamma", "builtinTitle": "gamma", "builtinSlug": "gamma", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Handling negative non-integers", "summary": "Element-wise gamma function for scalars, vectors, matrices, and complex inputs.", "code": "gamma(-0.5)", "output": "ans = -3.5449", "keywords": ["gamma", "factorial", "special function", "elementwise", "gpu", "complex"], "suggestedPath": "/gamma-3.m" }, { "id": "gamma:4", "builtinKey": "gamma", "builtinTitle": "gamma", "builtinSlug": "gamma", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Applying gamma element-wise to arrays", "summary": "Element-wise gamma function for scalars, vectors, matrices, and complex inputs.", "code": "A = [1 2; 3 4];\nB = gamma(A)", "output": "B =\n 1 1\n 2 6", "keywords": ["gamma", "factorial", "special function", "elementwise", "gpu", "complex"], "suggestedPath": "/gamma-4.m" }, { "id": "gamma:5", "builtinKey": "gamma", "builtinTitle": "gamma", "builtinSlug": "gamma", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Working with complex numbers", "summary": "Element-wise gamma function for scalars, vectors, matrices, and complex inputs.", "code": "z = 0.5 + 1i;\ng = gamma(z)", "output": "g = 0.8182 - 0.7633i", "keywords": ["gamma", "factorial", "special function", "elementwise", "gpu", "complex"], "suggestedPath": "/gamma-5.m" }, { "id": "gamma:6", "builtinKey": "gamma", "builtinTitle": "gamma", "builtinSlug": "gamma", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Using `gamma` with GPU tensors", "summary": "Element-wise gamma function for scalars, vectors, matrices, and complex inputs.", "code": "G = gpuArray([0.5 1.5 2.5]);\nout = gamma(G);\nresult = gather(out)", "output": "result = [1.7725 0.8862 1.3293]", "keywords": ["gamma", "factorial", "special function", "elementwise", "gpu", "complex"], "suggestedPath": "/gamma-6.m" }, { "id": "gather:1", "builtinKey": "gather", "builtinTitle": "gather", "builtinSlug": "gather", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Converting a gpuArray back to host memory", "summary": "Transfer gpuArray data back to host memory, recursively handling cells, structs, and objects.", "code": "G = gpuArray([1 2 3; 4 5 6]);\nH = gather(G)", "output": "H =\n 1 2 3\n 4 5 6", "keywords": ["gather", "gpuArray", "download", "host copy", "accelerate", "residency"], "suggestedPath": "/gather-1.m" }, { "id": "gather:2", "builtinKey": "gather", "builtinTitle": "gather", "builtinSlug": "gather", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Gathering data that is already on the CPU", "summary": "Transfer gpuArray data back to host memory, recursively handling cells, structs, and objects.", "code": "x = [10 20 30];\ny = gather(x)", "output": "y =\n 10 20 30", "keywords": ["gather", "gpuArray", "download", "host copy", "accelerate", "residency"], "suggestedPath": "/gather-2.m" }, { "id": "gather:3", "builtinKey": "gather", "builtinTitle": "gather", "builtinSlug": "gather", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Preserving logical values when gathering", "summary": "Transfer gpuArray data back to host memory, recursively handling cells, structs, and objects.", "code": "mask = gpuArray(logical([1 0 1 0]));\nhostMask = gather(mask)", "output": "hostMask =\n 1×4 logical array\n 1 0 1 0", "keywords": ["gather", "gpuArray", "download", "host copy", "accelerate", "residency"], "suggestedPath": "/gather-3.m" }, { "id": "gather:4", "builtinKey": "gather", "builtinTitle": "gather", "builtinSlug": "gather", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Gathering gpuArray values stored inside a cell array", "summary": "Transfer gpuArray data back to host memory, recursively handling cells, structs, and objects.", "code": "C = {gpuArray([1 2]), 42};\nhostC = gather(C)", "output": "hostC =\n 1×2 cell array\n {[1 2]} {[42]}", "keywords": ["gather", "gpuArray", "download", "host copy", "accelerate", "residency"], "suggestedPath": "/gather-4.m" }, { "id": "gather:5", "builtinKey": "gather", "builtinTitle": "gather", "builtinSlug": "gather", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Gathering struct fields that live on the GPU", "summary": "Transfer gpuArray data back to host memory, recursively handling cells, structs, and objects.", "code": "S.data = gpuArray(magic(3));\nS.label = \"gpu result\";\nS_host = gather(S)", "output": "S_host =\n struct with fields:\n data: [3×3 double]\n label: \"gpu result\"", "keywords": ["gather", "gpuArray", "download", "host copy", "accelerate", "residency"], "suggestedPath": "/gather-5.m" }, { "id": "gather:6", "builtinKey": "gather", "builtinTitle": "gather", "builtinSlug": "gather", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Gathering multiple gpuArrays into one cell result", "summary": "Transfer gpuArray data back to host memory, recursively handling cells, structs, and objects.", "code": "A = gpuArray(eye(3));\nB = gpuArray(ones(3));\ncellOut = gather(A, B)", "output": "cellOut =\n 1×2 cell array\n {[3×3 double]} {[3×3 double]}", "keywords": ["gather", "gpuArray", "download", "host copy", "accelerate", "residency"], "suggestedPath": "/gather-6.m" }, { "id": "gather:7", "builtinKey": "gather", "builtinTitle": "gather", "builtinSlug": "gather", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Gathering results at the end of a GPU pipeline", "summary": "Transfer gpuArray data back to host memory, recursively handling cells, structs, and objects.", "code": "A = gpuArray(rand(1024, 1));\nB = sin(A) .* 5;\nresult = gather(B)", "output": "result(1:3) =\n 4.1377\n 2.4884\n 0.1003", "keywords": ["gather", "gpuArray", "download", "host copy", "accelerate", "residency"], "suggestedPath": "/gather-7.m" }, { "id": "ge:1", "builtinKey": "ge", "builtinTitle": "ge", "builtinSlug": "ge", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Test Whether One Scalar Is Greater Than or Equal To Another", "summary": "Element-wise greater-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "flag = ge(42, 42)", "output": "flag =\n 1", "keywords": ["ge", ">=", "greater than or equal", "logical comparison", "gpuArray ge"], "suggestedPath": "/ge-1.m" }, { "id": "ge:2", "builtinKey": "ge", "builtinTitle": "ge", "builtinSlug": "ge", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Keep Matrix Elements Above or Equal To A Threshold", "summary": "Element-wise greater-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "M = [1 2 3; 4 5 6];\nmask = ge(M, 3)", "output": "mask =\n 2×3 logical array\n 0 0 1\n 1 1 1", "keywords": ["ge", ">=", "greater than or equal", "logical comparison", "gpuArray ge"], "suggestedPath": "/ge-2.m" }, { "id": "ge:3", "builtinKey": "ge", "builtinTitle": "ge", "builtinSlug": "ge", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Apply Greater-Equal With Implicit Expansion", "summary": "Element-wise greater-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "v = [1 3 5 7];\nmask = ge(v, [2 6])", "output": "mask =\n 1×4 logical array\n 0 0 1 1", "keywords": ["ge", ">=", "greater than or equal", "logical comparison", "gpuArray ge"], "suggestedPath": "/ge-3.m" }, { "id": "ge:4", "builtinKey": "ge", "builtinTitle": "ge", "builtinSlug": "ge", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare Character Data To Numeric Codes", "summary": "Element-wise greater-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "letters = ['A' 'B' 'C'];\nisAfterOrB = ge(letters, 66)", "output": "isAfterOrB =\n 1×3 logical array\n 0 1 1", "keywords": ["ge", ">=", "greater than or equal", "logical comparison", "gpuArray ge"], "suggestedPath": "/ge-4.m" }, { "id": "ge:5", "builtinKey": "ge", "builtinTitle": "ge", "builtinSlug": "ge", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare String Arrays Lexicographically With Equality Support", "summary": "Element-wise greater-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "names = [\"alice\" \"charlie\" \"bob\"];\nlaterOrSame = ge(names, \"bob\")", "output": "laterOrSame =\n 1×3 logical array\n 0 1 1", "keywords": ["ge", ">=", "greater than or equal", "logical comparison", "gpuArray ge"], "suggestedPath": "/ge-5.m" }, { "id": "ge:6", "builtinKey": "ge", "builtinTitle": "ge", "builtinSlug": "ge", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Run `ge` Directly On `gpuArray` Inputs", "summary": "Element-wise greater-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "G1 = gpuArray([1 4 6]);\nG2 = gpuArray([1 5 6]);\ndeviceResult = ge(G1, G2);\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1×3 gpuArray logical array\n 1 0 1\nhostResult =\n 1×3 logical array\n 1 0 1", "keywords": ["ge", ">=", "greater than or equal", "logical comparison", "gpuArray ge"], "suggestedPath": "/ge-6.m" }, { "id": "genpath:1", "builtinKey": "genpath", "builtinTitle": "genpath", "builtinSlug": "genpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Generate a recursive path for the current working folder", "summary": "Generate a MATLAB-style search path string for a folder tree.", "code": "p = genpath();\naddpath(p); % Add the current folder and all subfolders to the MATLAB path", "keywords": ["genpath", "recursive path", "search path", "addpath"], "suggestedPath": "/genpath-1.m" }, { "id": "genpath:2", "builtinKey": "genpath", "builtinTitle": "genpath", "builtinSlug": "genpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Build a search path for a project toolbox", "summary": "Generate a MATLAB-style search path string for a folder tree.", "code": "toolboxRoot = \"toolbox/signal\";\ntoolboxPath = genpath(toolboxRoot);\naddpath(toolboxPath, \"-end\")", "keywords": ["genpath", "recursive path", "search path", "addpath"], "suggestedPath": "/genpath-2.m" }, { "id": "genpath:3", "builtinKey": "genpath", "builtinTitle": "genpath", "builtinSlug": "genpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Exclude build output directories from the generated path", "summary": "Generate a MATLAB-style search path string for a folder tree.", "code": "root = \"projects/solver\";\nexcludes = strjoin([\n fullfile(root, \"build\"),\n fullfile(root, \"dist\")\n], pathsep);\np = genpath(root, excludes)", "keywords": ["genpath", "recursive path", "search path", "addpath"], "suggestedPath": "/genpath-3.m" }, { "id": "genpath:4", "builtinKey": "genpath", "builtinTitle": "genpath", "builtinSlug": "genpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Skip a private utilities folder while including the rest of the tree", "summary": "Generate a MATLAB-style search path string for a folder tree.", "code": "root = \"analysis\";\np = genpath(root, fullfile(root, \"private\"))", "keywords": ["genpath", "recursive path", "search path", "addpath"], "suggestedPath": "/genpath-4.m" }, { "id": "genpath:5", "builtinKey": "genpath", "builtinTitle": "genpath", "builtinSlug": "genpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Automatically skip MATLAB-reserved folders", "summary": "Generate a MATLAB-style search path string for a folder tree.", "code": "root = \"toolbox\";\nmkdir(root, \"private\");\nmkdir(root, \"+package\");\np = genpath(root)", "output": "% `p` only includes `toolbox` and subfolders that are not named `private` or\n% `resources`, and that do not begin with `@` or `+`.", "keywords": ["genpath", "recursive path", "search path", "addpath"], "suggestedPath": "/genpath-5.m" }, { "id": "genpath:6", "builtinKey": "genpath", "builtinTitle": "genpath", "builtinSlug": "genpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Combine `genpath` with `savepath` for persistent tooling setup", "summary": "Generate a MATLAB-style search path string for a folder tree.", "code": "p = genpath(\"third_party/toolchain\");\naddpath(p);\nsavepath()", "keywords": ["genpath", "recursive path", "search path", "addpath"], "suggestedPath": "/genpath-6.m" }, { "id": "get:1", "builtinKey": "get", "builtinTitle": "get", "builtinSlug": "get", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect the full property struct for a line handle", "summary": "Inspect figure, axes, and plot-object properties through RunMat’s graphics handles and MATLAB-style `get` workflows.", "code": "h = plot(1:5, [1 4 2 5 3]);\nprops = get(h);", "keywords": ["get", "graphics handle", "plot properties", "matlab get", "inspect plotting state"], "suggestedPath": "/get-1.m" }, { "id": "get:2", "builtinKey": "get", "builtinTitle": "get", "builtinSlug": "get", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Read an axes-local property", "summary": "Inspect figure, axes, and plot-object properties through RunMat’s graphics handles and MATLAB-style `get` workflows.", "code": "ax = subplot(1, 2, 2);\nsemilogx(logspace(0, 2, 50), logspace(0, 2, 50));\nget(ax, 'XScale')", "output": "ans =\n 'log'", "keywords": ["get", "graphics handle", "plot properties", "matlab get", "inspect plotting state"], "suggestedPath": "/get-2.m" }, { "id": "get:3", "builtinKey": "get", "builtinTitle": "get", "builtinSlug": "get", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect a legend handle after creation", "summary": "Inspect figure, axes, and plot-object properties through RunMat’s graphics handles and MATLAB-style `get` workflows.", "code": "plot(1:5, 1:5);\nlg = legend('series');\nget(lg, 'Orientation')", "keywords": ["get", "graphics handle", "plot properties", "matlab get", "inspect plotting state"], "suggestedPath": "/get-3.m" }, { "id": "getenv:1", "builtinKey": "getenv", "builtinTitle": "getenv", "builtinSlug": "getenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Read A Single Environment Variable", "summary": "Query environment variables as character vectors, strings, or structures.", "code": "homeFolder = getenv(\"HOME\");\ndisp(homeFolder)", "output": "homeFolder =\n \"/\"", "keywords": ["getenv", "environment variable", "env", "system variable", "process environment"], "suggestedPath": "/getenv-1.m" }, { "id": "getenv:2", "builtinKey": "getenv", "builtinTitle": "getenv", "builtinSlug": "getenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handle Missing Environment Variables", "summary": "Query environment variables as character vectors, strings, or structures.", "code": "token = getenv(\"RUNMAT_TOKEN\");\nif token == \"\"\n warning(\"Token not configured.\");\nend", "output": "Warning: Token not configured.", "keywords": ["getenv", "environment variable", "env", "system variable", "process environment"], "suggestedPath": "/getenv-2.m" }, { "id": "getenv:3", "builtinKey": "getenv", "builtinTitle": "getenv", "builtinSlug": "getenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Fetch Multiple Variables With A String Array", "summary": "Query environment variables as character vectors, strings, or structures.", "code": "vars = getenv([\"PATH\", \"SHELL\"]);\ndisp(vars)", "output": "vars = 1x2 string\n \"/usr/local/bin:/usr/bin:/bin\" \"/bin/sh\"", "keywords": ["getenv", "environment variable", "env", "system variable", "process environment"], "suggestedPath": "/getenv-3.m" }, { "id": "getenv:4", "builtinKey": "getenv", "builtinTitle": "getenv", "builtinSlug": "getenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use A Cell Array Of Character Vectors", "summary": "Query environment variables as character vectors, strings, or structures.", "code": "cells = getenv({'HOME', 'PATH'});\ndisp(cells{1})", "output": "/", "keywords": ["getenv", "environment variable", "env", "system variable", "process environment"], "suggestedPath": "/getenv-4.m" }, { "id": "getenv:5", "builtinKey": "getenv", "builtinTitle": "getenv", "builtinSlug": "getenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Inspect All Environment Variables", "summary": "Query environment variables as character vectors, strings, or structures.", "code": "env = getenv();\ndisp(env.USER)", "output": "env =\n struct with fields:\n HOME: '/'\n PATH: '/usr/local/bin:/usr/bin:/bin'\n USER: 'user'", "keywords": ["getenv", "environment variable", "env", "system variable", "process environment"], "suggestedPath": "/getenv-5.m" }, { "id": "getenv:6", "builtinKey": "getenv", "builtinTitle": "getenv", "builtinSlug": "getenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Cache The Environment For Repeated Access", "summary": "Query environment variables as character vectors, strings, or structures.", "code": "env = getenv();\nresultsFolder = fullfile(env.HOME, \"results\")", "output": "resultsFolder =\n \"//results\"", "keywords": ["getenv", "environment variable", "env", "system variable", "process environment"], "suggestedPath": "/getenv-6.m" }, { "id": "getfield:1", "builtinKey": "getfield", "builtinTitle": "getfield", "builtinSlug": "getfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Reading a scalar struct field", "summary": "Access a field or property from structs, struct arrays, or MATLAB-style objects.", "code": "stats = struct(\"mean\", 42, \"stdev\", 3.5);\nmu = getfield(stats, \"mean\")", "output": "mu = 42", "keywords": ["getfield", "struct", "struct array", "object property", "metadata"], "suggestedPath": "/getfield-1.m" }, { "id": "getfield:2", "builtinKey": "getfield", "builtinTitle": "getfield", "builtinSlug": "getfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Navigating nested structs with multiple field names", "summary": "Access a field or property from structs, struct arrays, or MATLAB-style objects.", "code": "cfg = struct(\"solver\", struct(\"name\", \"cg\", \"tolerance\", 1e-6));\ntol = getfield(cfg, \"solver\", \"tolerance\")", "output": "tol = 1.0000e-06", "keywords": ["getfield", "struct", "struct array", "object property", "metadata"], "suggestedPath": "/getfield-2.m" }, { "id": "getfield:3", "builtinKey": "getfield", "builtinTitle": "getfield", "builtinSlug": "getfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Accessing an element of a struct array", "summary": "Access a field or property from structs, struct arrays, or MATLAB-style objects.", "code": "people = struct(\"name\", {\"Ada\", \"Grace\"}, \"id\", {101, 102});\nlastId = getfield(people, {2}, \"id\")", "output": "lastId = 102", "keywords": ["getfield", "struct", "struct array", "object property", "metadata"], "suggestedPath": "/getfield-3.m" }, { "id": "getfield:4", "builtinKey": "getfield", "builtinTitle": "getfield", "builtinSlug": "getfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Reading the first element of a struct array automatically", "summary": "Access a field or property from structs, struct arrays, or MATLAB-style objects.", "code": "people = struct(\"name\", {\"Ada\", \"Grace\"}, \"id\", {101, 102});\nfirstName = getfield(people, \"name\")", "output": "firstName = \"Ada\"", "keywords": ["getfield", "struct", "struct array", "object property", "metadata"], "suggestedPath": "/getfield-4.m" }, { "id": "getfield:5", "builtinKey": "getfield", "builtinTitle": "getfield", "builtinSlug": "getfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Using `end` to reference the last item in a field", "summary": "Access a field or property from structs, struct arrays, or MATLAB-style objects.", "code": "series = struct(\"values\", {1:5});\nlastValue = getfield(series, \"values\", {\"end\"})", "output": "lastValue = 5", "keywords": ["getfield", "struct", "struct array", "object property", "metadata"], "suggestedPath": "/getfield-5.m" }, { "id": "getfield:6", "builtinKey": "getfield", "builtinTitle": "getfield", "builtinSlug": "getfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Indexing into a numeric field value", "summary": "Access a field or property from structs, struct arrays, or MATLAB-style objects.", "code": "measurements = struct(\"values\", {[1 2 3; 4 5 6]});\nentry = getfield(measurements, \"values\", {2, 3})", "output": "entry = 6", "keywords": ["getfield", "struct", "struct array", "object property", "metadata"], "suggestedPath": "/getfield-6.m" }, { "id": "getfield:7", "builtinKey": "getfield", "builtinTitle": "getfield", "builtinSlug": "getfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Gathering the exception message from a try/catch block", "summary": "Access a field or property from structs, struct arrays, or MATLAB-style objects.", "code": "try\n error(\"RunMat:domainError\", \"Bad input\");\ncatch e\n msg = getfield(e, \"message\");\nend", "output": "msg = 'Bad input'", "keywords": ["getfield", "struct", "struct array", "object property", "metadata"], "suggestedPath": "/getfield-7.m" }, { "id": "gpuarray:1", "builtinKey": "gpuarray", "builtinTitle": "gpuArray", "builtinSlug": "gpuarray", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Moving a matrix to the GPU for elementwise work", "summary": "Move MATLAB values onto the active GPU with optional size, dtype, and prototype controls.", "code": "A = [1 2 3; 4 5 6];\nG = gpuArray(A);\nout = gather(sin(G))", "output": "out =\n 2×3\n\n 0.8415 0.9093 0.1411\n -0.7568 -0.9589 -0.2794", "keywords": ["gpuArray", "gpu", "device", "upload", "accelerate", "dtype", "like", "size"], "suggestedPath": "/gpuarray-1.m" }, { "id": "gpuarray:2", "builtinKey": "gpuarray", "builtinTitle": "gpuArray", "builtinSlug": "gpuarray", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Uploading a scalar with dtype conversion", "summary": "Move MATLAB values onto the active GPU with optional size, dtype, and prototype controls.", "code": "pi_single = gpuArray(pi, 'single');\nisa(pi_single, 'gpuArray');\nclass(gather(pi_single))", "output": "ans =\n logical\n 1\n\nans =\n single", "keywords": ["gpuArray", "gpu", "device", "upload", "accelerate", "dtype", "like", "size"], "suggestedPath": "/gpuarray-2.m" }, { "id": "gpuarray:3", "builtinKey": "gpuarray", "builtinTitle": "gpuArray", "builtinSlug": "gpuarray", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Converting host data to a logical gpuArray", "summary": "Move MATLAB values onto the active GPU with optional size, dtype, and prototype controls.", "code": "mask = gpuArray([0 2 -5 0], 'logical');\ngather(mask)", "output": "ans =\n 1×4 logical array\n\n 0 1 1 0", "keywords": ["gpuArray", "gpu", "device", "upload", "accelerate", "dtype", "like", "size"], "suggestedPath": "/gpuarray-3.m" }, { "id": "gpuarray:4", "builtinKey": "gpuarray", "builtinTitle": "gpuArray", "builtinSlug": "gpuarray", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Matching an existing prototype with `'like'`", "summary": "Move MATLAB values onto the active GPU with optional size, dtype, and prototype controls.", "code": "template = gpuArray(true(2, 2));\nvalues = gpuArray([10 20 30 40], [2 2], 'like', template);\nisequal(gather(values), logical([10 20; 30 40]))", "output": "ans =\n logical\n 1", "keywords": ["gpuArray", "gpu", "device", "upload", "accelerate", "dtype", "like", "size"], "suggestedPath": "/gpuarray-4.m" }, { "id": "gpuarray:5", "builtinKey": "gpuarray", "builtinTitle": "gpuArray", "builtinSlug": "gpuarray", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Reshaping during upload", "summary": "Move MATLAB values onto the active GPU with optional size, dtype, and prototype controls.", "code": "flat = 1:6;\nG = gpuArray(flat, 2, 3);\nsize(G)", "output": "ans =\n 2 3", "keywords": ["gpuArray", "gpu", "device", "upload", "accelerate", "dtype", "like", "size"], "suggestedPath": "/gpuarray-5.m" }, { "id": "gpuarray:6", "builtinKey": "gpuarray", "builtinTitle": "gpuArray", "builtinSlug": "gpuarray", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Calling `gpuArray` on an existing gpuArray handle", "summary": "Move MATLAB values onto the active GPU with optional size, dtype, and prototype controls.", "code": "G = gpuArray([1 2 3]);\nH = gpuArray(G, 'double');\nisequal(G, H)", "output": "ans =\n logical\n 1", "keywords": ["gpuArray", "gpu", "device", "upload", "accelerate", "dtype", "like", "size"], "suggestedPath": "/gpuarray-6.m" }, { "id": "gpudevice:1", "builtinKey": "gpudevice", "builtinTitle": "gpuDevice", "builtinSlug": "gpudevice", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Inspecting the active GPU provider", "summary": "Query metadata about the active GPU provider and return it as a MATLAB struct.", "code": "info = gpuDevice();\ndisp(info.name)", "output": "InProcess", "keywords": ["gpuDevice", "gpu", "device info", "accelerate", "provider"], "suggestedPath": "/gpudevice-1.m" }, { "id": "gpudevice:2", "builtinKey": "gpudevice", "builtinTitle": "gpuDevice", "builtinSlug": "gpudevice", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Displaying vendor and backend metadata", "summary": "Query metadata about the active GPU provider and return it as a MATLAB struct.", "code": "info = gpuDevice();\nfprintf(\"Vendor: %s (backend: %s)\\n\", info.vendor, info.backend)", "output": "Vendor: RunMat (backend: inprocess)", "keywords": ["gpuDevice", "gpu", "device info", "accelerate", "provider"], "suggestedPath": "/gpudevice-2.m" }, { "id": "gpudevice:3", "builtinKey": "gpudevice", "builtinTitle": "gpuDevice", "builtinSlug": "gpudevice", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Checking whether double precision is supported", "summary": "Query metadata about the active GPU provider and return it as a MATLAB struct.", "code": "info = gpuDevice();\nif info.supports_double\n disp(\"Double precision kernels are available.\");\nelse\n disp(\"Provider only exposes single precision.\");\nend", "keywords": ["gpuDevice", "gpu", "device info", "accelerate", "provider"], "suggestedPath": "/gpudevice-3.m" }, { "id": "gpudevice:4", "builtinKey": "gpudevice", "builtinTitle": "gpuDevice", "builtinSlug": "gpudevice", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Formatting a user-facing status message", "summary": "Query metadata about the active GPU provider and return it as a MATLAB struct.", "code": "summary = gpuInfo();\ndisp(\"Active GPU summary:\");\ndisp(summary)", "output": "Active GPU summary:\nGPU[device_id=0, index=1, name='InProcess', vendor='RunMat', backend='inprocess', precision='double', supports_double=true]", "keywords": ["gpuDevice", "gpu", "device info", "accelerate", "provider"], "suggestedPath": "/gpudevice-4.m" }, { "id": "gpudevice:5", "builtinKey": "gpudevice", "builtinTitle": "gpuDevice", "builtinSlug": "gpudevice", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Handling missing providers gracefully", "summary": "Query metadata about the active GPU provider and return it as a MATLAB struct.", "code": "try\n info = gpuDevice();\ncatch ex\n warning(\"GPU unavailable: %s\", ex.message);\nend", "keywords": ["gpuDevice", "gpu", "device info", "accelerate", "provider"], "suggestedPath": "/gpudevice-5.m" }, { "id": "gpuinfo:1", "builtinKey": "gpuinfo", "builtinTitle": "gpuInfo", "builtinSlug": "gpuinfo", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Displaying GPU status in the REPL", "summary": "Return a formatted status string that describes the active GPU provider.", "code": "disp(gpuInfo())", "output": "GPU[device_id=0, index=1, name='InProcess', vendor='RunMat', backend='inprocess', precision='double', supports_double=true]", "keywords": ["gpuInfo", "gpu", "device info", "accelerate", "summary"], "suggestedPath": "/gpuinfo-1.m" }, { "id": "gpuinfo:2", "builtinKey": "gpuinfo", "builtinTitle": "gpuInfo", "builtinSlug": "gpuinfo", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Emitting a log line before a computation", "summary": "Return a formatted status string that describes the active GPU provider.", "code": "fprintf(\"Running on %s\\n\", gpuInfo())", "output": "Running on GPU[device_id=0, index=1, name='InProcess', vendor='RunMat', backend='inprocess', precision='double', supports_double=true]", "keywords": ["gpuInfo", "gpu", "device info", "accelerate", "summary"], "suggestedPath": "/gpuinfo-2.m" }, { "id": "gpuinfo:3", "builtinKey": "gpuinfo", "builtinTitle": "gpuInfo", "builtinSlug": "gpuinfo", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Checking for double precision support quickly", "summary": "Return a formatted status string that describes the active GPU provider.", "code": "summary = gpuInfo();\nif contains(summary, \"supports_double=true\")\n disp(\"Double precision kernels available.\");\nelse\n disp(\"Falling back to single precision.\");\nend", "keywords": ["gpuInfo", "gpu", "device info", "accelerate", "summary"], "suggestedPath": "/gpuinfo-3.m" }, { "id": "gpuinfo:4", "builtinKey": "gpuinfo", "builtinTitle": "gpuInfo", "builtinSlug": "gpuinfo", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Handling missing providers gracefully", "summary": "Return a formatted status string that describes the active GPU provider.", "code": "% Safe even when acceleration is disabled\nstatus = gpuInfo();\nif status == \"GPU[no provider]\"\n warning(\"GPU acceleration is currently disabled.\");\nend", "keywords": ["gpuInfo", "gpu", "device info", "accelerate", "summary"], "suggestedPath": "/gpuinfo-4.m" }, { "id": "gpuinfo:5", "builtinKey": "gpuinfo", "builtinTitle": "gpuInfo", "builtinSlug": "gpuinfo", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Combining `gpuInfo` with `gpuDevice` for structured data", "summary": "Return a formatted status string that describes the active GPU provider.", "code": "info = gpuDevice();\nsummary = gpuInfo();\nif isfield(info, 'memory_bytes')\n fprintf(\"%s (memory: %.2f GB)\\n\", summary, info.memory_bytes / 1e9);\nelse\n fprintf(\"%s (memory: unknown)\\n\", summary);\nend", "output": "GPU[device_id=0, index=1, name='InProcess', vendor='RunMat', backend='inprocess', precision='double', supports_double=true] (memory: 15.99 GB)", "keywords": ["gpuInfo", "gpu", "device info", "accelerate", "summary"], "suggestedPath": "/gpuinfo-5.m" }, { "id": "grid:1", "builtinKey": "grid", "builtinTitle": "grid", "builtinSlug": "grid", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Enable grid lines on a simple line chart", "summary": "Toggle grid lines for charts, subplots, and MATLAB `grid on` / `grid off` workflows.", "code": "plot(1:5, [1 4 2 5 3]);\ngrid on;", "keywords": ["grid", "grid on", "grid off", "chart grid lines", "matlab grid"], "suggestedPath": "/grid-1.m" }, { "id": "grid:2", "builtinKey": "grid", "builtinTitle": "grid", "builtinSlug": "grid", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Toggle grid lines in one subplot only", "summary": "Toggle grid lines for charts, subplots, and MATLAB `grid on` / `grid off` workflows.", "code": "subplot(1, 2, 1);\nplot(1:5, 1:5);\ngrid off;\nsubplot(1, 2, 2);\nplot(1:5, [5 4 3 2 1]);\ngrid on;", "keywords": ["grid", "grid on", "grid off", "chart grid lines", "matlab grid"], "suggestedPath": "/grid-2.m" }, { "id": "gt:1", "builtinKey": "gt", "builtinTitle": "gt", "builtinSlug": "gt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Determine Whether One Scalar Exceeds Another", "summary": "Element-wise greater-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "flag = gt(42, 17)", "output": "flag =\n 1", "keywords": ["gt", ">", "greater than", "logical comparison", "gpuArray greater-than"], "suggestedPath": "/gt-1.m" }, { "id": "gt:2", "builtinKey": "gt", "builtinTitle": "gt", "builtinSlug": "gt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Filter Matrix Elements Greater Than a Threshold", "summary": "Element-wise greater-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "M = [1 2 3; 4 5 6];\nmask = gt(M, 3)", "output": "mask =\n 2×3 logical array\n 0 0 0\n 1 1 1", "keywords": ["gt", ">", "greater than", "logical comparison", "gpuArray greater-than"], "suggestedPath": "/gt-2.m" }, { "id": "gt:3", "builtinKey": "gt", "builtinTitle": "gt", "builtinSlug": "gt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Apply Greater-Than With Implicit Expansion", "summary": "Element-wise greater-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "v = [1 3 5 7];\nmask = gt(v, [2 6])", "output": "mask =\n 1×4 logical array\n 0 0 1 1", "keywords": ["gt", ">", "greater than", "logical comparison", "gpuArray greater-than"], "suggestedPath": "/gt-3.m" }, { "id": "gt:4", "builtinKey": "gt", "builtinTitle": "gt", "builtinSlug": "gt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare Character Data to Numeric Codes", "summary": "Element-wise greater-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "letters = ['A' 'B' 'C'];\nisAfterB = gt(letters, 66)", "output": "isAfterB =\n 1×3 logical array\n 0 0 1", "keywords": ["gt", ">", "greater than", "logical comparison", "gpuArray greater-than"], "suggestedPath": "/gt-4.m" }, { "id": "gt:5", "builtinKey": "gt", "builtinTitle": "gt", "builtinSlug": "gt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare String Arrays Lexicographically", "summary": "Element-wise greater-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "names = [\"alice\" \"charlie\" \"bob\"];\nlater = gt(names, \"bob\")", "output": "later =\n 1×3 logical array\n 0 1 0", "keywords": ["gt", ">", "greater than", "logical comparison", "gpuArray greater-than"], "suggestedPath": "/gt-5.m" }, { "id": "gt:6", "builtinKey": "gt", "builtinTitle": "gt", "builtinSlug": "gt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Run `gt` Directly On `gpuArray` Inputs", "summary": "Element-wise greater-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "G1 = gpuArray([1 4 7]);\nG2 = gpuArray([0 5 6]);\ndeviceResult = gt(G1, G2);\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1×3 gpuArray logical array\n 1 0 1\nhostResult =\n 1×3 logical array\n 1 0 1", "keywords": ["gt", ">", "greater than", "logical comparison", "gpuArray greater-than"], "suggestedPath": "/gt-6.m" }, { "id": "hist:1", "builtinKey": "hist", "builtinTitle": "hist", "builtinSlug": "hist", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a default legacy histogram", "summary": "Create legacy center-based histograms for quick distribution plots and MATLAB `hist` workflows.", "code": "data = randn(1, 1000);\nhist(data);", "keywords": ["hist", "legacy histogram", "bin centers", "distribution plot", "matlab hist", "hist vs histogram"], "suggestedPath": "/hist-1.m" }, { "id": "hist:2", "builtinKey": "hist", "builtinTitle": "hist", "builtinSlug": "hist", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Pass explicit bin centers", "summary": "Create legacy center-based histograms for quick distribution plots and MATLAB `hist` workflows.", "code": "data = randn(1, 500);\ncenters = -3:0.5:3;\nhist(data, centers);", "output": "% Here the second argument is interpreted as bin centers, not edges", "keywords": ["hist", "legacy histogram", "bin centers", "distribution plot", "matlab hist", "hist vs histogram"], "suggestedPath": "/hist-2.m" }, { "id": "hist:3", "builtinKey": "hist", "builtinTitle": "hist", "builtinSlug": "hist", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Compare legacy hist semantics with modern histogram intent", "summary": "Create legacy center-based histograms for quick distribution plots and MATLAB `hist` workflows.", "code": "data = randn(1, 300);\nhist(data, -2:0.5:2);", "output": "% Use histogram(...) instead when you want bin-edge semantics and an object handle", "keywords": ["hist", "legacy histogram", "bin centers", "distribution plot", "matlab hist", "hist vs histogram"], "suggestedPath": "/hist-3.m" }, { "id": "histcounts:1", "builtinKey": "histcounts", "builtinTitle": "histcounts", "builtinSlug": "histcounts", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Counting values with custom bin counts", "summary": "Count observations in numeric arrays using configurable histogram bins.", "code": "data = [1 2 2 4 5 7];\n[counts, edges] = histcounts(data, 3)", "output": "counts = [3 1 2];\nedges = [1 3 5 7]", "keywords": ["histcounts", "histogram", "binning", "normalization", "probability", "cdf", "gpu"], "suggestedPath": "/histcounts-1.m" }, { "id": "histcounts:2", "builtinKey": "histcounts", "builtinTitle": "histcounts", "builtinSlug": "histcounts", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Using explicit bin edges", "summary": "Count observations in numeric arrays using configurable histogram bins.", "code": "edges = [0 1 2 3];\ncounts = histcounts([0.1 0.5 0.9 1.2 1.8 2.1], edges)", "output": "counts = [3 2 1]", "keywords": ["histcounts", "histogram", "binning", "normalization", "probability", "cdf", "gpu"], "suggestedPath": "/histcounts-2.m" }, { "id": "histcounts:3", "builtinKey": "histcounts", "builtinTitle": "histcounts", "builtinSlug": "histcounts", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Setting bin width and limits", "summary": "Count observations in numeric arrays using configurable histogram bins.", "code": "[counts, edges] = histcounts([5 7 8 10 12], 'BinWidth', 2, 'BinLimits', [4 12])", "output": "counts = [1 1 1 2];\nedges = [4 6 8 10 12]", "keywords": ["histcounts", "histogram", "binning", "normalization", "probability", "cdf", "gpu"], "suggestedPath": "/histcounts-3.m" }, { "id": "histcounts:4", "builtinKey": "histcounts", "builtinTitle": "histcounts", "builtinSlug": "histcounts", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Choosing an automatic binning method", "summary": "Count observations in numeric arrays using configurable histogram bins.", "code": "[counts, edges] = histcounts(randn(1, 500), 'BinMethod', 'sturges')", "output": "numel(counts) = ceil(log2(500) + 1); % 10 bins", "keywords": ["histcounts", "histogram", "binning", "normalization", "probability", "cdf", "gpu"], "suggestedPath": "/histcounts-4.m" }, { "id": "histcounts:5", "builtinKey": "histcounts", "builtinTitle": "histcounts", "builtinSlug": "histcounts", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Normalising counts to probabilities", "summary": "Count observations in numeric arrays using configurable histogram bins.", "code": "counts = histcounts([0.2 0.4 1.1 1.4 1.8 2.5], [0 1 2 3], 'Normalization', 'probability')", "output": "counts = [0.3333 0.5000 0.1667]", "keywords": ["histcounts", "histogram", "binning", "normalization", "probability", "cdf", "gpu"], "suggestedPath": "/histcounts-5.m" }, { "id": "histcounts:6", "builtinKey": "histcounts", "builtinTitle": "histcounts", "builtinSlug": "histcounts", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Building a cumulative distribution", "summary": "Count observations in numeric arrays using configurable histogram bins.", "code": "counts = histcounts([1 2 2 3], [0 1 2 3], 'Normalization', 'cdf')", "output": "counts = [0 0.25 1]", "keywords": ["histcounts", "histogram", "binning", "normalization", "probability", "cdf", "gpu"], "suggestedPath": "/histcounts-6.m" }, { "id": "histcounts:7", "builtinKey": "histcounts", "builtinTitle": "histcounts", "builtinSlug": "histcounts", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Counting values stored on a GPU array", "summary": "Count observations in numeric arrays using configurable histogram bins.", "code": "G = gpuArray([0.5 1.5 2.5]);\n[counts, edges] = histcounts(G, [0 1 2 3]); % counts/edges return as CPU arrays", "output": "counts = [1 1 1];\nedges = [0 1 2 3]", "keywords": ["histcounts", "histogram", "binning", "normalization", "probability", "cdf", "gpu"], "suggestedPath": "/histcounts-7.m" }, { "id": "histcounts2:1", "builtinKey": "histcounts2", "builtinTitle": "histcounts2", "builtinSlug": "histcounts2", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Counting paired values with explicit edges", "summary": "Count paired observations into two-dimensional histogram bins.", "code": "X = [0.5 1.5 2.5 3.5];\nY = [0.2 0.9 1.4 2.8];\n[N, Xedges, Yedges] = histcounts2(X, Y, [0 1 2 3 4], [0 1 2 3])", "output": "N = [1 0 0; 1 0 0; 0 1 0; 0 0 1];\nXedges = [0 1 2 3 4];\nYedges = [0 1 2 3]", "keywords": ["histcounts2", "2d histogram", "joint distribution", "binning", "probability", "gpu"], "suggestedPath": "/histcounts2-1.m" }, { "id": "histcounts2:2", "builtinKey": "histcounts2", "builtinTitle": "histcounts2", "builtinSlug": "histcounts2", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Specifying separate bin counts for each axis", "summary": "Count paired observations into two-dimensional histogram bins.", "code": "X = [1 2 3 4];\nY = [1 2 3 4];\nN = histcounts2(X, Y, 2, 4)", "output": "size(N) = [2 4];\nsum(N, \"all\") = 4", "keywords": ["histcounts2", "2d histogram", "joint distribution", "binning", "probability", "gpu"], "suggestedPath": "/histcounts2-2.m" }, { "id": "histcounts2:3", "builtinKey": "histcounts2", "builtinTitle": "histcounts2", "builtinSlug": "histcounts2", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Using different bin widths for X and Y", "summary": "Count paired observations into two-dimensional histogram bins.", "code": "X = [1 1.5 2.4 3.7];\nY = [2 2.2 2.9 3.1];\n[N, Xedges, Yedges] = histcounts2(X, Y, 'XBinWidth', 1, 'YBinWidth', 0.5)", "output": "diff(Xedges) = [1 1 1];\ndiff(Yedges(1:3)) = [0.5 0.5];\nsum(N, \"all\") = 4", "keywords": ["histcounts2", "2d histogram", "joint distribution", "binning", "probability", "gpu"], "suggestedPath": "/histcounts2-3.m" }, { "id": "histcounts2:4", "builtinKey": "histcounts2", "builtinTitle": "histcounts2", "builtinSlug": "histcounts2", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Normalizing a 2-D histogram to probabilities", "summary": "Count paired observations into two-dimensional histogram bins.", "code": "X = [0.2 0.4 1.1 1.5];\nY = [0.1 0.8 1.2 1.9];\nN = histcounts2(X, Y, [0 1 2], [0 1 2], 'Normalization', 'probability')", "output": "N = [0.5 0.0; 0.0 0.5]", "keywords": ["histcounts2", "2d histogram", "joint distribution", "binning", "probability", "gpu"], "suggestedPath": "/histcounts2-4.m" }, { "id": "histcounts2:5", "builtinKey": "histcounts2", "builtinTitle": "histcounts2", "builtinSlug": "histcounts2", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Ignoring NaN values in paired data", "summary": "Count paired observations into two-dimensional histogram bins.", "code": "X = [1 2 NaN 3];\nY = [2 2 2 NaN];\nN = histcounts2(X, Y, [0 1 2 3], [0 1 2 3])", "output": "sum(N, \"all\") = 2", "keywords": ["histcounts2", "2d histogram", "joint distribution", "binning", "probability", "gpu"], "suggestedPath": "/histcounts2-5.m" }, { "id": "histcounts2:6", "builtinKey": "histcounts2", "builtinTitle": "histcounts2", "builtinSlug": "histcounts2", "category": "stats/hist", "categoryPath": ["stats", "hist"], "exampleTitle": "Histogramming gpuArray inputs without manual gather", "summary": "Count paired observations into two-dimensional histogram bins.", "code": "Gx = gpuArray([0.5 1.5 2.5]);\nGy = gpuArray([1.0 1.1 2.9]);\n[counts, Xedges, Yedges] = histcounts2(Gx, Gy, [0 1 2 3], [0 2 3])", "output": "isa(counts, 'double') % counts are returned on the CPU\ncounts = [1 0; 1 0; 0 1]", "keywords": ["histcounts2", "2d histogram", "joint distribution", "binning", "probability", "gpu"], "suggestedPath": "/histcounts2-6.m" }, { "id": "histogram:1", "builtinKey": "histogram", "builtinTitle": "histogram", "builtinSlug": "histogram", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a histogram object from data", "summary": "Create histogram objects with bin-edge semantics, normalization controls, and MATLAB `histogram` workflows.", "code": "data = randn(1, 1000);\nh = histogram(data);", "output": "% h is a histogram object handle", "keywords": ["histogram", "histogram object", "bin edges", "normalized histogram", "matlab histogram", "distribution analysis"], "suggestedPath": "/histogram-1.m" }, { "id": "histogram:2", "builtinKey": "histogram", "builtinTitle": "histogram", "builtinSlug": "histogram", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use explicit bin edges and inspect the handle", "summary": "Create histogram objects with bin-edge semantics, normalization controls, and MATLAB `histogram` workflows.", "code": "data = randn(1, 500);\nedges = -3:0.25:3;\nh = histogram(data, 'BinEdges', edges);\nget(h, 'BinEdges');", "keywords": ["histogram", "histogram object", "bin edges", "normalized histogram", "matlab histogram", "distribution analysis"], "suggestedPath": "/histogram-2.m" }, { "id": "histogram:3", "builtinKey": "histogram", "builtinTitle": "histogram", "builtinSlug": "histogram", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Apply normalization through histogram semantics", "summary": "Create histogram objects with bin-edge semantics, normalization controls, and MATLAB `histogram` workflows.", "code": "data = randn(1, 500);\nh = histogram(data, 'Normalization', 'probability');\nget(h, 'Normalization')", "output": "ans =\n 'probability'", "keywords": ["histogram", "histogram object", "bin edges", "normalized histogram", "matlab histogram", "distribution analysis"], "suggestedPath": "/histogram-3.m" }, { "id": "horzcat:1", "builtinKey": "horzcat", "builtinTitle": "horzcat", "builtinSlug": "horzcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Concatenating matrices by columns", "summary": "Concatenate inputs side-by-side (dimension 2) just like MATLAB's square-bracket syntax.", "code": "A = [1 2; 3 4];\nB = [10 20; 30 40];\nC = horzcat(A, B)", "output": "C =\n 1 2 10 20\n 3 4 30 40", "keywords": ["horzcat", "horizontal concatenation", "square brackets", "array building", "gpu"], "suggestedPath": "/horzcat-1.m" }, { "id": "horzcat:2", "builtinKey": "horzcat", "builtinTitle": "horzcat", "builtinSlug": "horzcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Building a row vector from scalars", "summary": "Concatenate inputs side-by-side (dimension 2) just like MATLAB's square-bracket syntax.", "code": "row = horzcat(1, 2, 3, 4)", "output": "row = [1 2 3 4]", "keywords": ["horzcat", "horizontal concatenation", "square brackets", "array building", "gpu"], "suggestedPath": "/horzcat-2.m" }, { "id": "horzcat:3", "builtinKey": "horzcat", "builtinTitle": "horzcat", "builtinSlug": "horzcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Extending character arrays into words", "summary": "Concatenate inputs side-by-side (dimension 2) just like MATLAB's square-bracket syntax.", "code": "lhs = ['Run' ; 'GPU'];\nrhs = ['Mat' ; 'Fun'];\nwords = horzcat(lhs, rhs)", "output": "words =\n RunMat\n GPUFun", "keywords": ["horzcat", "horizontal concatenation", "square brackets", "array building", "gpu"], "suggestedPath": "/horzcat-3.m" }, { "id": "horzcat:4", "builtinKey": "horzcat", "builtinTitle": "horzcat", "builtinSlug": "horzcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Keeping gpuArray inputs resident on the device", "summary": "Concatenate inputs side-by-side (dimension 2) just like MATLAB's square-bracket syntax.", "code": "G1 = gpuArray(rand(256, 128));\nG2 = gpuArray(rand(256, 64));\nwide = horzcat(G1, G2)", "keywords": ["horzcat", "horizontal concatenation", "square brackets", "array building", "gpu"], "suggestedPath": "/horzcat-4.m" }, { "id": "horzcat:5", "builtinKey": "horzcat", "builtinTitle": "horzcat", "builtinSlug": "horzcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Preserving empties when all inputs are empty", "summary": "Concatenate inputs side-by-side (dimension 2) just like MATLAB's square-bracket syntax.", "code": "emptyBlock = zeros(0, 3);\nresult = horzcat(emptyBlock, emptyBlock)", "keywords": ["horzcat", "horizontal concatenation", "square brackets", "array building", "gpu"], "suggestedPath": "/horzcat-5.m" }, { "id": "horzcat:6", "builtinKey": "horzcat", "builtinTitle": "horzcat", "builtinSlug": "horzcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Matching an output prototype with the `'like'` syntax", "summary": "Concatenate inputs side-by-side (dimension 2) just like MATLAB's square-bracket syntax.", "code": "proto = gpuArray.zeros(5, 1);\ncombo = horzcat(ones(5, 1), zeros(5, 1), \"like\", proto)", "keywords": ["horzcat", "horizontal concatenation", "square brackets", "array building", "gpu"], "suggestedPath": "/horzcat-6.m" }, { "id": "hypot:1", "builtinKey": "hypot", "builtinTitle": "hypot", "builtinSlug": "hypot", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Computing the hypotenuse of two scalars", "summary": "Element-wise Euclidean norm sqrt(x.^2 + y.^2) with MATLAB-compatible broadcasting.", "code": "result = hypot(3, 4)", "output": "result = 5", "keywords": ["hypot", "euclidean norm", "distance", "gpu", "elementwise"], "suggestedPath": "/hypot-1.m" }, { "id": "hypot:2", "builtinKey": "hypot", "builtinTitle": "hypot", "builtinSlug": "hypot", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Using `hypot` with vectors and implicit expansion", "summary": "Element-wise Euclidean norm sqrt(x.^2 + y.^2) with MATLAB-compatible broadcasting.", "code": "x = [-3, 0, 4];\ny = 4;\nnorms = hypot(x, y)", "output": "norms = [5 4 5]", "keywords": ["hypot", "euclidean norm", "distance", "gpu", "elementwise"], "suggestedPath": "/hypot-2.m" }, { "id": "hypot:3", "builtinKey": "hypot", "builtinTitle": "hypot", "builtinSlug": "hypot", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Calculating per-element distances between two matrices", "summary": "Element-wise Euclidean norm sqrt(x.^2 + y.^2) with MATLAB-compatible broadcasting.", "code": "X = [1 2; 3 4];\nY = [0 1; 1 0];\ndist = hypot(X, Y)", "output": "dist = [1.0000 2.2361; 3.1623 4.0000]", "keywords": ["hypot", "euclidean norm", "distance", "gpu", "elementwise"], "suggestedPath": "/hypot-3.m" }, { "id": "hypot:4", "builtinKey": "hypot", "builtinTitle": "hypot", "builtinSlug": "hypot", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Working with complex numbers", "summary": "Element-wise Euclidean norm sqrt(x.^2 + y.^2) with MATLAB-compatible broadcasting.", "code": "a = [1+2i, 3-4i];\nb = [2-1i, -1+1i];\nmag = hypot(a, b)", "output": "mag = [3.1623 5.1962]", "keywords": ["hypot", "euclidean norm", "distance", "gpu", "elementwise"], "suggestedPath": "/hypot-4.m" }, { "id": "hypot:5", "builtinKey": "hypot", "builtinTitle": "hypot", "builtinSlug": "hypot", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Applying `hypot` to character data", "summary": "Element-wise Euclidean norm sqrt(x.^2 + y.^2) with MATLAB-compatible broadcasting.", "code": "codes = hypot('A', zeros(1, 1))", "output": "codes = 65.0000", "keywords": ["hypot", "euclidean norm", "distance", "gpu", "elementwise"], "suggestedPath": "/hypot-5.m" }, { "id": "hypot:6", "builtinKey": "hypot", "builtinTitle": "hypot", "builtinSlug": "hypot", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Executing `hypot` on GPU arrays", "summary": "Element-wise Euclidean norm sqrt(x.^2 + y.^2) with MATLAB-compatible broadcasting.", "code": "Gx = gpuArray([3 4; 5 12]);\nGy = gpuArray([4 3; 12 5]);\ndistance_gpu = hypot(Gx, Gy);\ndistance = gather(distance_gpu)", "output": "distance = [5 5; 13 13]", "keywords": ["hypot", "euclidean norm", "distance", "gpu", "elementwise"], "suggestedPath": "/hypot-6.m" }, { "id": "ifft:1", "builtinKey": "ifft", "builtinTitle": "ifft", "builtinSlug": "ifft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Reconstructing a time-domain signal from FFT bins", "summary": "Compute the inverse discrete Fourier transform (IDFT) of vectors, matrices, or N-D tensors.", "code": "Y = [10 -2+2i -2 -2-2i];\nx = ifft(Y)", "output": "x =\n Columns 1 through 4\n 1 2 3 4", "keywords": ["ifft", "inverse fft", "inverse fourier transform", "symmetric", "gpu"], "suggestedPath": "/ifft-1.m" }, { "id": "ifft:2", "builtinKey": "ifft", "builtinTitle": "ifft", "builtinSlug": "ifft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Computing `ifft` along a specific dimension", "summary": "Compute the inverse discrete Fourier transform (IDFT) of vectors, matrices, or N-D tensors.", "code": "F = [10 14 18;\n -3+3i -3+3i -3+3i];\nX = ifft(F, [], 1)", "keywords": ["ifft", "inverse fft", "inverse fourier transform", "symmetric", "gpu"], "suggestedPath": "/ifft-2.m" }, { "id": "ifft:3", "builtinKey": "ifft", "builtinTitle": "ifft", "builtinSlug": "ifft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Zero-padding the inverse transform", "summary": "Compute the inverse discrete Fourier transform (IDFT) of vectors, matrices, or N-D tensors.", "code": "F = [4 0 0 0];\nx = ifft(F, 8)", "keywords": ["ifft", "inverse fft", "inverse fourier transform", "symmetric", "gpu"], "suggestedPath": "/ifft-3.m" }, { "id": "ifft:4", "builtinKey": "ifft", "builtinTitle": "ifft", "builtinSlug": "ifft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Enforcing a real result with `'symmetric'`", "summary": "Compute the inverse discrete Fourier transform (IDFT) of vectors, matrices, or N-D tensors.", "code": "F = fft([1 2 3 4]);\nx = ifft(F, 'symmetric')", "keywords": ["ifft", "inverse fft", "inverse fourier transform", "symmetric", "gpu"], "suggestedPath": "/ifft-4.m" }, { "id": "ifft:5", "builtinKey": "ifft", "builtinTitle": "ifft", "builtinSlug": "ifft", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Running `ifft` on `gpuArray` inputs", "summary": "Compute the inverse discrete Fourier transform (IDFT) of vectors, matrices, or N-D tensors.", "code": "G = gpuArray(fft([1 0 0 0]));\nX = ifft(G);\nresult = gather(X)", "keywords": ["ifft", "inverse fft", "inverse fourier transform", "symmetric", "gpu"], "suggestedPath": "/ifft-5.m" }, { "id": "ifft2:1", "builtinKey": "ifft2", "builtinTitle": "ifft2", "builtinSlug": "ifft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Reconstructing an image patch from its 2-D spectrum", "summary": "Compute the two-dimensional inverse discrete Fourier transform (IDFT) of numeric or complex data.", "code": "F = [10 -2 0 -2;\n -4 0 0 0];\nx = ifft2(F)", "output": "x =\n 1.0000 2.0000\n 3.0000 4.0000", "keywords": ["ifft2", "inverse 2d fft", "image reconstruction", "symmetric", "gpu"], "suggestedPath": "/ifft2-1.m" }, { "id": "ifft2:2", "builtinKey": "ifft2", "builtinTitle": "ifft2", "builtinSlug": "ifft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Zero-padding before the inverse transform", "summary": "Compute the two-dimensional inverse discrete Fourier transform (IDFT) of numeric or complex data.", "code": "F = fft2([1 0; 0 1], 4, 4);\nspatial = ifft2(F, 4, 4)", "keywords": ["ifft2", "inverse 2d fft", "image reconstruction", "symmetric", "gpu"], "suggestedPath": "/ifft2-2.m" }, { "id": "ifft2:3", "builtinKey": "ifft2", "builtinTitle": "ifft2", "builtinSlug": "ifft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Supplying transform lengths with a size vector", "summary": "Compute the two-dimensional inverse discrete Fourier transform (IDFT) of numeric or complex data.", "code": "Y = fft2(rand(3,4));\nX = ifft2(Y, [5 2]); % pad rows to 5, truncate columns to 2", "keywords": ["ifft2", "inverse 2d fft", "image reconstruction", "symmetric", "gpu"], "suggestedPath": "/ifft2-3.m" }, { "id": "ifft2:4", "builtinKey": "ifft2", "builtinTitle": "ifft2", "builtinSlug": "ifft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Forcing a real-valued result with `'symmetric'`", "summary": "Compute the two-dimensional inverse discrete Fourier transform (IDFT) of numeric or complex data.", "code": "F = fft2([1 2; 3 4]);\nrealImage = ifft2(F, 'symmetric')", "keywords": ["ifft2", "inverse 2d fft", "image reconstruction", "symmetric", "gpu"], "suggestedPath": "/ifft2-4.m" }, { "id": "ifft2:5", "builtinKey": "ifft2", "builtinTitle": "ifft2", "builtinSlug": "ifft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Running `ifft2` on `gpuArray` inputs", "summary": "Compute the two-dimensional inverse discrete Fourier transform (IDFT) of numeric or complex data.", "code": "G = gpuArray(fft2(peaks(64)));\nspatial = ifft2(G);\nresult = gather(spatial)", "keywords": ["ifft2", "inverse 2d fft", "image reconstruction", "symmetric", "gpu"], "suggestedPath": "/ifft2-5.m" }, { "id": "ifft2:6", "builtinKey": "ifft2", "builtinTitle": "ifft2", "builtinSlug": "ifft2", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Recovering each slice of a volume", "summary": "Compute the two-dimensional inverse discrete Fourier transform (IDFT) of numeric or complex data.", "code": "spectra = fft2(rand(16, 16, 10));\nvolume = ifft2(spectra)", "keywords": ["ifft2", "inverse 2d fft", "image reconstruction", "symmetric", "gpu"], "suggestedPath": "/ifft2-6.m" }, { "id": "ifftshift:1", "builtinKey": "ifftshift", "builtinTitle": "ifftshift", "builtinSlug": "ifftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Undoing fftshift on an even-length spectrum", "summary": "Undo fftshift by moving the zero-frequency component back to the origin.", "code": "x = 0:7;\ny = ifftshift(x)", "output": "y = [4 5 6 7 0 1 2 3]", "keywords": ["ifftshift", "inverse fft shift", "frequency alignment", "gpu"], "suggestedPath": "/ifftshift-1.m" }, { "id": "ifftshift:2", "builtinKey": "ifftshift", "builtinTitle": "ifftshift", "builtinSlug": "ifftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Undoing fftshift on an odd-length spectrum", "summary": "Undo fftshift by moving the zero-frequency component back to the origin.", "code": "x = 1:5;\ny = ifftshift(x)", "output": "y = [3 4 5 1 2]", "keywords": ["ifftshift", "inverse fft shift", "frequency alignment", "gpu"], "suggestedPath": "/ifftshift-2.m" }, { "id": "ifftshift:3", "builtinKey": "ifftshift", "builtinTitle": "ifftshift", "builtinSlug": "ifftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Preparing data for inverse FFT", "summary": "Undo fftshift by moving the zero-frequency component back to the origin.", "code": "fx = fft(rand(1, 8));\ncentered = fftshift(fx);\nrestored = ifftshift(centered);\nsignal = ifft(restored)", "keywords": ["ifftshift", "inverse fft shift", "frequency alignment", "gpu"], "suggestedPath": "/ifftshift-3.m" }, { "id": "ifftshift:4", "builtinKey": "ifftshift", "builtinTitle": "ifftshift", "builtinSlug": "ifftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Shifting only selected dimensions", "summary": "Undo fftshift by moving the zero-frequency component back to the origin.", "code": "A = reshape(1:12, 3, 4);\nrowsShifted = ifftshift(A, 1); % shift rows only\ncolsShifted = ifftshift(A, 2); % shift columns only", "output": "rowsShifted =\n 2 5 8 11\n 3 6 9 12\n 1 4 7 10\n\ncolsShifted =\n 7 10 1 4\n 8 11 2 5\n 9 12 3 6", "keywords": ["ifftshift", "inverse fft shift", "frequency alignment", "gpu"], "suggestedPath": "/ifftshift-4.m" }, { "id": "ifftshift:5", "builtinKey": "ifftshift", "builtinTitle": "ifftshift", "builtinSlug": "ifftshift", "category": "math/fft", "categoryPath": ["math", "fft"], "exampleTitle": "Using ifftshift with gpuArray data", "summary": "Undo fftshift by moving the zero-frequency component back to the origin.", "code": "G = gpuArray(0:7);\nshifted = ifftshift(G);\nhost = gather(shifted)", "output": "host = [4 5 6 7 0 1 2 3]", "keywords": ["ifftshift", "inverse fft shift", "frequency alignment", "gpu"], "suggestedPath": "/ifftshift-5.m" }, { "id": "imag:1", "builtinKey": "imag", "builtinTitle": "imag", "builtinSlug": "imag", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Extracting the imaginary part of a complex scalar", "summary": "Extract the imaginary component of scalars, vectors, matrices, or N-D tensors.", "code": "z = 3 + 4i;\nb = imag(z)", "output": "b = 4", "keywords": ["imag", "imaginary", "complex", "elementwise", "gpu"], "suggestedPath": "/imag-1.m" }, { "id": "imag:2", "builtinKey": "imag", "builtinTitle": "imag", "builtinSlug": "imag", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Retrieving imaginary components of a complex matrix", "summary": "Extract the imaginary component of scalars, vectors, matrices, or N-D tensors.", "code": "Z = [1+2i 4-3i; -5+0i 7+8i];\nY = imag(Z)", "output": "Y =\n 2 -3\n 0 8", "keywords": ["imag", "imaginary", "complex", "elementwise", "gpu"], "suggestedPath": "/imag-2.m" }, { "id": "imag:3", "builtinKey": "imag", "builtinTitle": "imag", "builtinSlug": "imag", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Verifying that real inputs yield zero", "summary": "Extract the imaginary component of scalars, vectors, matrices, or N-D tensors.", "code": "data = [-2.5 0 9.75];\nvalues = imag(data)", "output": "values = [0 0 0]", "keywords": ["imag", "imaginary", "complex", "elementwise", "gpu"], "suggestedPath": "/imag-3.m" }, { "id": "imag:4", "builtinKey": "imag", "builtinTitle": "imag", "builtinSlug": "imag", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Imaginary part of logical masks", "summary": "Extract the imaginary component of scalars, vectors, matrices, or N-D tensors.", "code": "mask = logical([0 1 0; 1 0 1]);\nzerosOnly = imag(mask)", "output": "zerosOnly =\n 0 0 0\n 0 0 0", "keywords": ["imag", "imaginary", "complex", "elementwise", "gpu"], "suggestedPath": "/imag-4.m" }, { "id": "imag:5", "builtinKey": "imag", "builtinTitle": "imag", "builtinSlug": "imag", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Working with GPU-resident tensors", "summary": "Extract the imaginary component of scalars, vectors, matrices, or N-D tensors.", "code": "G = rand(2048, 256, \"gpuArray\");\nres = imag(G)", "keywords": ["imag", "imaginary", "complex", "elementwise", "gpu"], "suggestedPath": "/imag-5.m" }, { "id": "image:1", "builtinKey": "image", "builtinTitle": "image", "builtinSlug": "image", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Display a simple indexed image", "summary": "Display indexed or truecolor images as graphics objects with MATLAB `image` semantics and GPU-backed rendering paths.", "code": "C = [1 2 3; 3 2 1; 2 3 1];\nimage(C);\ncolormap('jet');", "keywords": ["image", "image display", "truecolor image", "indexed image", "matlab image", "imshow style image"], "suggestedPath": "/image-1.m" }, { "id": "image:2", "builtinKey": "image", "builtinTitle": "image", "builtinSlug": "image", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Display a truecolor RGB image", "summary": "Display indexed or truecolor images as graphics objects with MATLAB `image` semantics and GPU-backed rendering paths.", "code": "img = zeros(100, 100, 3);\nimg(:,:,1) = 1;\nimg(25:75,25:75,2) = 1;\nimage(img);", "output": "% Displays a truecolor image object", "keywords": ["image", "image display", "truecolor image", "indexed image", "matlab image", "imshow style image"], "suggestedPath": "/image-2.m" }, { "id": "image:3", "builtinKey": "image", "builtinTitle": "image", "builtinSlug": "image", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Position an image explicitly on axes and inspect the handle", "summary": "Display indexed or truecolor images as graphics objects with MATLAB `image` semantics and GPU-backed rendering paths.", "code": "C = reshape(1:16, 4, 4);\nh = image([0 3], [10 40], C);\nget(h, 'Type')", "output": "ans =\n 'image'", "keywords": ["image", "image display", "truecolor image", "indexed image", "matlab image", "imshow style image"], "suggestedPath": "/image-3.m" }, { "id": "imagesc:1", "builtinKey": "imagesc", "builtinTitle": "imagesc", "builtinSlug": "imagesc", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Display a matrix as a heatmap-style scaled image", "summary": "Display scaled matrix images for heatmaps, colormaps, and MATLAB `imagesc` style visualization.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 60), linspace(-3, 3, 60));\nA = sin(X) .* cos(Y);\nimagesc(A);\ncolorbar;", "keywords": ["imagesc", "scaled image", "heatmap", "matrix visualization", "matlab imagesc", "colormap image"], "suggestedPath": "/imagesc-1.m" }, { "id": "imagesc:2", "builtinKey": "imagesc", "builtinTitle": "imagesc", "builtinSlug": "imagesc", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Place a scaled image on explicit axes", "summary": "Display scaled matrix images for heatmaps, colormaps, and MATLAB `imagesc` style visualization.", "code": "A = reshape(1:100, 10, 10);\nimagesc([-5 5], [0 1], A);\ncolormap('parula');", "keywords": ["imagesc", "scaled image", "heatmap", "matrix visualization", "matlab imagesc", "colormap image"], "suggestedPath": "/imagesc-2.m" }, { "id": "imagesc:3", "builtinKey": "imagesc", "builtinTitle": "imagesc", "builtinSlug": "imagesc", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use subplot-local color workflows", "summary": "Display scaled matrix images for heatmaps, colormaps, and MATLAB `imagesc` style visualization.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 40), linspace(-3, 3, 40));\nZ = sin(X) .* cos(Y);\nsubplot(1, 2, 1);\nimagesc(Z);\ncolormap('jet');\ncolorbar;\nsubplot(1, 2, 2);\nimagesc(magic(20));\ncolormap('gray');", "keywords": ["imagesc", "scaled image", "heatmap", "matrix visualization", "matlab imagesc", "colormap image"], "suggestedPath": "/imagesc-3.m" }, { "id": "imfilter:1", "builtinKey": "imfilter", "builtinTitle": "imfilter", "builtinSlug": "imfilter", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Smoothing an image with a 3x3 average filter", "summary": "Filter images or N-D arrays with correlation/convolution kernels and configurable padding.", "code": "I = [1 2; 3 4];\nH = ones(3) / 9;\nJ = imfilter(I, H); % default zero padding, correlation", "output": "J =\n 1.1111 1.1111\n 1.1111 1.1111", "keywords": ["imfilter", "filter", "image", "convolution", "correlation", "padding"], "suggestedPath": "/imfilter-1.m" }, { "id": "imfilter:2", "builtinKey": "imfilter", "builtinTitle": "imfilter", "builtinSlug": "imfilter", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Preserving borders with replicate padding", "summary": "Filter images or N-D arrays with correlation/convolution kernels and configurable padding.", "code": "I = magic(3);\nH = ones(3);\nJ = imfilter(I, H, 'replicate')", "output": "J =\n 45 45 45\n 45 45 45\n 45 45 45", "keywords": ["imfilter", "filter", "image", "convolution", "correlation", "padding"], "suggestedPath": "/imfilter-2.m" }, { "id": "imfilter:3", "builtinKey": "imfilter", "builtinTitle": "imfilter", "builtinSlug": "imfilter", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Computing the full convolution result", "summary": "Filter images or N-D arrays with correlation/convolution kernels and configurable padding.", "code": "I = [1 2; 3 4];\nH = [1 2; 3 4];\nJ = imfilter(I, H, 'full')", "output": "J =\n 0 0 0\n 0 4 11\n 0 14 30", "keywords": ["imfilter", "filter", "image", "convolution", "correlation", "padding"], "suggestedPath": "/imfilter-3.m" }, { "id": "imfilter:4", "builtinKey": "imfilter", "builtinTitle": "imfilter", "builtinSlug": "imfilter", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Switching to convolution mode", "summary": "Filter images or N-D arrays with correlation/convolution kernels and configurable padding.", "code": "I = reshape(1:6, [3 2]);\nH = [1 2; 3 4];\nJ = imfilter(I, H, 'conv'); % equivalent to convn(I, rot90(H,2), 'same')", "output": "J =\n 1 6\n 5 25\n 9 35", "keywords": ["imfilter", "filter", "image", "convolution", "correlation", "padding"], "suggestedPath": "/imfilter-4.m" }, { "id": "imfilter:5", "builtinKey": "imfilter", "builtinTitle": "imfilter", "builtinSlug": "imfilter", "category": "image/filters", "categoryPath": ["image", "filters"], "exampleTitle": "Wrapping edges with circular padding", "summary": "Filter images or N-D arrays with correlation/convolution kernels and configurable padding.", "code": "I = [1 2; 3 4];\nH = [0 1; 1 0];\nJ = imfilter(I, H, 'circular')", "output": "J =\n 5 5\n 5 5", "keywords": ["imfilter", "filter", "image", "convolution", "correlation", "padding"], "suggestedPath": "/imfilter-5.m" }, { "id": "ind2sub:1", "builtinKey": "ind2sub", "builtinTitle": "ind2sub", "builtinSlug": "ind2sub", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Recovering row and column subscripts from a matrix index", "summary": "Convert MATLAB column-major linear indices into per-dimension subscript arrays.", "code": "[row, col] = ind2sub([3 4], 8)", "output": "row = 2;\ncol = 3", "keywords": ["ind2sub", "linear index", "subscripts", "column major", "gpu", "nd indexing"], "suggestedPath": "/ind2sub-1.m" }, { "id": "ind2sub:2", "builtinKey": "ind2sub", "builtinTitle": "ind2sub", "builtinSlug": "ind2sub", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Extracting multiple matrix indices at once", "summary": "Convert MATLAB column-major linear indices into per-dimension subscript arrays.", "code": "idx = [7 8 9];\n[rows, cols] = ind2sub([3 5], idx)", "output": "rows = [1 2 3];\ncols = [3 3 3]", "keywords": ["ind2sub", "linear index", "subscripts", "column major", "gpu", "nd indexing"], "suggestedPath": "/ind2sub-2.m" }, { "id": "ind2sub:3", "builtinKey": "ind2sub", "builtinTitle": "ind2sub", "builtinSlug": "ind2sub", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Converting indices for a 3-D volume", "summary": "Convert MATLAB column-major linear indices into per-dimension subscript arrays.", "code": "idx = [3 11];\n[r, c, p] = ind2sub([2 3 4], idx)", "output": "r = [1 1];\nc = [2 3];\np = [1 2]", "keywords": ["ind2sub", "linear index", "subscripts", "column major", "gpu", "nd indexing"], "suggestedPath": "/ind2sub-3.m" }, { "id": "ind2sub:4", "builtinKey": "ind2sub", "builtinTitle": "ind2sub", "builtinSlug": "ind2sub", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Keeping indices on the GPU", "summary": "Convert MATLAB column-major linear indices into per-dimension subscript arrays.", "code": "rows = gpuArray([1; 2; 3]);\ncols = gpuArray([4; 4; 4]);\nlin = sub2ind([3 4], rows, cols);\nsubs = ind2sub([3 4], lin); % subs{1} and subs{2} remain gpuArray values\nclass(subs{1})\nclass(subs{2})", "output": "ans =\n 'gpuArray'\n\nans =\n 'gpuArray'", "keywords": ["ind2sub", "linear index", "subscripts", "column major", "gpu", "nd indexing"], "suggestedPath": "/ind2sub-4.m" }, { "id": "ind2sub:5", "builtinKey": "ind2sub", "builtinTitle": "ind2sub", "builtinSlug": "ind2sub", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Using a single output cell for flexible unpacking", "summary": "Convert MATLAB column-major linear indices into per-dimension subscript arrays.", "code": "subs = ind2sub(size(magic(4)), 6:9);\n% Access with subs{1}, subs{2}, ...", "output": "subs =\n 1×2 cell array\n {1×4 double} {1×4 double}", "keywords": ["ind2sub", "linear index", "subscripts", "column major", "gpu", "nd indexing"], "suggestedPath": "/ind2sub-5.m" }, { "id": "ind2sub:6", "builtinKey": "ind2sub", "builtinTitle": "ind2sub", "builtinSlug": "ind2sub", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Validating index ranges before reshaping", "summary": "Convert MATLAB column-major linear indices into per-dimension subscript arrays.", "code": "A = magic(4);\nidx = 1:numel(A);\n[i, j] = ind2sub(size(A), idx)", "keywords": ["ind2sub", "linear index", "subscripts", "column major", "gpu", "nd indexing"], "suggestedPath": "/ind2sub-6.m" }, { "id": "input:1", "builtinKey": "input", "builtinTitle": "input", "builtinSlug": "input", "category": "io", "categoryPath": ["io"], "exampleTitle": "Example 1", "summary": "Prompt the user for input. Return either the typed text or a parsed numeric value.", "code": "value = input(\"Enter a scalar: \")", "keywords": ["input", "prompt", "stdin", "interactive", "pause", "gather"], "suggestedPath": "/input-1.m" }, { "id": "intersect:1", "builtinKey": "intersect", "builtinTitle": "intersect", "builtinSlug": "intersect", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Finding common values in numeric vectors", "summary": "Return common elements or rows across arrays with MATLAB-compatible ordering and index outputs.", "code": "A = [5 7 5 1];\nB = [7 1 3];\n[C, IA, IB] = intersect(A, B)", "output": "C =\n 1\n 7\nIA =\n 4\n 2\nIB =\n 2\n 1", "keywords": ["intersect", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/intersect-1.m" }, { "id": "intersect:2", "builtinKey": "intersect", "builtinTitle": "intersect", "builtinSlug": "intersect", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Preserving input order with `'stable'`", "summary": "Return common elements or rows across arrays with MATLAB-compatible ordering and index outputs.", "code": "A = [4 2 4 1 3];\nB = [3 4 5 1];\nC = intersect(A, B, 'stable')", "output": "C =\n 4\n 1\n 3", "keywords": ["intersect", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/intersect-2.m" }, { "id": "intersect:3", "builtinKey": "intersect", "builtinTitle": "intersect", "builtinSlug": "intersect", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Intersecting matrix rows", "summary": "Return common elements or rows across arrays with MATLAB-compatible ordering and index outputs.", "code": "A = [1 2; 3 4; 1 2];\nB = [2 3; 1 2];\n[C, IA, IB] = intersect(A, B, 'rows')", "output": "C =\n 1 2\nIA =\n 1\nIB =\n 2", "keywords": ["intersect", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/intersect-3.m" }, { "id": "intersect:4", "builtinKey": "intersect", "builtinTitle": "intersect", "builtinSlug": "intersect", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Working with strings and character arrays", "summary": "Return common elements or rows across arrays with MATLAB-compatible ordering and index outputs.", "code": "names1 = [\"apple\" \"orange\" \"pear\"];\nnames2 = [\"pear\" \"grape\" \"orange\"];\n[common, IA, IB] = intersect(names1, names2, 'stable')", "output": "common =\n 1×2 string array\n \"orange\" \"pear\"\nIA =\n 2\n 3\nIB =\n 3\n 1", "keywords": ["intersect", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/intersect-4.m" }, { "id": "intersect:5", "builtinKey": "intersect", "builtinTitle": "intersect", "builtinSlug": "intersect", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Using `intersect` on GPU arrays", "summary": "Return common elements or rows across arrays with MATLAB-compatible ordering and index outputs.", "code": "G = gpuArray([10 4 6 4]);\nH = gpuArray([6 4 2]);\nresult = intersect(G, H)", "output": "result =\n 4\n 6", "keywords": ["intersect", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/intersect-5.m" }, { "id": "inv:1", "builtinKey": "inv", "builtinTitle": "inv", "builtinSlug": "inv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Inverting a 2x2 matrix for solving linear systems", "summary": "Compute the inverse of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "A = [4 -2; 1 3];\nX = inv(A)", "output": "X =\n 0.3 0.2\n -0.1 0.4", "keywords": ["inv", "matrix inverse", "linear algebra", "solve", "gpu"], "suggestedPath": "/inv-1.m" }, { "id": "inv:2", "builtinKey": "inv", "builtinTitle": "inv", "builtinSlug": "inv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Checking that `inv(A)` produces the identity matrix", "summary": "Compute the inverse of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "A = [2 1 0; 0 1 -1; 0 0 3];\nX = inv(A);\nproduct = A * X", "output": "product =\n 1.0000 0 0\n 0 1.0000 0\n 0 0 1.0000", "keywords": ["inv", "matrix inverse", "linear algebra", "solve", "gpu"], "suggestedPath": "/inv-2.m" }, { "id": "inv:3", "builtinKey": "inv", "builtinTitle": "inv", "builtinSlug": "inv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Inverting a diagonal matrix with symbolic structure", "summary": "Compute the inverse of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "D = diag([2, 5, 10]);\nX = inv(D)", "output": "X =\n 0.5000 0 0\n 0 0.2000 0\n 0 0 0.1000", "keywords": ["inv", "matrix inverse", "linear algebra", "solve", "gpu"], "suggestedPath": "/inv-3.m" }, { "id": "inv:4", "builtinKey": "inv", "builtinTitle": "inv", "builtinSlug": "inv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Computing the inverse of a complex matrix", "summary": "Compute the inverse of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "A = [1+2i 0; 3i 4-1i];\nX = inv(A)", "output": "X =\n 0.2105 - 0.1053i -0.0158 - 0.1579i\n -0.1579 - 0.1184i 0.0526 + 0.2632i", "keywords": ["inv", "matrix inverse", "linear algebra", "solve", "gpu"], "suggestedPath": "/inv-4.m" }, { "id": "inv:5", "builtinKey": "inv", "builtinTitle": "inv", "builtinSlug": "inv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Using `inv` on a GPU-resident matrix", "summary": "Compute the inverse of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "G = gpuArray([3 1; 0 2]);\ninvG = inv(G); % stays on the GPU when the provider implements inv\nresult = gather(invG)", "output": "result =\n 0.3333 -0.1667\n 0 0.5000", "keywords": ["inv", "matrix inverse", "linear algebra", "solve", "gpu"], "suggestedPath": "/inv-5.m" }, { "id": "inv:6", "builtinKey": "inv", "builtinTitle": "inv", "builtinSlug": "inv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Handling singular matrices gracefully", "summary": "Compute the inverse of a square matrix with MATLAB-compatible pivoting and GPU fallbacks.", "code": "A = [1 2; 2 4];\nX = inv(A)", "output": "Error using inv\ninv: matrix is singular to working precision.", "keywords": ["inv", "matrix inverse", "linear algebra", "solve", "gpu"], "suggestedPath": "/inv-6.m" }, { "id": "ipermute:1", "builtinKey": "ipermute", "builtinTitle": "ipermute", "builtinSlug": "ipermute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reversing a previous permute call", "summary": "Reorder array dimensions using the inverse of a permutation vector.", "code": "A = reshape(1:24, [2 3 4]);\nB = permute(A, [2 1 3]);\nC = ipermute(B, [2 1 3]);\nisequal(A, C)", "output": "ans = logical 1", "keywords": ["ipermute", "inverse permute", "dimension reorder", "gpu"], "suggestedPath": "/ipermute-1.m" }, { "id": "ipermute:2", "builtinKey": "ipermute", "builtinTitle": "ipermute", "builtinSlug": "ipermute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Restoring matrix orientation after swapping dimensions", "summary": "Reorder array dimensions using the inverse of a permutation vector.", "code": "M = magic(3);\nP = permute(M, [2 1]);\nR = ipermute(P, [2 1]);\nsize(R)", "output": "ans = [3 3]", "keywords": ["ipermute", "inverse permute", "dimension reorder", "gpu"], "suggestedPath": "/ipermute-2.m" }, { "id": "ipermute:3", "builtinKey": "ipermute", "builtinTitle": "ipermute", "builtinSlug": "ipermute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Undoing a permutation with extra singleton dimensions", "summary": "Reorder array dimensions using the inverse of a permutation vector.", "code": "row = 1:5;\nP = permute(row, [2 1 3]);\nR = ipermute(P, [2 1 3]);\nsize(R)", "output": "ans = [1 5 1]", "keywords": ["ipermute", "inverse permute", "dimension reorder", "gpu"], "suggestedPath": "/ipermute-3.m" }, { "id": "ipermute:4", "builtinKey": "ipermute", "builtinTitle": "ipermute", "builtinSlug": "ipermute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Recovering logical masks after reordering axes", "summary": "Reorder array dimensions using the inverse of a permutation vector.", "code": "mask = false(2, 1, 3);\nmask(1, 1, 2) = true;\nrot = permute(mask, [3 1 2]);\norig = ipermute(rot, [3 1 2]);\norig(1,1,2)", "output": "ans = logical 1", "keywords": ["ipermute", "inverse permute", "dimension reorder", "gpu"], "suggestedPath": "/ipermute-4.m" }, { "id": "ipermute:5", "builtinKey": "ipermute", "builtinTitle": "ipermute", "builtinSlug": "ipermute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Working with character arrays", "summary": "Reorder array dimensions using the inverse of a permutation vector.", "code": "chars = ['r','u','n'; 'm','a','t'];\nT = permute(chars, [2 1]);\nR = ipermute(T, [2 1]);\nR", "output": "R =\n 'run'\n 'mat'", "keywords": ["ipermute", "inverse permute", "dimension reorder", "gpu"], "suggestedPath": "/ipermute-5.m" }, { "id": "ipermute:6", "builtinKey": "ipermute", "builtinTitle": "ipermute", "builtinSlug": "ipermute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Restoring gpuArray tensors to host layout", "summary": "Reorder array dimensions using the inverse of a permutation vector.", "code": "G = gpuArray(rand(4, 2, 3));\nH = permute(G, [3 1 2]);\nR = ipermute(H, [3 1 2]);\nisequal(gather(G), gather(R))", "output": "ans = logical 1", "keywords": ["ipermute", "inverse permute", "dimension reorder", "gpu"], "suggestedPath": "/ipermute-6.m" }, { "id": "isa:1", "builtinKey": "isa", "builtinTitle": "isa", "builtinSlug": "isa", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Checking whether a scalar is double precision", "summary": "Test whether a value belongs to a specified MATLAB class or abstract category.", "code": "tf = isa(42, \"double\")", "output": "tf = logical(1)", "keywords": ["isa", "type checking", "class comparison", "numeric category", "gpuArray"], "suggestedPath": "/isa-1.m" }, { "id": "isa:2", "builtinKey": "isa", "builtinTitle": "isa", "builtinSlug": "isa", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Testing numeric arrays against the numeric category", "summary": "Test whether a value belongs to a specified MATLAB class or abstract category.", "code": "A = rand(3, 4);\nis_numeric = isa(A, \"numeric\");\nis_integer = isa(A, \"integer\")", "output": "is_numeric = logical(1)\nis_integer = logical(0)", "keywords": ["isa", "type checking", "class comparison", "numeric category", "gpuArray"], "suggestedPath": "/isa-2.m" }, { "id": "isa:3", "builtinKey": "isa", "builtinTitle": "isa", "builtinSlug": "isa", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Confirming that gpuArray data counts as numeric", "summary": "Test whether a value belongs to a specified MATLAB class or abstract category.", "code": "G = gpuArray(rand(1024, 1024));\ntf_numeric = isa(G, \"numeric\");\ntf_double = isa(G, \"double\"); % false — the class reports gpuArray", "output": "tf_numeric = logical(1)\ntf_double = logical(0)", "keywords": ["isa", "type checking", "class comparison", "numeric category", "gpuArray"], "suggestedPath": "/isa-3.m" }, { "id": "isa:4", "builtinKey": "isa", "builtinTitle": "isa", "builtinSlug": "isa", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Determining whether a GPU mask is logical", "summary": "Test whether a value belongs to a specified MATLAB class or abstract category.", "code": "G = gpuArray(rand(5) > 0.5);\nis_mask = isa(G, \"logical\");\nis_numeric = isa(G, \"numeric\")", "output": "is_mask = logical(1)\nis_numeric = logical(0)", "keywords": ["isa", "type checking", "class comparison", "numeric category", "gpuArray"], "suggestedPath": "/isa-4.m" }, { "id": "isa:5", "builtinKey": "isa", "builtinTitle": "isa", "builtinSlug": "isa", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Validating handle subclasses", "summary": "Test whether a value belongs to a specified MATLAB class or abstract category.", "code": "pt = pkg.TestHandle(); % derives from handle\ntf_handle = isa(pt, \"handle\");\ntf_exact = isa(pt, \"pkg.TestHandle\")", "output": "tf_handle = logical(1)\ntf_exact = logical(1)", "keywords": ["isa", "type checking", "class comparison", "numeric category", "gpuArray"], "suggestedPath": "/isa-5.m" }, { "id": "isa:6", "builtinKey": "isa", "builtinTitle": "isa", "builtinSlug": "isa", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Comparing string scalars and character vectors", "summary": "Test whether a value belongs to a specified MATLAB class or abstract category.", "code": "s = \"RunMat\";\nc = 'RunMat';\ntf_string = isa(s, \"string\");\ntf_char = isa(c, \"char\")", "output": "tf_string = logical(1)\ntf_char = logical(1)", "keywords": ["isa", "type checking", "class comparison", "numeric category", "gpuArray"], "suggestedPath": "/isa-6.m" }, { "id": "isa:7", "builtinKey": "isa", "builtinTitle": "isa", "builtinSlug": "isa", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Detecting function handles and listeners", "summary": "Test whether a value belongs to a specified MATLAB class or abstract category.", "code": "fh = @sin;\ntf_handle = isa(fh, \"function_handle\");\nlst = addlistener(TestSource, \"Changed\", @disp);\ntf_listener = isa(lst, \"listener\")", "output": "tf_handle = logical(1)\ntf_listener = logical(1)", "keywords": ["isa", "type checking", "class comparison", "numeric category", "gpuArray"], "suggestedPath": "/isa-7.m" }, { "id": "ischar:1", "builtinKey": "ischar", "builtinTitle": "ischar", "builtinSlug": "ischar", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Checking if a character vector is a char array", "summary": "Test whether a value is a MATLAB character array (char vector or char matrix).", "code": "tf = ischar('RunMat')", "output": "tf = logical(1)", "keywords": ["ischar", "character arrays", "type checking", "char", "logical predicate", "gpuArray"], "suggestedPath": "/ischar-1.m" }, { "id": "ischar:2", "builtinKey": "ischar", "builtinTitle": "ischar", "builtinSlug": "ischar", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Detecting multi-row char matrices", "summary": "Test whether a value is a MATLAB character array (char vector or char matrix).", "code": "letters = ['ab'; 'cd'];\ntf = ischar(letters)", "output": "tf = logical(1)", "keywords": ["ischar", "character arrays", "type checking", "char", "logical predicate", "gpuArray"], "suggestedPath": "/ischar-2.m" }, { "id": "ischar:3", "builtinKey": "ischar", "builtinTitle": "ischar", "builtinSlug": "ischar", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Distinguishing between char arrays and string scalars", "summary": "Test whether a value is a MATLAB character array (char vector or char matrix).", "code": "tf_char = ischar('hello');\ntf_string = ischar(\"hello\")", "output": "tf_char = logical(1)\ntf_string = logical(0)", "keywords": ["ischar", "character arrays", "type checking", "char", "logical predicate", "gpuArray"], "suggestedPath": "/ischar-3.m" }, { "id": "ischar:4", "builtinKey": "ischar", "builtinTitle": "ischar", "builtinSlug": "ischar", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Recognising that numeric and logical data are not char arrays", "summary": "Test whether a value is a MATLAB character array (char vector or char matrix).", "code": "numbers = [1 2 3];\nmask = true(1, 3);\ntf_numbers = ischar(numbers);\ntf_mask = ischar(mask)", "output": "tf_numbers = logical(0)\ntf_mask = logical(0)", "keywords": ["ischar", "character arrays", "type checking", "char", "logical predicate", "gpuArray"], "suggestedPath": "/ischar-4.m" }, { "id": "ischar:5", "builtinKey": "ischar", "builtinTitle": "ischar", "builtinSlug": "ischar", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Testing gpuArray inputs", "summary": "Test whether a value is a MATLAB character array (char vector or char matrix).", "code": "G = gpuArray(ones(2, 2));\ntf_gpu = ischar(G)", "output": "tf_gpu = logical(0)", "keywords": ["ischar", "character arrays", "type checking", "char", "logical predicate", "gpuArray"], "suggestedPath": "/ischar-5.m" }, { "id": "isempty:1", "builtinKey": "isempty", "builtinTitle": "isempty", "builtinSlug": "isempty", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Checking if a matrix has any elements", "summary": "Return true when an array has zero elements, matching MATLAB semantics.", "code": "A = zeros(0, 3);\ntf = isempty(A)", "output": "tf = logical(1)", "keywords": ["isempty", "empty array", "metadata query", "gpu", "logical"], "suggestedPath": "/isempty-1.m" }, { "id": "isempty:2", "builtinKey": "isempty", "builtinTitle": "isempty", "builtinSlug": "isempty", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Detecting an empty cell array", "summary": "Return true when an array has zero elements, matching MATLAB semantics.", "code": "C = cell(0, 4);\ntf = isempty(C)", "output": "tf = logical(1)", "keywords": ["isempty", "empty array", "metadata query", "gpu", "logical"], "suggestedPath": "/isempty-2.m" }, { "id": "isempty:3", "builtinKey": "isempty", "builtinTitle": "isempty", "builtinSlug": "isempty", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Using `isempty` on a GPU-resident tensor", "summary": "Return true when an array has zero elements, matching MATLAB semantics.", "code": "G = gpuArray(zeros(5, 0));\ntf = isempty(G)", "output": "tf = logical(1)", "keywords": ["isempty", "empty array", "metadata query", "gpu", "logical"], "suggestedPath": "/isempty-3.m" }, { "id": "isempty:4", "builtinKey": "isempty", "builtinTitle": "isempty", "builtinSlug": "isempty", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Distinguishing char arrays from string scalars", "summary": "Return true when an array has zero elements, matching MATLAB semantics.", "code": "chars = '';\ntf_chars = isempty(chars);\nstr = \"\";\ntf_str = isempty(str)", "output": "tf_chars = logical(1)\ntf_str = logical(0)", "keywords": ["isempty", "empty array", "metadata query", "gpu", "logical"], "suggestedPath": "/isempty-4.m" }, { "id": "isempty:5", "builtinKey": "isempty", "builtinTitle": "isempty", "builtinSlug": "isempty", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Confirming that scalars are never empty", "summary": "Return true when an array has zero elements, matching MATLAB semantics.", "code": "value = 42;\ntf = isempty(value)", "output": "tf = logical(0)", "keywords": ["isempty", "empty array", "metadata query", "gpu", "logical"], "suggestedPath": "/isempty-5.m" }, { "id": "isempty:6", "builtinKey": "isempty", "builtinTitle": "isempty", "builtinSlug": "isempty", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Inspecting empty string arrays", "summary": "Return true when an array has zero elements, matching MATLAB semantics.", "code": "S = strings(0, 2);\ntf = isempty(S)", "output": "tf = logical(1)", "keywords": ["isempty", "empty array", "metadata query", "gpu", "logical"], "suggestedPath": "/isempty-6.m" }, { "id": "isequal:1", "builtinKey": "isequal", "builtinTitle": "isequal", "builtinSlug": "isequal", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Comparing two identical scalars", "summary": "Test arrays for equality in size, class, and content.", "code": "isequal(5, 5)", "output": "ans = logical\n 1", "keywords": ["isequal", "equality", "comparison", "logical", "array comparison"], "suggestedPath": "/isequal-1.m" }, { "id": "isequal:2", "builtinKey": "isequal", "builtinTitle": "isequal", "builtinSlug": "isequal", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Comparing two different scalars", "summary": "Test arrays for equality in size, class, and content.", "code": "isequal(5, 6)", "output": "ans = logical\n 0", "keywords": ["isequal", "equality", "comparison", "logical", "array comparison"], "suggestedPath": "/isequal-2.m" }, { "id": "isequal:3", "builtinKey": "isequal", "builtinTitle": "isequal", "builtinSlug": "isequal", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Comparing identical matrices", "summary": "Test arrays for equality in size, class, and content.", "code": "A = [1 2; 3 4];\nB = [1 2; 3 4];\nisequal(A, B)", "output": "ans = logical\n 1", "keywords": ["isequal", "equality", "comparison", "logical", "array comparison"], "suggestedPath": "/isequal-3.m" }, { "id": "isequal:4", "builtinKey": "isequal", "builtinTitle": "isequal", "builtinSlug": "isequal", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Comparing matrices with different shapes", "summary": "Test arrays for equality in size, class, and content.", "code": "A = [1 2 3];\nB = [1; 2; 3];\nisequal(A, B)", "output": "ans = logical\n 0", "keywords": ["isequal", "equality", "comparison", "logical", "array comparison"], "suggestedPath": "/isequal-4.m" }, { "id": "isequal:5", "builtinKey": "isequal", "builtinTitle": "isequal", "builtinSlug": "isequal", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Comparing multiple arrays at once", "summary": "Test arrays for equality in size, class, and content.", "code": "isequal([1 2], [1 2], [1 2])", "output": "ans = logical\n 1", "keywords": ["isequal", "equality", "comparison", "logical", "array comparison"], "suggestedPath": "/isequal-5.m" }, { "id": "isequal:6", "builtinKey": "isequal", "builtinTitle": "isequal", "builtinSlug": "isequal", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "NaN values are not equal", "summary": "Test arrays for equality in size, class, and content.", "code": "isequal(NaN, NaN)", "output": "ans = logical\n 0", "keywords": ["isequal", "equality", "comparison", "logical", "array comparison"], "suggestedPath": "/isequal-6.m" }, { "id": "isequal:7", "builtinKey": "isequal", "builtinTitle": "isequal", "builtinSlug": "isequal", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Verifying that every cell starts with `[]`", "summary": "Test arrays for equality in size, class, and content.", "code": "C = cell(2, 2);\nisequal(C{1,1}, [], C{2,2}, [])", "output": "ans = logical\n 1", "keywords": ["isequal", "equality", "comparison", "logical", "array comparison"], "suggestedPath": "/isequal-7.m" }, { "id": "isfield:1", "builtinKey": "isfield", "builtinTitle": "isfield", "builtinSlug": "isfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Checking whether a struct defines a single field", "summary": "Test whether a struct or struct array defines specific field names.", "code": "s = struct(\"name\", \"Ada\", \"score\", 42);\nhasScore = isfield(s, \"score\")", "output": "hasScore =\n logical\n 1", "keywords": ["isfield", "struct", "struct array", "field existence", "metadata"], "suggestedPath": "/isfield-1.m" }, { "id": "isfield:2", "builtinKey": "isfield", "builtinTitle": "isfield", "builtinSlug": "isfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Testing multiple field names at once", "summary": "Test whether a struct or struct array defines specific field names.", "code": "s = struct(\"name\", \"Ada\", \"score\", 42);\nnames = {\"name\", \"department\"; \"score\", \"email\"};\nmask = isfield(s, names)", "output": "mask =\n 2×2 logical array\n 1 0\n 1 0", "keywords": ["isfield", "struct", "struct array", "field existence", "metadata"], "suggestedPath": "/isfield-2.m" }, { "id": "isfield:3", "builtinKey": "isfield", "builtinTitle": "isfield", "builtinSlug": "isfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Inspecting a struct array that shares a common schema", "summary": "Test whether a struct or struct array defines specific field names.", "code": "people = struct(\"name\", {\"Ada\", \"Grace\"}, \"id\", {101, 102});\nidxMask = isfield(people, [\"id\", \"department\"])", "output": "idxMask =\n 1×2 logical array\n 1 0", "keywords": ["isfield", "struct", "struct array", "field existence", "metadata"], "suggestedPath": "/isfield-3.m" }, { "id": "isfield:4", "builtinKey": "isfield", "builtinTitle": "isfield", "builtinSlug": "isfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Using `isfield` before accessing optional configuration fields", "summary": "Test whether a struct or struct array defines specific field names.", "code": "cfg = struct(\"mode\", \"fast\");\nif ~isfield(cfg, \"rate\")\n cfg.rate = 60;\nend", "keywords": ["isfield", "struct", "struct array", "field existence", "metadata"], "suggestedPath": "/isfield-4.m" }, { "id": "isfield:5", "builtinKey": "isfield", "builtinTitle": "isfield", "builtinSlug": "isfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Mixing string scalars and character vectors in a cell array", "summary": "Test whether a struct or struct array defines specific field names.", "code": "opts = struct(\"Solver\", \"cg\", \"MaxIter\", 200);\nqueries = {\"Solver\", \"Tolerances\"; \"MaxIter\", \"History\"};\npresent = isfield(opts, queries)", "keywords": ["isfield", "struct", "struct array", "field existence", "metadata"], "suggestedPath": "/isfield-5.m" }, { "id": "isfield:6", "builtinKey": "isfield", "builtinTitle": "isfield", "builtinSlug": "isfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Behaviour when the input is not a struct", "summary": "Test whether a struct or struct array defines specific field names.", "code": "value = 42;\ntf = isfield(value, \"anything\")", "output": "tf =\n logical\n 0", "keywords": ["isfield", "struct", "struct array", "field existence", "metadata"], "suggestedPath": "/isfield-6.m" }, { "id": "isfinite:1", "builtinKey": "isfinite", "builtinTitle": "isfinite", "builtinSlug": "isfinite", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Check if a scalar is finite", "summary": "Return a logical mask indicating which elements of the input are finite.", "code": "result = isfinite(42)", "output": "result =\n 1", "keywords": ["isfinite", "finite mask", "numeric predicate", "gpuArray isfinite", "MATLAB isfinite"], "suggestedPath": "/isfinite-1.m" }, { "id": "isfinite:2", "builtinKey": "isfinite", "builtinTitle": "isfinite", "builtinSlug": "isfinite", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Create a finite mask for a numeric matrix", "summary": "Return a logical mask indicating which elements of the input are finite.", "code": "A = [1 NaN; Inf 4];\nmask = isfinite(A)", "output": "mask =\n 2×2 logical array\n 1 0\n 0 1", "keywords": ["isfinite", "finite mask", "numeric predicate", "gpuArray isfinite", "MATLAB isfinite"], "suggestedPath": "/isfinite-2.m" }, { "id": "isfinite:3", "builtinKey": "isfinite", "builtinTitle": "isfinite", "builtinSlug": "isfinite", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Identify finite components in a complex array", "summary": "Return a logical mask indicating which elements of the input are finite.", "code": "Z = [1+2i Inf+0i 3+NaNi];\nmask = isfinite(Z)", "output": "mask =\n 1×3 logical array\n 1 0 0", "keywords": ["isfinite", "finite mask", "numeric predicate", "gpuArray isfinite", "MATLAB isfinite"], "suggestedPath": "/isfinite-3.m" }, { "id": "isfinite:4", "builtinKey": "isfinite", "builtinTitle": "isfinite", "builtinSlug": "isfinite", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Apply `isfinite` to character data", "summary": "Return a logical mask indicating which elements of the input are finite.", "code": "chars = ['R' 'u' 'n'];\nmask = isfinite(chars)", "output": "mask =\n 1×3 logical array\n 1 1 1", "keywords": ["isfinite", "finite mask", "numeric predicate", "gpuArray isfinite", "MATLAB isfinite"], "suggestedPath": "/isfinite-4.m" }, { "id": "isfinite:5", "builtinKey": "isfinite", "builtinTitle": "isfinite", "builtinSlug": "isfinite", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Run `isfinite` directly on the GPU", "summary": "Return a logical mask indicating which elements of the input are finite.", "code": "G = gpuArray([1 -Inf 5]);\nmask_gpu = isfinite(G);\nmask = gather(mask_gpu)", "output": "mask =\n 1×3 logical array\n 1 0 1", "keywords": ["isfinite", "finite mask", "numeric predicate", "gpuArray isfinite", "MATLAB isfinite"], "suggestedPath": "/isfinite-5.m" }, { "id": "isgpuarray:1", "builtinKey": "isgpuarray", "builtinTitle": "isgpuarray", "builtinSlug": "isgpuarray", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Checking a gpuArray handle", "summary": "Return true when a value is stored as a gpuArray handle.", "code": "G = gpuArray(reshape(1:12, [3 4]));\ntf = isgpuarray(G)", "output": "tf =\n 1", "keywords": ["isgpuarray", "gpuarray predicate", "gpu type check", "logical test", "MATLAB isgpuarray"], "suggestedPath": "/isgpuarray-1.m" }, { "id": "isgpuarray:2", "builtinKey": "isgpuarray", "builtinTitle": "isgpuarray", "builtinSlug": "isgpuarray", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Host arrays are not gpuArray values", "summary": "Return true when a value is stored as a gpuArray handle.", "code": "A = [1 2 3];\ntf = isgpuarray(A)", "output": "tf =\n 0", "keywords": ["isgpuarray", "gpuarray predicate", "gpu type check", "logical test", "MATLAB isgpuarray"], "suggestedPath": "/isgpuarray-2.m" }, { "id": "ishermitian:1", "builtinKey": "ishermitian", "builtinTitle": "ishermitian", "builtinSlug": "ishermitian", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "How to check if a complex matrix is Hermitian", "summary": "Determine whether a matrix is Hermitian or skew-Hermitian.", "code": "A = [2 1-3i; 1+3i 5];\ntf = ishermitian(A)", "output": "tf = logical\n 1", "keywords": ["ishermitian", "hermitian", "skew-hermitian", "matrix structure", "gpu"], "suggestedPath": "/ishermitian-1.m" }, { "id": "ishermitian:2", "builtinKey": "ishermitian", "builtinTitle": "ishermitian", "builtinSlug": "ishermitian", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "How to determine that a real matrix is Hermitian", "summary": "Determine whether a matrix is Hermitian or skew-Hermitian.", "code": "B = [4 2 2; 2 7 3; 2 3 9];\ntf = ishermitian(B)", "output": "tf = logical\n 1", "keywords": ["ishermitian", "hermitian", "skew-hermitian", "matrix structure", "gpu"], "suggestedPath": "/ishermitian-2.m" }, { "id": "ishermitian:3", "builtinKey": "ishermitian", "builtinTitle": "ishermitian", "builtinSlug": "ishermitian", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "How to spot a matrix that is not Hermitian", "summary": "Determine whether a matrix is Hermitian or skew-Hermitian.", "code": "C = [1 2+i; 2-i 1+0.02i];\ntf = ishermitian(C)", "output": "tf = logical\n 0", "keywords": ["ishermitian", "hermitian", "skew-hermitian", "matrix structure", "gpu"], "suggestedPath": "/ishermitian-3.m" }, { "id": "ishermitian:4", "builtinKey": "ishermitian", "builtinTitle": "ishermitian", "builtinSlug": "ishermitian", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "How to allow numerical noise with a tolerance", "summary": "Determine whether a matrix is Hermitian or skew-Hermitian.", "code": "D = [1 1+1e-12; 1-1e-12 1];\ntf = ishermitian(D, 1e-9)", "output": "tf = logical\n 1", "keywords": ["ishermitian", "hermitian", "skew-hermitian", "matrix structure", "gpu"], "suggestedPath": "/ishermitian-4.m" }, { "id": "ishermitian:5", "builtinKey": "ishermitian", "builtinTitle": "ishermitian", "builtinSlug": "ishermitian", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "How to test for skew-Hermitian structure", "summary": "Determine whether a matrix is Hermitian or skew-Hermitian.", "code": "S = [0 2+3i; -2+3i 0];\ntf = ishermitian(S, 'skew')", "output": "tf = logical\n 1", "keywords": ["ishermitian", "hermitian", "skew-hermitian", "matrix structure", "gpu"], "suggestedPath": "/ishermitian-5.m" }, { "id": "ishermitian:6", "builtinKey": "ishermitian", "builtinTitle": "ishermitian", "builtinSlug": "ishermitian", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "How to inspect a GPU-resident matrix", "summary": "Determine whether a matrix is Hermitian or skew-Hermitian.", "code": "G = gpuArray([3 4-2i; 4+2i 6]);\ntf = ishermitian(G)", "output": "tf = logical\n 1", "keywords": ["ishermitian", "hermitian", "skew-hermitian", "matrix structure", "gpu"], "suggestedPath": "/ishermitian-6.m" }, { "id": "isinf:1", "builtinKey": "isinf", "builtinTitle": "isinf", "builtinSlug": "isinf", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Checking if a scalar is infinite", "summary": "Return a logical mask indicating which elements of the input are ±Inf.", "code": "result = isinf(1/0)", "output": "result =\n 1", "keywords": ["isinf", "infinite mask", "numeric predicate", "gpuArray isinf", "MATLAB isinf"], "suggestedPath": "/isinf-1.m" }, { "id": "isinf:2", "builtinKey": "isinf", "builtinTitle": "isinf", "builtinSlug": "isinf", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Detecting infinities after division by zero", "summary": "Return a logical mask indicating which elements of the input are ±Inf.", "code": "A = [1 0; 2 0];\nquot = 1 ./ A;\nmask = isinf(quot)", "output": "mask =\n 2×2 logical array\n 0 1\n 0 1", "keywords": ["isinf", "infinite mask", "numeric predicate", "gpuArray isinf", "MATLAB isinf"], "suggestedPath": "/isinf-2.m" }, { "id": "isinf:3", "builtinKey": "isinf", "builtinTitle": "isinf", "builtinSlug": "isinf", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Flagging infinite components of a complex array", "summary": "Return a logical mask indicating which elements of the input are ±Inf.", "code": "Z = [Inf+0i 1-Inf*1i 2+3i];\nmask = isinf(Z)", "output": "mask =\n 1×3 logical array\n 1 1 0", "keywords": ["isinf", "infinite mask", "numeric predicate", "gpuArray isinf", "MATLAB isinf"], "suggestedPath": "/isinf-3.m" }, { "id": "isinf:4", "builtinKey": "isinf", "builtinTitle": "isinf", "builtinSlug": "isinf", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Applying `isinf` to character data", "summary": "Return a logical mask indicating which elements of the input are ±Inf.", "code": "chars = ['R' 'u' 'n'];\nmask = isinf(chars)", "output": "mask =\n 1×3 logical array\n 0 0 0", "keywords": ["isinf", "infinite mask", "numeric predicate", "gpuArray isinf", "MATLAB isinf"], "suggestedPath": "/isinf-4.m" }, { "id": "isinf:5", "builtinKey": "isinf", "builtinTitle": "isinf", "builtinSlug": "isinf", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Running `isinf` directly on the GPU", "summary": "Return a logical mask indicating which elements of the input are ±Inf.", "code": "G = gpuArray([1 -Inf Inf]);\nmask_gpu = isinf(G);\nmask = gather(mask_gpu)", "output": "mask =\n 1×3 logical array\n 0 1 1", "keywords": ["isinf", "infinite mask", "numeric predicate", "gpuArray isinf", "MATLAB isinf"], "suggestedPath": "/isinf-5.m" }, { "id": "islogical:1", "builtinKey": "islogical", "builtinTitle": "islogical", "builtinSlug": "islogical", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Checking a logical scalar", "summary": "Return true when a value is stored as MATLAB logical data (scalar or array).", "code": "flag = islogical(true)", "output": "flag =\n 1", "keywords": ["islogical", "logical type", "boolean predicate", "gpuArray logical", "MATLAB islogical"], "suggestedPath": "/islogical-1.m" }, { "id": "islogical:2", "builtinKey": "islogical", "builtinTitle": "islogical", "builtinSlug": "islogical", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Verifying a logical array constructed with `logical`", "summary": "Return true when a value is stored as MATLAB logical data (scalar or array).", "code": "mask = logical([1 0 1 0]);\nis_mask_logical = islogical(mask)", "output": "is_mask_logical =\n 1", "keywords": ["islogical", "logical type", "boolean predicate", "gpuArray logical", "MATLAB islogical"], "suggestedPath": "/islogical-2.m" }, { "id": "islogical:3", "builtinKey": "islogical", "builtinTitle": "islogical", "builtinSlug": "islogical", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Numeric arrays are not logical", "summary": "Return true when a value is stored as MATLAB logical data (scalar or array).", "code": "values = [1 2 3];\nis_logical = islogical(values)", "output": "is_logical =\n 0", "keywords": ["islogical", "logical type", "boolean predicate", "gpuArray logical", "MATLAB islogical"], "suggestedPath": "/islogical-3.m" }, { "id": "islogical:4", "builtinKey": "islogical", "builtinTitle": "islogical", "builtinSlug": "islogical", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Character arrays return false", "summary": "Return true when a value is stored as MATLAB logical data (scalar or array).", "code": "chars = ['R' 'u' 'n'];\nis_char_logical = islogical(chars)", "output": "is_char_logical =\n 0", "keywords": ["islogical", "logical type", "boolean predicate", "gpuArray logical", "MATLAB islogical"], "suggestedPath": "/islogical-4.m" }, { "id": "islogical:5", "builtinKey": "islogical", "builtinTitle": "islogical", "builtinSlug": "islogical", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "gpuArray comparisons yield logical gpuArrays", "summary": "Return true when a value is stored as MATLAB logical data (scalar or array).", "code": "G = gpuArray([1 2 3]);\nmask = G > 1;\ntf = islogical(mask)", "output": "tf =\n 1", "keywords": ["islogical", "logical type", "boolean predicate", "gpuArray logical", "MATLAB islogical"], "suggestedPath": "/islogical-5.m" }, { "id": "islogical:6", "builtinKey": "islogical", "builtinTitle": "islogical", "builtinSlug": "islogical", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Containers and structs are not logical", "summary": "Return true when a value is stored as MATLAB logical data (scalar or array).", "code": "items = {true, 1};\nperson = struct(\"name\", \"Ada\");\ntf_cell = islogical(items);\ntf_struct = islogical(person)", "output": "tf_cell =\n 0\n\ntf_struct =\n 0", "keywords": ["islogical", "logical type", "boolean predicate", "gpuArray logical", "MATLAB islogical"], "suggestedPath": "/islogical-6.m" }, { "id": "ismatrix:1", "builtinKey": "ismatrix", "builtinTitle": "ismatrix", "builtinSlug": "ismatrix", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Confirming that a 2-D matrix returns true", "summary": "Return true when an array has at most two dimensions (m-by-n, including vectors and scalars).", "code": "tf = ismatrix([1 2 3; 4 5 6])", "output": "tf = logical(1)", "keywords": ["ismatrix", "matrix detection", "metadata query", "logical", "gpu"], "suggestedPath": "/ismatrix-1.m" }, { "id": "ismatrix:2", "builtinKey": "ismatrix", "builtinTitle": "ismatrix", "builtinSlug": "ismatrix", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Showing that vectors and scalars count as matrices", "summary": "Return true when an array has at most two dimensions (m-by-n, including vectors and scalars).", "code": "scalar_tf = ismatrix(42);\nrow_tf = ismatrix(1:5);\ncol_tf = ismatrix((1:5)')", "output": "scalar_tf = logical(1)\nrow_tf = logical(1)\ncol_tf = logical(1)", "keywords": ["ismatrix", "matrix detection", "metadata query", "logical", "gpu"], "suggestedPath": "/ismatrix-2.m" }, { "id": "ismatrix:3", "builtinKey": "ismatrix", "builtinTitle": "ismatrix", "builtinSlug": "ismatrix", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Detecting that higher-dimensional arrays are not matrices", "summary": "Return true when an array has at most two dimensions (m-by-n, including vectors and scalars).", "code": "tf = ismatrix(ones(2,2,3))", "output": "tf = logical(0)", "keywords": ["ismatrix", "matrix detection", "metadata query", "logical", "gpu"], "suggestedPath": "/ismatrix-3.m" }, { "id": "ismatrix:4", "builtinKey": "ismatrix", "builtinTitle": "ismatrix", "builtinSlug": "ismatrix", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Working with empty arrays", "summary": "Return true when an array has at most two dimensions (m-by-n, including vectors and scalars).", "code": "tf_empty = ismatrix([]);\ntf_row0 = ismatrix(zeros(1,0));\ntf_col0 = ismatrix(zeros(0,1));\ntf_3d_empty = ismatrix(zeros(0,0,3))", "output": "tf_empty = logical(1)\ntf_row0 = logical(1)\ntf_col0 = logical(1)\ntf_3d_empty = logical(0)", "keywords": ["ismatrix", "matrix detection", "metadata query", "logical", "gpu"], "suggestedPath": "/ismatrix-4.m" }, { "id": "ismatrix:5", "builtinKey": "ismatrix", "builtinTitle": "ismatrix", "builtinSlug": "ismatrix", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Character and string arrays follow their visible dimensions", "summary": "Return true when an array has at most two dimensions (m-by-n, including vectors and scalars).", "code": "tf_char = ismatrix('RunMat');\ntf_string = ismatrix([\"a\",\"b\",\"c\"])", "output": "tf_char = logical(1)\ntf_string = logical(1)", "keywords": ["ismatrix", "matrix detection", "metadata query", "logical", "gpu"], "suggestedPath": "/ismatrix-5.m" }, { "id": "ismatrix:6", "builtinKey": "ismatrix", "builtinTitle": "ismatrix", "builtinSlug": "ismatrix", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Cell and struct arrays respect their grid layout", "summary": "Return true when an array has at most two dimensions (m-by-n, including vectors and scalars).", "code": "C = {1, 2; 3, 4};\nS = repmat(struct(\"field\", 1), 1, 3, 1);\ntf_cell = ismatrix(C);\ntf_struct = ismatrix(S)", "output": "tf_cell = logical(1)\ntf_struct = logical(0)", "keywords": ["ismatrix", "matrix detection", "metadata query", "logical", "gpu"], "suggestedPath": "/ismatrix-6.m" }, { "id": "ismatrix:7", "builtinKey": "ismatrix", "builtinTitle": "ismatrix", "builtinSlug": "ismatrix", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Inspecting GPU arrays without explicit gathers", "summary": "Return true when an array has at most two dimensions (m-by-n, including vectors and scalars).", "code": "G = gpuArray(rand(4,4));\ntf_gpu = ismatrix(G)", "output": "tf_gpu = logical(1)", "keywords": ["ismatrix", "matrix detection", "metadata query", "logical", "gpu"], "suggestedPath": "/ismatrix-7.m" }, { "id": "ismember:1", "builtinKey": "ismember", "builtinTitle": "ismember", "builtinSlug": "ismember", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Checking membership of numeric vectors", "summary": "Identify array elements or rows that appear in another array while returning first-match indices.", "code": "A = [5 7 2 7];\nB = [7 9 5];\n[tf, loc] = ismember(A, B)", "output": "tf =\n 1 1 0 1\nloc =\n 3 1 0 1", "keywords": ["ismember", "membership", "set", "rows", "indices", "gpu"], "suggestedPath": "/ismember-1.m" }, { "id": "ismember:2", "builtinKey": "ismember", "builtinTitle": "ismember", "builtinSlug": "ismember", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Finding row membership in a matrix", "summary": "Identify array elements or rows that appear in another array while returning first-match indices.", "code": "A = [1 2; 3 4; 1 2];\nB = [3 4; 5 6; 1 2];\n[tf, loc] = ismember(A, B, 'rows')", "output": "tf =\n 1\n 1\n 1\nloc =\n 3\n 1\n 3", "keywords": ["ismember", "membership", "set", "rows", "indices", "gpu"], "suggestedPath": "/ismember-2.m" }, { "id": "ismember:3", "builtinKey": "ismember", "builtinTitle": "ismember", "builtinSlug": "ismember", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Locating values and retrieving the index", "summary": "Identify array elements or rows that appear in another array while returning first-match indices.", "code": "values = [10 20 30];\nset = [30 10 40];\n[tf, loc] = ismember(values, set)", "output": "tf =\n 1 0 1\nloc =\n 2 0 1", "keywords": ["ismember", "membership", "set", "rows", "indices", "gpu"], "suggestedPath": "/ismember-3.m" }, { "id": "ismember:4", "builtinKey": "ismember", "builtinTitle": "ismember", "builtinSlug": "ismember", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Testing characters against a set", "summary": "Identify array elements or rows that appear in another array while returning first-match indices.", "code": "chars = ['r','u'; 'n','m'];\nset = ['m','a'; 'r','u'];\n[tf, loc] = ismember(chars, set)", "output": "tf =\n 1 1\n 0 0\nloc =\n 3 1\n 0 0", "keywords": ["ismember", "membership", "set", "rows", "indices", "gpu"], "suggestedPath": "/ismember-4.m" }, { "id": "ismember:5", "builtinKey": "ismember", "builtinTitle": "ismember", "builtinSlug": "ismember", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Working with string arrays", "summary": "Identify array elements or rows that appear in another array while returning first-match indices.", "code": "A = [\"apple\" \"pear\" \"banana\"];\nB = [\"pear\" \"orange\" \"apple\"];\n[tf, loc] = ismember(A, B)", "output": "tf =\n 1×3 logical array\n 1 1 0\nloc =\n 1×3 double\n 3 1 0", "keywords": ["ismember", "membership", "set", "rows", "indices", "gpu"], "suggestedPath": "/ismember-5.m" }, { "id": "ismember:6", "builtinKey": "ismember", "builtinTitle": "ismember", "builtinSlug": "ismember", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Using `ismember` with `gpuArray` inputs", "summary": "Identify array elements or rows that appear in another array while returning first-match indices.", "code": "G = gpuArray([1 4 2 4]);\nH = gpuArray([4 5]);\n[tf, loc] = ismember(G, H)", "output": "tf =\n 0 1 0 1\nloc =\n 0 1 0 1", "keywords": ["ismember", "membership", "set", "rows", "indices", "gpu"], "suggestedPath": "/ismember-6.m" }, { "id": "isnan:1", "builtinKey": "isnan", "builtinTitle": "isnan", "builtinSlug": "isnan", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Check if a scalar is NaN", "summary": "Return a logical mask indicating which elements of the input are NaN.", "code": "result = isnan(NaN)", "output": "result =\n 1", "keywords": ["isnan", "nan mask", "numeric predicate", "gpuArray isnan", "MATLAB isnan"], "suggestedPath": "/isnan-1.m" }, { "id": "isnan:2", "builtinKey": "isnan", "builtinTitle": "isnan", "builtinSlug": "isnan", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Create a NaN mask for a numeric matrix", "summary": "Return a logical mask indicating which elements of the input are NaN.", "code": "A = [1 NaN 2; 3 4 NaN];\nmask = isnan(A)", "output": "mask =\n 2×3 logical array\n 0 1 0\n 0 0 1", "keywords": ["isnan", "nan mask", "numeric predicate", "gpuArray isnan", "MATLAB isnan"], "suggestedPath": "/isnan-2.m" }, { "id": "isnan:3", "builtinKey": "isnan", "builtinTitle": "isnan", "builtinSlug": "isnan", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Identify NaNs inside a complex array", "summary": "Return a logical mask indicating which elements of the input are NaN.", "code": "Z = [1+2i NaN+0i 3+NaNi];\nmask = isnan(Z)", "output": "mask =\n 1×3 logical array\n 0 1 1", "keywords": ["isnan", "nan mask", "numeric predicate", "gpuArray isnan", "MATLAB isnan"], "suggestedPath": "/isnan-3.m" }, { "id": "isnan:4", "builtinKey": "isnan", "builtinTitle": "isnan", "builtinSlug": "isnan", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Use `isnan` with character data", "summary": "Return a logical mask indicating which elements of the input are NaN.", "code": "chars = ['R' 'u' 'n'];\nmask = isnan(chars)", "output": "mask =\n 1×3 logical array\n 0 0 0", "keywords": ["isnan", "nan mask", "numeric predicate", "gpuArray isnan", "MATLAB isnan"], "suggestedPath": "/isnan-4.m" }, { "id": "isnan:5", "builtinKey": "isnan", "builtinTitle": "isnan", "builtinSlug": "isnan", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Run `isnan` directly on the GPU", "summary": "Return a logical mask indicating which elements of the input are NaN.", "code": "G = gpuArray([1 0/0 3]);\nmask_gpu = isnan(G);\nmask = gather(mask_gpu)", "output": "mask =\n 1×3 logical array\n 0 1 0", "keywords": ["isnan", "nan mask", "numeric predicate", "gpuArray isnan", "MATLAB isnan"], "suggestedPath": "/isnan-5.m" }, { "id": "isnumeric:1", "builtinKey": "isnumeric", "builtinTitle": "isnumeric", "builtinSlug": "isnumeric", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Checking if a scalar double is numeric", "summary": "Return true when a value is stored as numeric data (real or complex).", "code": "tf = isnumeric(42)", "output": "tf =\n 1", "keywords": ["isnumeric", "numeric type", "type predicate", "gpuArray isnumeric", "MATLAB isnumeric"], "suggestedPath": "/isnumeric-1.m" }, { "id": "isnumeric:2", "builtinKey": "isnumeric", "builtinTitle": "isnumeric", "builtinSlug": "isnumeric", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Detecting numeric matrices", "summary": "Return true when a value is stored as numeric data (real or complex).", "code": "A = [1 2 3; 4 5 6];\ntf = isnumeric(A)", "output": "tf =\n 1", "keywords": ["isnumeric", "numeric type", "type predicate", "gpuArray isnumeric", "MATLAB isnumeric"], "suggestedPath": "/isnumeric-2.m" }, { "id": "isnumeric:3", "builtinKey": "isnumeric", "builtinTitle": "isnumeric", "builtinSlug": "isnumeric", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Testing complex numbers for numeric storage", "summary": "Return true when a value is stored as numeric data (real or complex).", "code": "z = 1 + 2i;\ntf = isnumeric(z)", "output": "tf =\n 1", "keywords": ["isnumeric", "numeric type", "type predicate", "gpuArray isnumeric", "MATLAB isnumeric"], "suggestedPath": "/isnumeric-3.m" }, { "id": "isnumeric:4", "builtinKey": "isnumeric", "builtinTitle": "isnumeric", "builtinSlug": "isnumeric", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Logical arrays are not numeric", "summary": "Return true when a value is stored as numeric data (real or complex).", "code": "mask = logical([1 0 1]);\ntf = isnumeric(mask)", "output": "tf =\n 0", "keywords": ["isnumeric", "numeric type", "type predicate", "gpuArray isnumeric", "MATLAB isnumeric"], "suggestedPath": "/isnumeric-4.m" }, { "id": "isnumeric:5", "builtinKey": "isnumeric", "builtinTitle": "isnumeric", "builtinSlug": "isnumeric", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Character vectors and strings return false", "summary": "Return true when a value is stored as numeric data (real or complex).", "code": "chars = ['R' 'u' 'n'];\nname = \"RunMat\";\ntf_chars = isnumeric(chars);\ntf_string = isnumeric(name)", "output": "tf_chars =\n 0\n\ntf_string =\n 0", "keywords": ["isnumeric", "numeric type", "type predicate", "gpuArray isnumeric", "MATLAB isnumeric"], "suggestedPath": "/isnumeric-5.m" }, { "id": "isnumeric:6", "builtinKey": "isnumeric", "builtinTitle": "isnumeric", "builtinSlug": "isnumeric", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Evaluating `gpuArray` inputs", "summary": "Return true when a value is stored as numeric data (real or complex).", "code": "G = gpuArray(rand(4));\nmask = G > 0.5;\ntf_numeric = isnumeric(G);\ntf_mask = isnumeric(mask)", "output": "tf_numeric =\n 1\n\ntf_mask =\n 0", "keywords": ["isnumeric", "numeric type", "type predicate", "gpuArray isnumeric", "MATLAB isnumeric"], "suggestedPath": "/isnumeric-6.m" }, { "id": "isreal:1", "builtinKey": "isreal", "builtinTitle": "isreal", "builtinSlug": "isreal", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Checking if a real-valued matrix is stored as real", "summary": "Return true when a value uses real storage without an imaginary component.", "code": "A = [7 3 2; 2 1 12; 52 108 78];\ntf = isreal(A)", "output": "tf =\n 1", "keywords": ["isreal", "complex storage", "real array", "gpuArray isreal", "MATLAB isreal"], "suggestedPath": "/isreal-1.m" }, { "id": "isreal:2", "builtinKey": "isreal", "builtinTitle": "isreal", "builtinSlug": "isreal", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Detecting complex entries inside an array", "summary": "Return true when a value uses real storage without an imaginary component.", "code": "B = [1 3+4i 2; 2i 1 12];\ntf = isreal(B)", "output": "tf =\n 0", "keywords": ["isreal", "complex storage", "real array", "gpuArray isreal", "MATLAB isreal"], "suggestedPath": "/isreal-2.m" }, { "id": "isreal:3", "builtinKey": "isreal", "builtinTitle": "isreal", "builtinSlug": "isreal", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Complex storage with zero-valued imaginary parts still reports false", "summary": "Return true when a value uses real storage without an imaginary component.", "code": "C = complex(12); % Stored as complex double with 0 imaginary part\ntf = isreal(C)", "output": "tf =\n 0", "keywords": ["isreal", "complex storage", "real array", "gpuArray isreal", "MATLAB isreal"], "suggestedPath": "/isreal-3.m" }, { "id": "isreal:4", "builtinKey": "isreal", "builtinTitle": "isreal", "builtinSlug": "isreal", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Logical and character data are considered real", "summary": "Return true when a value uses real storage without an imaginary component.", "code": "mask = logical([1 0 1]);\nchars = ['R' 'u' 'n'];\ntf_mask = isreal(mask);\ntf_chars = isreal(chars)", "output": "tf_mask =\n 1\n\ntf_chars =\n 1", "keywords": ["isreal", "complex storage", "real array", "gpuArray isreal", "MATLAB isreal"], "suggestedPath": "/isreal-4.m" }, { "id": "isreal:5", "builtinKey": "isreal", "builtinTitle": "isreal", "builtinSlug": "isreal", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Strings, cells, and structs are never real", "summary": "Return true when a value uses real storage without an imaginary component.", "code": "txt = \"RunMat\";\nvec = {1, 2};\nperson = struct(\"name\", \"Ada\");\ntf_txt = isreal(txt);\ntf_vec = isreal(vec);\ntf_person = isreal(person)", "output": "tf_txt =\n 0\n\ntf_vec =\n 0\n\ntf_person =\n 0", "keywords": ["isreal", "complex storage", "real array", "gpuArray isreal", "MATLAB isreal"], "suggestedPath": "/isreal-5.m" }, { "id": "isreal:6", "builtinKey": "isreal", "builtinTitle": "isreal", "builtinSlug": "isreal", "category": "logical/tests", "categoryPath": ["logical", "tests"], "exampleTitle": "Querying `gpuArray` storage without gathering data", "summary": "Return true when a value uses real storage without an imaginary component.", "code": "G = gpuArray(rand(1024, 1024));\ntf_gpu = isreal(G)", "output": "tf_gpu =\n 1", "keywords": ["isreal", "complex storage", "real array", "gpuArray isreal", "MATLAB isreal"], "suggestedPath": "/isreal-6.m" }, { "id": "isscalar:1", "builtinKey": "isscalar", "builtinTitle": "isscalar", "builtinSlug": "isscalar", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Checking if a numeric value is scalar", "summary": "Return true when a value has exactly one element and unit dimensions.", "code": "tf = isscalar(42)", "output": "tf = logical(1)", "keywords": ["isscalar", "scalar", "metadata query", "gpu", "logical"], "suggestedPath": "/isscalar-1.m" }, { "id": "isscalar:2", "builtinKey": "isscalar", "builtinTitle": "isscalar", "builtinSlug": "isscalar", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Detecting that a row vector is not scalar", "summary": "Return true when a value has exactly one element and unit dimensions.", "code": "tf = isscalar([1 2 3])", "output": "tf = logical(0)", "keywords": ["isscalar", "scalar", "metadata query", "gpu", "logical"], "suggestedPath": "/isscalar-2.m" }, { "id": "isscalar:3", "builtinKey": "isscalar", "builtinTitle": "isscalar", "builtinSlug": "isscalar", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Verifying scalar status of string vs char arrays", "summary": "Return true when a value has exactly one element and unit dimensions.", "code": "tf_string = isscalar(\"hello\");\ntf_char = isscalar('h');\ntf_char_row = isscalar('runmat')", "output": "tf_string = logical(1)\ntf_char = logical(1)\ntf_char_row = logical(0)", "keywords": ["isscalar", "scalar", "metadata query", "gpu", "logical"], "suggestedPath": "/isscalar-3.m" }, { "id": "isscalar:4", "builtinKey": "isscalar", "builtinTitle": "isscalar", "builtinSlug": "isscalar", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Identifying that an empty array is not scalar", "summary": "Return true when a value has exactly one element and unit dimensions.", "code": "tf_empty = isscalar([])", "output": "tf_empty = logical(0)", "keywords": ["isscalar", "scalar", "metadata query", "gpu", "logical"], "suggestedPath": "/isscalar-4.m" }, { "id": "isscalar:5", "builtinKey": "isscalar", "builtinTitle": "isscalar", "builtinSlug": "isscalar", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Confirming that single-element cell arrays are scalar", "summary": "Return true when a value has exactly one element and unit dimensions.", "code": "C = {pi};\ntf_cell = isscalar(C)", "output": "tf_cell = logical(1)", "keywords": ["isscalar", "scalar", "metadata query", "gpu", "logical"], "suggestedPath": "/isscalar-5.m" }, { "id": "isscalar:6", "builtinKey": "isscalar", "builtinTitle": "isscalar", "builtinSlug": "isscalar", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Inspecting a GPU-resident tensor", "summary": "Return true when a value has exactly one element and unit dimensions.", "code": "G = gpuArray(ones(1,1));\ntf_gpu = isscalar(G)", "output": "tf_gpu = logical(1)", "keywords": ["isscalar", "scalar", "metadata query", "gpu", "logical"], "suggestedPath": "/isscalar-6.m" }, { "id": "issorted:1", "builtinKey": "issorted", "builtinTitle": "issorted", "builtinSlug": "issorted", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Checking an ascending vector", "summary": "Determine whether an array is already sorted along a dimension or across rows.", "code": "A = [5 12 33 39 78 90 95 107];\ntf = issorted(A)", "output": "tf =\n 1", "keywords": ["issorted", "sorted", "monotonic", "strictascend", "rows", "comparisonmethod", "missingplacement"], "suggestedPath": "/issorted-1.m" }, { "id": "issorted:2", "builtinKey": "issorted", "builtinTitle": "issorted", "builtinSlug": "issorted", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Verifying strict increase", "summary": "Determine whether an array is already sorted along a dimension or across rows.", "code": "B = [1 1 2 3];\ntf = issorted(B, 'strictascend')", "output": "tf =\n 0", "keywords": ["issorted", "sorted", "monotonic", "strictascend", "rows", "comparisonmethod", "missingplacement"], "suggestedPath": "/issorted-2.m" }, { "id": "issorted:3", "builtinKey": "issorted", "builtinTitle": "issorted", "builtinSlug": "issorted", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Using a specific dimension", "summary": "Determine whether an array is already sorted along a dimension or across rows.", "code": "C = [1 4 2; 3 6 5];\ntf = issorted(C, 2, 'descend')", "output": "tf =\n 0", "keywords": ["issorted", "sorted", "monotonic", "strictascend", "rows", "comparisonmethod", "missingplacement"], "suggestedPath": "/issorted-3.m" }, { "id": "issorted:4", "builtinKey": "issorted", "builtinTitle": "issorted", "builtinSlug": "issorted", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Allowing either ascending or descending order", "summary": "Determine whether an array is already sorted along a dimension or across rows.", "code": "D = [10 8 8 5 1];\ntf = issorted(D, 'monotonic')", "output": "tf =\n 1", "keywords": ["issorted", "sorted", "monotonic", "strictascend", "rows", "comparisonmethod", "missingplacement"], "suggestedPath": "/issorted-4.m" }, { "id": "issorted:5", "builtinKey": "issorted", "builtinTitle": "issorted", "builtinSlug": "issorted", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Controlling missing placements", "summary": "Determine whether an array is already sorted along a dimension or across rows.", "code": "E = [NaN NaN 4 7];\ntf = issorted(E, 'MissingPlacement', 'first')", "output": "tf =\n 0", "keywords": ["issorted", "sorted", "monotonic", "strictascend", "rows", "comparisonmethod", "missingplacement"], "suggestedPath": "/issorted-5.m" }, { "id": "issorted:6", "builtinKey": "issorted", "builtinTitle": "issorted", "builtinSlug": "issorted", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Comparing complex data by magnitude", "summary": "Determine whether an array is already sorted along a dimension or across rows.", "code": "Z = [1+1i, 2+3i, 4+0i];\ntf = issorted(Z, 'ComparisonMethod', 'abs')", "output": "tf =\n 1", "keywords": ["issorted", "sorted", "monotonic", "strictascend", "rows", "comparisonmethod", "missingplacement"], "suggestedPath": "/issorted-6.m" }, { "id": "issorted:7", "builtinKey": "issorted", "builtinTitle": "issorted", "builtinSlug": "issorted", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Checking row order", "summary": "Determine whether an array is already sorted along a dimension or across rows.", "code": "R = [1 2 3; 1 2 4; 2 0 1];\ntf = issorted(R, 'rows')", "output": "tf =\n 1", "keywords": ["issorted", "sorted", "monotonic", "strictascend", "rows", "comparisonmethod", "missingplacement"], "suggestedPath": "/issorted-7.m" }, { "id": "issorted:8", "builtinKey": "issorted", "builtinTitle": "issorted", "builtinSlug": "issorted", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Working with string arrays", "summary": "Determine whether an array is already sorted along a dimension or across rows.", "code": "str = [ \"apple\" \"banana\"; \"apple\" \"carrot\" ];\ntf = issorted(str, 2)", "output": "tf =\n 0", "keywords": ["issorted", "sorted", "monotonic", "strictascend", "rows", "comparisonmethod", "missingplacement"], "suggestedPath": "/issorted-8.m" }, { "id": "isstring:1", "builtinKey": "isstring", "builtinTitle": "isstring", "builtinSlug": "isstring", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Checking if a string scalar is recognised", "summary": "Return true when a value is a MATLAB string array (including string scalars).", "code": "tf = isstring(\"RunMat\")", "output": "tf = logical(1)", "keywords": ["isstring", "string array", "type checking", "string scalar", "logical predicate", "gpuArray"], "suggestedPath": "/isstring-1.m" }, { "id": "isstring:2", "builtinKey": "isstring", "builtinTitle": "isstring", "builtinSlug": "isstring", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Detecting string arrays with multiple elements", "summary": "Return true when a value is a MATLAB string array (including string scalars).", "code": "values = [\"alpha\", \"beta\", \"gamma\"];\ntf = isstring(values)", "output": "tf = logical(1)", "keywords": ["isstring", "string array", "type checking", "string scalar", "logical predicate", "gpuArray"], "suggestedPath": "/isstring-2.m" }, { "id": "isstring:3", "builtinKey": "isstring", "builtinTitle": "isstring", "builtinSlug": "isstring", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Distinguishing strings from character vectors", "summary": "Return true when a value is a MATLAB string array (including string scalars).", "code": "tf_string = isstring(\"hello\");\ntf_char = isstring('hello')", "output": "tf_string = logical(1)\ntf_char = logical(0)", "keywords": ["isstring", "string array", "type checking", "string scalar", "logical predicate", "gpuArray"], "suggestedPath": "/isstring-3.m" }, { "id": "isstring:4", "builtinKey": "isstring", "builtinTitle": "isstring", "builtinSlug": "isstring", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Confirming that empty string arrays are still strings", "summary": "Return true when a value is a MATLAB string array (including string scalars).", "code": "emptyStrs = strings(0, 2);\ntf = isstring(emptyStrs)", "output": "tf = logical(1)", "keywords": ["isstring", "string array", "type checking", "string scalar", "logical predicate", "gpuArray"], "suggestedPath": "/isstring-4.m" }, { "id": "isstring:5", "builtinKey": "isstring", "builtinTitle": "isstring", "builtinSlug": "isstring", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Recognising that numeric and logical arrays are not strings", "summary": "Return true when a value is a MATLAB string array (including string scalars).", "code": "numbers = [1 2 3];\nmask = true(1, 3);\ntf_numbers = isstring(numbers);\ntf_mask = isstring(mask)", "output": "tf_numbers = logical(0)\ntf_mask = logical(0)", "keywords": ["isstring", "string array", "type checking", "string scalar", "logical predicate", "gpuArray"], "suggestedPath": "/isstring-5.m" }, { "id": "isstring:6", "builtinKey": "isstring", "builtinTitle": "isstring", "builtinSlug": "isstring", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Validating cell arrays of character vectors", "summary": "Return true when a value is a MATLAB string array (including string scalars).", "code": "cells = {'a', 'b', 'c'};\ntf = isstring(cells)", "output": "tf = logical(0)", "keywords": ["isstring", "string array", "type checking", "string scalar", "logical predicate", "gpuArray"], "suggestedPath": "/isstring-6.m" }, { "id": "isstring:7", "builtinKey": "isstring", "builtinTitle": "isstring", "builtinSlug": "isstring", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Inspecting gpuArray inputs without transfers", "summary": "Return true when a value is a MATLAB string array (including string scalars).", "code": "G = gpuArray(ones(2, 2));\ntf = isstring(G)", "output": "tf = logical(0)", "keywords": ["isstring", "string array", "type checking", "string scalar", "logical predicate", "gpuArray"], "suggestedPath": "/isstring-7.m" }, { "id": "isstring:8", "builtinKey": "isstring", "builtinTitle": "isstring", "builtinSlug": "isstring", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Using `isstring` in argument validation", "summary": "Return true when a value is a MATLAB string array (including string scalars).", "code": "function greet(name)\n if ~isstring(name)\n error(\"Name must be provided as a string.\");\n end\n disp(\"Hello \" + name + \"!\");\nend\n\ngreet(\"RunMat\");\n% greet(42); % throws \"Name must be provided as a string.\"", "output": "Hello RunMat!", "keywords": ["isstring", "string array", "type checking", "string scalar", "logical predicate", "gpuArray"], "suggestedPath": "/isstring-8.m" }, { "id": "issymmetric:1", "builtinKey": "issymmetric", "builtinTitle": "issymmetric", "builtinSlug": "issymmetric", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Checking whether a matrix is symmetric", "summary": "Test whether a matrix is symmetric or skew-symmetric, optionally within a tolerance.", "code": "A = [2 1 1; 1 3 4; 1 4 5];\ntf = issymmetric(A)", "output": "tf = logical\n 1", "keywords": ["issymmetric", "symmetric matrix", "skew-symmetric", "matrix structure", "gpu"], "suggestedPath": "/issymmetric-1.m" }, { "id": "issymmetric:2", "builtinKey": "issymmetric", "builtinTitle": "issymmetric", "builtinSlug": "issymmetric", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Allowing numerical noise with a tolerance", "summary": "Test whether a matrix is symmetric or skew-symmetric, optionally within a tolerance.", "code": "A = [1 1+1e-12; 1-1e-12 1];\ntf = issymmetric(A, 1e-9)", "output": "tf = logical\n 1", "keywords": ["issymmetric", "symmetric matrix", "skew-symmetric", "matrix structure", "gpu"], "suggestedPath": "/issymmetric-2.m" }, { "id": "issymmetric:3", "builtinKey": "issymmetric", "builtinTitle": "issymmetric", "builtinSlug": "issymmetric", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Detecting a skew-symmetric matrix", "summary": "Test whether a matrix is symmetric or skew-symmetric, optionally within a tolerance.", "code": "B = [0 -2 4; 2 0 -3; -4 3 0];\ntf = issymmetric(B, 'skew')", "output": "tf = logical\n 1", "keywords": ["issymmetric", "symmetric matrix", "skew-symmetric", "matrix structure", "gpu"], "suggestedPath": "/issymmetric-3.m" }, { "id": "issymmetric:4", "builtinKey": "issymmetric", "builtinTitle": "issymmetric", "builtinSlug": "issymmetric", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Handling non-square matrices", "summary": "Test whether a matrix is symmetric or skew-symmetric, optionally within a tolerance.", "code": "C = [1 2 3; 4 5 6];\ntf = issymmetric(C)", "output": "tf = logical\n 0", "keywords": ["issymmetric", "symmetric matrix", "skew-symmetric", "matrix structure", "gpu"], "suggestedPath": "/issymmetric-4.m" }, { "id": "issymmetric:5", "builtinKey": "issymmetric", "builtinTitle": "issymmetric", "builtinSlug": "issymmetric", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Working with complex-valued matrices", "summary": "Test whether a matrix is symmetric or skew-symmetric, optionally within a tolerance.", "code": "Z = [1+2i 3-4i; 3-4i 5+6i];\ntf = issymmetric(Z)", "output": "tf = logical\n 1", "keywords": ["issymmetric", "symmetric matrix", "skew-symmetric", "matrix structure", "gpu"], "suggestedPath": "/issymmetric-5.m" }, { "id": "issymmetric:6", "builtinKey": "issymmetric", "builtinTitle": "issymmetric", "builtinSlug": "issymmetric", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Inspecting a GPU-resident matrix", "summary": "Test whether a matrix is symmetric or skew-symmetric, optionally within a tolerance.", "code": "G = gpuArray([0 5; 5 9]);\ntf = issymmetric(G)", "output": "tf = logical\n 1", "keywords": ["issymmetric", "symmetric matrix", "skew-symmetric", "matrix structure", "gpu"], "suggestedPath": "/issymmetric-6.m" }, { "id": "isvector:1", "builtinKey": "isvector", "builtinTitle": "isvector", "builtinSlug": "isvector", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Checking if a row vector input is a vector", "summary": "Return true when an array is 1-by-N or N-by-1 (including scalars).", "code": "tf = isvector([1 2 3])", "output": "tf = logical(1)", "keywords": ["isvector", "vector detection", "metadata query", "gpu", "logical"], "suggestedPath": "/isvector-1.m" }, { "id": "isvector:2", "builtinKey": "isvector", "builtinTitle": "isvector", "builtinSlug": "isvector", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Detecting that a matrix is not a vector", "summary": "Return true when an array is 1-by-N or N-by-1 (including scalars).", "code": "tf = isvector([1 2 3; 4 5 6])", "output": "tf = logical(0)", "keywords": ["isvector", "vector detection", "metadata query", "gpu", "logical"], "suggestedPath": "/isvector-2.m" }, { "id": "isvector:3", "builtinKey": "isvector", "builtinTitle": "isvector", "builtinSlug": "isvector", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Verifying that a scalar counts as a vector", "summary": "Return true when an array is 1-by-N or N-by-1 (including scalars).", "code": "tf = isvector(42)", "output": "tf = logical(1)", "keywords": ["isvector", "vector detection", "metadata query", "gpu", "logical"], "suggestedPath": "/isvector-3.m" }, { "id": "isvector:4", "builtinKey": "isvector", "builtinTitle": "isvector", "builtinSlug": "isvector", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Handling empty dimensions exactly like MATLAB", "summary": "Return true when an array is 1-by-N or N-by-1 (including scalars).", "code": "tf_zero_col = isvector(zeros(1,0));\ntf_zero_row = isvector(zeros(0,1));\ntf_zero_by_three = isvector(zeros(0,3))", "output": "tf_zero_col = logical(1)\ntf_zero_row = logical(1)\ntf_zero_by_three = logical(0)", "keywords": ["isvector", "vector detection", "metadata query", "gpu", "logical"], "suggestedPath": "/isvector-4.m" }, { "id": "isvector:5", "builtinKey": "isvector", "builtinTitle": "isvector", "builtinSlug": "isvector", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Working with character and string arrays", "summary": "Return true when an array is 1-by-N or N-by-1 (including scalars).", "code": "tf_char = isvector('RunMat');\ntf_string_row = isvector([\"a\",\"b\",\"c\"])", "output": "tf_char = logical(1)\ntf_string_row = logical(1)", "keywords": ["isvector", "vector detection", "metadata query", "gpu", "logical"], "suggestedPath": "/isvector-5.m" }, { "id": "isvector:6", "builtinKey": "isvector", "builtinTitle": "isvector", "builtinSlug": "isvector", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Confirming GPU tensor metadata without gathering", "summary": "Return true when an array is 1-by-N or N-by-1 (including scalars).", "code": "G = gpuArray((1:5)');\ntf_gpu = isvector(G)", "output": "tf_gpu = logical(1)", "keywords": ["isvector", "vector detection", "metadata query", "gpu", "logical"], "suggestedPath": "/isvector-6.m" }, { "id": "isvector:7", "builtinKey": "isvector", "builtinTitle": "isvector", "builtinSlug": "isvector", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Rejecting higher-dimensional arrays", "summary": "Return true when an array is 1-by-N or N-by-1 (including scalars).", "code": "tf = isvector(ones(1,1,4))", "output": "tf = logical(0)", "keywords": ["isvector", "vector detection", "metadata query", "gpu", "logical"], "suggestedPath": "/isvector-7.m" }, { "id": "isvector:8", "builtinKey": "isvector", "builtinTitle": "isvector", "builtinSlug": "isvector", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Trailing singleton dimensions are still rejected", "summary": "Return true when an array is 1-by-N or N-by-1 (including scalars).", "code": "tf = isvector(ones(1,1,1))", "output": "tf = logical(0)", "keywords": ["isvector", "vector detection", "metadata query", "gpu", "logical"], "suggestedPath": "/isvector-8.m" }, { "id": "join:1", "builtinKey": "join", "builtinTitle": "join", "builtinSlug": "join", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Combine Strings In Each Row Of A Matrix", "summary": "Combine text across a specified dimension inserting delimiters between elements.", "code": "names = [\"Carlos\" \"Sada\"; \"Ella\" \"Olsen\"; \"Diana\" \"Lee\"];\nfullNames = join(names)", "output": "fullNames = 3×1 string\n \"Carlos Sada\"\n \"Ella Olsen\"\n \"Diana Lee\"", "keywords": ["join", "string join", "concatenate strings", "delimiters", "cell array join", "dimension join"], "suggestedPath": "/join-1.m" }, { "id": "join:2", "builtinKey": "join", "builtinTitle": "join", "builtinSlug": "join", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Insert A Custom Delimiter Between Elements", "summary": "Combine text across a specified dimension inserting delimiters between elements.", "code": "labels = [\"x\" \"y\" \"z\"; \"a\" \"b\" \"c\"];\njoined = join(labels, \"-\")", "output": "joined = 2×1 string\n \"x-y-z\"\n \"a-b-c\"", "keywords": ["join", "string join", "concatenate strings", "delimiters", "cell array join", "dimension join"], "suggestedPath": "/join-2.m" }, { "id": "join:3", "builtinKey": "join", "builtinTitle": "join", "builtinSlug": "join", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Provide A Delimiter Array That Varies Per Row", "summary": "Combine text across a specified dimension inserting delimiters between elements.", "code": "str = [\"x\" \"y\" \"z\"; \"a\" \"b\" \"c\"];\ndelims = [\" + \" \" = \"; \" - \" \" = \"];\nequations = join(str, delims)", "output": "equations = 2×1 string\n \"x + y = z\"\n \"a - b = c\"", "keywords": ["join", "string join", "concatenate strings", "delimiters", "cell array join", "dimension join"], "suggestedPath": "/join-3.m" }, { "id": "join:4", "builtinKey": "join", "builtinTitle": "join", "builtinSlug": "join", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Join Along A Specific Dimension", "summary": "Combine text across a specified dimension inserting delimiters between elements.", "code": "scores = [\"Alice\" \"Bob\"; \"92\" \"88\"; \"85\" \"90\"];\nbyColumn = join(scores, 1)", "output": "byColumn = 1×2 string\n \"Alice 92 85\" \"Bob 88 90\"", "keywords": ["join", "string join", "concatenate strings", "delimiters", "cell array join", "dimension join"], "suggestedPath": "/join-4.m" }, { "id": "join:5", "builtinKey": "join", "builtinTitle": "join", "builtinSlug": "join", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Join A Cell Array Of Character Vectors", "summary": "Combine text across a specified dimension inserting delimiters between elements.", "code": "C = {'GPU', 'Accelerate'; 'Ignition', 'Interpreter'};\nresult = join(C, \", \")", "output": "result = 2×1 cell\n {'GPU, Accelerate'}\n {'Ignition, Interpreter'}", "keywords": ["join", "string join", "concatenate strings", "delimiters", "cell array join", "dimension join"], "suggestedPath": "/join-5.m" }, { "id": "join:6", "builtinKey": "join", "builtinTitle": "join", "builtinSlug": "join", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Join Using A Dimension Argument As The Second Input", "summary": "Combine text across a specified dimension inserting delimiters between elements.", "code": "words = [\"RunMat\"; \"Accelerate\"; \"Planner\"];\nsentence = join(words, 1)", "output": "sentence = \"RunMat Accelerate Planner\"", "keywords": ["join", "string join", "concatenate strings", "delimiters", "cell array join", "dimension join"], "suggestedPath": "/join-6.m" }, { "id": "join:7", "builtinKey": "join", "builtinTitle": "join", "builtinSlug": "join", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Join Rows Of An Empty String Array", "summary": "Combine text across a specified dimension inserting delimiters between elements.", "code": "emptyRows = strings(2, 0);\nout = join(emptyRows)", "output": "out = 2×1 string\n \"\"\n \"\"", "keywords": ["join", "string join", "concatenate strings", "delimiters", "cell array join", "dimension join"], "suggestedPath": "/join-7.m" }, { "id": "jsondecode:1", "builtinKey": "jsondecode", "builtinTitle": "jsondecode", "builtinSlug": "jsondecode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Parsing a scalar number", "summary": "Parse UTF-8 JSON text into MATLAB-compatible RunMat values.", "code": "value = jsondecode(\"42\")", "output": "value = 42", "keywords": ["jsondecode", "json", "parse json", "struct from json", "gpu gather"], "suggestedPath": "/jsondecode-1.m" }, { "id": "jsondecode:2", "builtinKey": "jsondecode", "builtinTitle": "jsondecode", "builtinSlug": "jsondecode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Decoding a matrix of doubles", "summary": "Parse UTF-8 JSON text into MATLAB-compatible RunMat values.", "code": "text = \"[[1,2,3],[4,5,6]]\";\nmatrix = jsondecode(text)", "output": "matrix =\n 1 2 3\n 4 5 6", "keywords": ["jsondecode", "json", "parse json", "struct from json", "gpu gather"], "suggestedPath": "/jsondecode-2.m" }, { "id": "jsondecode:3", "builtinKey": "jsondecode", "builtinTitle": "jsondecode", "builtinSlug": "jsondecode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Converting a JSON object into a struct", "summary": "Parse UTF-8 JSON text into MATLAB-compatible RunMat values.", "code": "person = jsondecode('{\"name\":\"Ada\",\"age\":37}');\ndisp(person.name);\ndisp(person.age)", "output": "Ada\n 37", "keywords": ["jsondecode", "json", "parse json", "struct from json", "gpu gather"], "suggestedPath": "/jsondecode-3.m" }, { "id": "jsondecode:4", "builtinKey": "jsondecode", "builtinTitle": "jsondecode", "builtinSlug": "jsondecode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Decoding an array of objects into a cell array", "summary": "Parse UTF-8 JSON text into MATLAB-compatible RunMat values.", "code": "text = '[{\"name\":\"Ada\",\"role\":\"Researcher\"},{\"name\":\"Grace\",\"role\":\"Engineer\"}]';\npeople = jsondecode(text);\npeople{1}.name\npeople{2}.role", "output": "people =\n 1x2 cell array\n {1x1 struct} {1x1 struct}\n\nans = 'Ada'\nans = 'Engineer'", "keywords": ["jsondecode", "json", "parse json", "struct from json", "gpu gather"], "suggestedPath": "/jsondecode-4.m" }, { "id": "jsondecode:5", "builtinKey": "jsondecode", "builtinTitle": "jsondecode", "builtinSlug": "jsondecode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Handling heterogeneous arrays with cell arrays", "summary": "Parse UTF-8 JSON text into MATLAB-compatible RunMat values.", "code": "text = '[\"RunMat\", 42, true]';\ndata = jsondecode(text)", "output": "data =\n 1x3 cell array\n {\"RunMat\"} {[42]} {[1]}", "keywords": ["jsondecode", "json", "parse json", "struct from json", "gpu gather"], "suggestedPath": "/jsondecode-5.m" }, { "id": "jsondecode:6", "builtinKey": "jsondecode", "builtinTitle": "jsondecode", "builtinSlug": "jsondecode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Working with null and empty JSON values", "summary": "Parse UTF-8 JSON text into MATLAB-compatible RunMat values.", "code": "value = jsondecode(\"null\");\ndisp(value);\nisempty(value)", "output": "[]\nans = logical 1", "keywords": ["jsondecode", "json", "parse json", "struct from json", "gpu gather"], "suggestedPath": "/jsondecode-6.m" }, { "id": "jsonencode:1", "builtinKey": "jsonencode", "builtinTitle": "jsonencode", "builtinSlug": "jsonencode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Converting a MATLAB struct to JSON", "summary": "Serialize MATLAB values to UTF-8 JSON text with MATLAB-compatible defaults.", "code": "person = struct('name', 'Ada', 'age', 37);\nencoded = jsonencode(person)", "output": "encoded = '{\"age\":37,\"name\":\"Ada\"}'", "keywords": ["jsonencode", "json", "serialization", "struct to json", "pretty print json", "gpu gather"], "suggestedPath": "/jsonencode-1.m" }, { "id": "jsonencode:2", "builtinKey": "jsonencode", "builtinTitle": "jsonencode", "builtinSlug": "jsonencode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Serialising a matrix with pretty printing", "summary": "Serialize MATLAB values to UTF-8 JSON text with MATLAB-compatible defaults.", "code": "A = magic(3);\nencoded = jsonencode(A, 'PrettyPrint', true)", "output": "encoded =\n'[\n [8,1,6],\n [3,5,7],\n [4,9,2]\n]'", "keywords": ["jsonencode", "json", "serialization", "struct to json", "pretty print json", "gpu gather"], "suggestedPath": "/jsonencode-2.m" }, { "id": "jsonencode:3", "builtinKey": "jsonencode", "builtinTitle": "jsonencode", "builtinSlug": "jsonencode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Encoding nested cell arrays", "summary": "Serialize MATLAB values to UTF-8 JSON text with MATLAB-compatible defaults.", "code": "C = {struct('task','encode','ok',true), {'nested', 42}};\nencoded = jsonencode(C)", "output": "encoded = '[{\"ok\":true,\"task\":\"encode\"},[\"nested\",42]]'", "keywords": ["jsonencode", "json", "serialization", "struct to json", "pretty print json", "gpu gather"], "suggestedPath": "/jsonencode-3.m" }, { "id": "jsonencode:4", "builtinKey": "jsonencode", "builtinTitle": "jsonencode", "builtinSlug": "jsonencode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Handling NaN and Inf values", "summary": "Serialize MATLAB values to UTF-8 JSON text with MATLAB-compatible defaults.", "code": "data = [1 NaN Inf];\nencoded = jsonencode(data)", "output": "encoded = '[1,null,null]'", "keywords": ["jsonencode", "json", "serialization", "struct to json", "pretty print json", "gpu gather"], "suggestedPath": "/jsonencode-4.m" }, { "id": "jsonencode:5", "builtinKey": "jsonencode", "builtinTitle": "jsonencode", "builtinSlug": "jsonencode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Rejecting NaN when ConvertInfAndNaN is false", "summary": "Serialize MATLAB values to UTF-8 JSON text with MATLAB-compatible defaults.", "code": "try\n jsonencode(data, 'ConvertInfAndNaN', false);\ncatch err\n disp(err.message);\nend", "output": "jsonencode: ConvertInfAndNaN must be true to encode NaN or Inf values", "keywords": ["jsonencode", "json", "serialization", "struct to json", "pretty print json", "gpu gather"], "suggestedPath": "/jsonencode-5.m" }, { "id": "jsonencode:6", "builtinKey": "jsonencode", "builtinTitle": "jsonencode", "builtinSlug": "jsonencode", "category": "io/json", "categoryPath": ["io", "json"], "exampleTitle": "Serialising GPU-resident tensors", "summary": "Serialize MATLAB values to UTF-8 JSON text with MATLAB-compatible defaults.", "code": "G = gpuArray(eye(2));\nencoded = jsonencode(G)", "output": "encoded = '[[1,0],[0,1]]'", "keywords": ["jsonencode", "json", "serialization", "struct to json", "pretty print json", "gpu gather"], "suggestedPath": "/jsonencode-6.m" }, { "id": "kron:1", "builtinKey": "kron", "builtinTitle": "kron", "builtinSlug": "kron", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Computing the Kronecker product of two matrices", "summary": "Compute the Kronecker (tensor) product of two scalars, vectors, matrices, or N-D arrays.", "code": "A = [1 2; 3 4];\nB = [0 5; 6 7];\nC = kron(A, B)", "output": "C =\n 0 5 0 10\n 6 7 12 14\n 0 15 0 20\n 18 21 24 28", "keywords": ["kron", "kronecker product", "tensor product", "block matrix", "gpu"], "suggestedPath": "/kron-1.m" }, { "id": "kron:2", "builtinKey": "kron", "builtinTitle": "kron", "builtinSlug": "kron", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Kronecker product with row and column vectors", "summary": "Compute the Kronecker (tensor) product of two scalars, vectors, matrices, or N-D arrays.", "code": "row = [1 2 3];\ncol = (1:3)';\nK = kron(row, col);\nsize(K)", "output": "ans =\n 3 9", "keywords": ["kron", "kronecker product", "tensor product", "block matrix", "gpu"], "suggestedPath": "/kron-2.m" }, { "id": "kron:3", "builtinKey": "kron", "builtinTitle": "kron", "builtinSlug": "kron", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Scaling a matrix with a scalar using `kron`", "summary": "Compute the Kronecker (tensor) product of two scalars, vectors, matrices, or N-D arrays.", "code": "A = [1 2; 3 4];\nS = kron(2, A)", "output": "S =\n 2 4\n 6 8", "keywords": ["kron", "kronecker product", "tensor product", "block matrix", "gpu"], "suggestedPath": "/kron-3.m" }, { "id": "kron:4", "builtinKey": "kron", "builtinTitle": "kron", "builtinSlug": "kron", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Building block-diagonal systems with `kron`", "summary": "Compute the Kronecker (tensor) product of two scalars, vectors, matrices, or N-D arrays.", "code": "I = eye(3);\nM = [1 0; 0 -1];\nblockDiag = kron(I, M)", "keywords": ["kron", "kronecker product", "tensor product", "block matrix", "gpu"], "suggestedPath": "/kron-4.m" }, { "id": "kron:5", "builtinKey": "kron", "builtinTitle": "kron", "builtinSlug": "kron", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Kronecker product of complex matrices", "summary": "Compute the Kronecker (tensor) product of two scalars, vectors, matrices, or N-D arrays.", "code": "A = [1+2i 0; 0 3-1i];\nB = [0 1; 2 3i];\nC = kron(A, B)", "keywords": ["kron", "kronecker product", "tensor product", "block matrix", "gpu"], "suggestedPath": "/kron-5.m" }, { "id": "kron:6", "builtinKey": "kron", "builtinTitle": "kron", "builtinSlug": "kron", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Using `kron` with logical masks", "summary": "Compute the Kronecker (tensor) product of two scalars, vectors, matrices, or N-D arrays.", "code": "mask = logical([1 0; 0 1]);\ntile = kron(mask, ones(2))", "keywords": ["kron", "kronecker product", "tensor product", "block matrix", "gpu"], "suggestedPath": "/kron-6.m" }, { "id": "kron:7", "builtinKey": "kron", "builtinTitle": "kron", "builtinSlug": "kron", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Running `kron` on GPU-resident tensors", "summary": "Compute the Kronecker (tensor) product of two scalars, vectors, matrices, or N-D arrays.", "code": "G = gpuArray(rand(2));\nH = gpuArray([1 -1; -1 1]);\nK = kron(G, H);\nisgpuarray(K)", "output": "ans = logical 1", "keywords": ["kron", "kronecker product", "tensor product", "block matrix", "gpu"], "suggestedPath": "/kron-7.m" }, { "id": "ldivide:1", "builtinKey": "ldivide", "builtinTitle": "ldivide", "builtinSlug": "ldivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Left-dividing a vector by a scalar", "summary": "Element-wise left division A .\\ B (computes B ./ A) with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "A = 2;\nB = [4 6 8];\nQ = ldivide(A, B)", "output": "Q = [2 3 4]", "keywords": ["ldivide", "element-wise left division", ".\\", "gpu", "implicit expansion"], "suggestedPath": "/ldivide-1.m" }, { "id": "ldivide:2", "builtinKey": "ldivide", "builtinTitle": "ldivide", "builtinSlug": "ldivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Broadcasting between column divisors and row numerators", "summary": "Element-wise left division A .\\ B (computes B ./ A) with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "A = (1:3)'; % column of divisors\nB = [10 20 40]; % row of numerators\nM = ldivide(A, B); % implicit expansion", "output": "M =\n 10.0000 20.0000 40.0000\n 5.0000 10.0000 20.0000\n 3.3333 6.6667 13.3333", "keywords": ["ldivide", "element-wise left division", ".\\", "gpu", "implicit expansion"], "suggestedPath": "/ldivide-2.m" }, { "id": "ldivide:3", "builtinKey": "ldivide", "builtinTitle": "ldivide", "builtinSlug": "ldivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Element-wise left division of complex values", "summary": "Element-wise left division A .\\ B (computes B ./ A) with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "A = [1+2i, 3-4i];\nB = [2-1i, -1+1i];\nZ = ldivide(A, B)", "output": "Z =\n 0.0000 - 1.0000i -0.2800 - 0.0400i", "keywords": ["ldivide", "element-wise left division", ".\\", "gpu", "implicit expansion"], "suggestedPath": "/ldivide-3.m" }, { "id": "ldivide:4", "builtinKey": "ldivide", "builtinTitle": "ldivide", "builtinSlug": "ldivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Dividing character codes by a scalar", "summary": "Element-wise left division A .\\ B (computes B ./ A) with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "A = 'ABC';\nB = 2;\ncodes = ldivide(A, B)", "output": "codes = [0.0308 0.0303 0.0301]", "keywords": ["ldivide", "element-wise left division", ".\\", "gpu", "implicit expansion"], "suggestedPath": "/ldivide-4.m" }, { "id": "ldivide:5", "builtinKey": "ldivide", "builtinTitle": "ldivide", "builtinSlug": "ldivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Computing reciprocals with `ldivide`", "summary": "Element-wise left division A .\\ B (computes B ./ A) with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "A = [1 2 4 8];\nB = 1;\nR = ldivide(A, B); % equivalent to 1 ./ A", "output": "R = [1 0.5 0.25 0.125]", "keywords": ["ldivide", "element-wise left division", ".\\", "gpu", "implicit expansion"], "suggestedPath": "/ldivide-5.m" }, { "id": "ldivide:6", "builtinKey": "ldivide", "builtinTitle": "ldivide", "builtinSlug": "ldivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Keeping results on the GPU with `'like'`", "summary": "Element-wise left division A .\\ B (computes B ./ A) with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "proto = gpuArray.zeros(1, 1);\nA = gpuArray([2 4 8 16]);\nB = gpuArray([4 8 16 32]);\ndeviceResult = ldivide(A, B, 'like', proto);\nhostCheck = gather(deviceResult)", "output": "deviceResult =\n 1x4 gpuArray\n 2 2 2 2\nhostCheck = [2 2 2 2]", "keywords": ["ldivide", "element-wise left division", ".\\", "gpu", "implicit expansion"], "suggestedPath": "/ldivide-6.m" }, { "id": "le:1", "builtinKey": "le", "builtinTitle": "le", "builtinSlug": "le", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Check Whether A Scalar Value Meets A Maximum", "summary": "Element-wise less-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "flag = le(17, 42)", "output": "flag =\n 1", "keywords": ["le", "<=", "less than or equal", "logical comparison", "gpuArray less-equal"], "suggestedPath": "/le-1.m" }, { "id": "le:2", "builtinKey": "le", "builtinTitle": "le", "builtinSlug": "le", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Create A Mask For Matrix Values Below Or Equal To A Threshold", "summary": "Element-wise less-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "M = [1 2 3; 4 5 6];\nmask = le(M, 3)", "output": "mask =\n 2×3 logical array\n 1 1 1\n 0 0 0", "keywords": ["le", "<=", "less than or equal", "logical comparison", "gpuArray less-equal"], "suggestedPath": "/le-2.m" }, { "id": "le:3", "builtinKey": "le", "builtinTitle": "le", "builtinSlug": "le", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Apply Less-Equal With Implicit Expansion", "summary": "Element-wise less-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "v = [1 3 5 7];\nmask = le(v, [2 6])", "output": "mask =\n 1×4 logical array\n 1 1 0 0", "keywords": ["le", "<=", "less than or equal", "logical comparison", "gpuArray less-equal"], "suggestedPath": "/le-3.m" }, { "id": "le:4", "builtinKey": "le", "builtinTitle": "le", "builtinSlug": "le", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare Character Data To Numeric Codes With Equality Support", "summary": "Element-wise less-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "letters = ['A' 'B' 'C'];\nisBeforeOrB = le(letters, 66)", "output": "isBeforeOrB =\n 1×3 logical array\n 1 1 1", "keywords": ["le", "<=", "less than or equal", "logical comparison", "gpuArray less-equal"], "suggestedPath": "/le-4.m" }, { "id": "le:5", "builtinKey": "le", "builtinTitle": "le", "builtinSlug": "le", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare String Arrays Lexicographically Allowing Equality", "summary": "Element-wise less-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "names = [\"alice\" \"charlie\" \"bob\"];\nearlierOrSame = le(names, \"bob\")", "output": "earlierOrSame =\n 1×3 logical array\n 1 0 1", "keywords": ["le", "<=", "less than or equal", "logical comparison", "gpuArray less-equal"], "suggestedPath": "/le-5.m" }, { "id": "le:6", "builtinKey": "le", "builtinTitle": "le", "builtinSlug": "le", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Run `le` Directly On `gpuArray` Inputs", "summary": "Element-wise less-than-or-equal comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "G1 = gpuArray([1 4 7]);\nG2 = gpuArray([2 4 8]);\ndeviceResult = le(G1, G2);\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1×3 gpuArray logical array\n 1 1 1\nhostResult =\n 1×3 logical array\n 1 1 1", "keywords": ["le", "<=", "less than or equal", "logical comparison", "gpuArray less-equal"], "suggestedPath": "/le-6.m" }, { "id": "legend:1", "builtinKey": "legend", "builtinTitle": "legend", "builtinSlug": "legend", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Build a legend from display names", "summary": "Show and configure plot legends for labeled series, display names, and MATLAB `legend` workflows.", "code": "x = linspace(0, 2*pi, 200);\nh1 = plot(x, sin(x));\nset(h1, 'DisplayName', 'sin(x)');\nhold on;\nh2 = plot(x, cos(x));\nset(h2, 'DisplayName', 'cos(x)');\nlegend;", "keywords": ["legend", "chart legend", "display names", "matlab legend", "series labels"], "suggestedPath": "/legend-1.m" }, { "id": "legend:2", "builtinKey": "legend", "builtinTitle": "legend", "builtinSlug": "legend", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Pass labels explicitly and position the legend", "summary": "Show and configure plot legends for labeled series, display names, and MATLAB `legend` workflows.", "code": "plot(1:5, [1 2 3 4 5]);\nhold on;\nplot(1:5, [5 4 3 2 1]);\nlg = legend('rising', 'falling', 'Location', 'southwest');\nget(lg, 'Type')", "output": "ans =\n 'legend'", "keywords": ["legend", "chart legend", "display names", "matlab legend", "series labels"], "suggestedPath": "/legend-2.m" }, { "id": "legend:3", "builtinKey": "legend", "builtinTitle": "legend", "builtinSlug": "legend", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Keep legends subplot-local", "summary": "Show and configure plot legends for labeled series, display names, and MATLAB `legend` workflows.", "code": "subplot(1, 2, 1);\nplot(1:5, 1:5);\nlegend('left');\nsubplot(1, 2, 2);\nplot(1:5, [5 4 3 2 1]);", "output": "% Only the left subplot shows a legend", "keywords": ["legend", "chart legend", "display names", "matlab legend", "series labels"], "suggestedPath": "/legend-3.m" }, { "id": "length:1", "builtinKey": "length", "builtinTitle": "length", "builtinSlug": "length", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Determine the length of a row vector", "summary": "Return the length of the largest dimension of scalars, vectors, matrices, and N-D arrays.", "code": "row = [1 2 3 4];\nn = length(row)", "output": "n = 4", "keywords": ["length", "largest dimension", "vector length", "gpu metadata", "array size"], "suggestedPath": "/length-1.m" }, { "id": "length:2", "builtinKey": "length", "builtinTitle": "length", "builtinSlug": "length", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Find the longer side of a rectangular matrix", "summary": "Return the length of the largest dimension of scalars, vectors, matrices, and N-D arrays.", "code": "A = randn(5, 12);\nlen = length(A)", "output": "len = 12", "keywords": ["length", "largest dimension", "vector length", "gpu metadata", "array size"], "suggestedPath": "/length-2.m" }, { "id": "length:3", "builtinKey": "length", "builtinTitle": "length", "builtinSlug": "length", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Handle empty arrays that still have a non-zero dimension", "summary": "Return the length of the largest dimension of scalars, vectors, matrices, and N-D arrays.", "code": "E = zeros(0, 7);\nlen = length(E)", "output": "len = 7", "keywords": ["length", "largest dimension", "vector length", "gpu metadata", "array size"], "suggestedPath": "/length-3.m" }, { "id": "length:4", "builtinKey": "length", "builtinTitle": "length", "builtinSlug": "length", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Measure the length of a character array", "summary": "Return the length of the largest dimension of scalars, vectors, matrices, and N-D arrays.", "code": "name = 'RunMat';\nlen = length(name)", "output": "len = 6", "keywords": ["length", "largest dimension", "vector length", "gpu metadata", "array size"], "suggestedPath": "/length-4.m" }, { "id": "length:5", "builtinKey": "length", "builtinTitle": "length", "builtinSlug": "length", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Inspect the length of a gpuArray without gathering", "summary": "Return the length of the largest dimension of scalars, vectors, matrices, and N-D arrays.", "code": "G = gpuArray(ones(256, 4));\nlen = length(G)", "output": "len = 256", "keywords": ["length", "largest dimension", "vector length", "gpu metadata", "array size"], "suggestedPath": "/length-5.m" }, { "id": "linsolve:1", "builtinKey": "linsolve", "builtinTitle": "linsolve", "builtinSlug": "linsolve", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Solving a 2×2 linear system", "summary": "Solve linear systems A * X = B with optional structural hints (triangular, symmetric, positive-definite, or transposed).", "code": "A = [4 -2; 1 3];\nb = [6; 7];\nx = linsolve(A, b)", "output": "x =\n 2\n 1", "keywords": ["linsolve", "linear solve", "triangular system", "posdef", "gpu"], "suggestedPath": "/linsolve-1.m" }, { "id": "linsolve:2", "builtinKey": "linsolve", "builtinTitle": "linsolve", "builtinSlug": "linsolve", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Using a lower-triangular hint", "summary": "Solve linear systems A * X = B with optional structural hints (triangular, symmetric, positive-definite, or transposed).", "code": "L = [3 0 0; -1 2 0; 4 1 5];\nb = [9; 1; 12];\nopts.LT = true;\nx = linsolve(L, b, opts)", "output": "x =\n 3\n 2\n 1", "keywords": ["linsolve", "linear solve", "triangular system", "posdef", "gpu"], "suggestedPath": "/linsolve-2.m" }, { "id": "linsolve:3", "builtinKey": "linsolve", "builtinTitle": "linsolve", "builtinSlug": "linsolve", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Solving the transposed system", "summary": "Solve linear systems A * X = B with optional structural hints (triangular, symmetric, positive-definite, or transposed).", "code": "A = [2 1 0; 0 3 4; 0 0 5];\nb = [3; 11; 5];\nopts.UT = true;\nopts.TRANSA = 'T';\nx = linsolve(A, b, opts)", "output": "x =\n 1\n 2\n 1", "keywords": ["linsolve", "linear solve", "triangular system", "posdef", "gpu"], "suggestedPath": "/linsolve-3.m" }, { "id": "linsolve:4", "builtinKey": "linsolve", "builtinTitle": "linsolve", "builtinSlug": "linsolve", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Complex triangular solve", "summary": "Solve linear systems A * X = B with optional structural hints (triangular, symmetric, positive-definite, or transposed).", "code": "U = [2+1i -1i; 0 4-2i];\nb = [3+2i; 7];\nopts.UT = true;\nx = linsolve(U, b, opts)", "output": "x =\n 2.0000 + 0.0000i\n 1.7500 + 0.8750i", "keywords": ["linsolve", "linear solve", "triangular system", "posdef", "gpu"], "suggestedPath": "/linsolve-4.m" }, { "id": "linsolve:5", "builtinKey": "linsolve", "builtinTitle": "linsolve", "builtinSlug": "linsolve", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Estimating the reciprocal condition number", "summary": "Solve linear systems A * X = B with optional structural hints (triangular, symmetric, positive-definite, or transposed).", "code": "A = [1 1; 1 1+1e-12];\nb = [2; 2+1e-12];\n[x, rcond_est] = linsolve(A, b)", "output": "x =\n 1\n 1\n\nrcond_est =\n 4.4409e-12", "keywords": ["linsolve", "linear solve", "triangular system", "posdef", "gpu"], "suggestedPath": "/linsolve-5.m" }, { "id": "linspace:1", "builtinKey": "linspace", "builtinTitle": "linspace", "builtinSlug": "linspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating five points between zero and one", "summary": "Generate linearly spaced row vectors that match MATLAB behaviour.", "code": "x = linspace(0, 1, 5)", "output": "% Row vector with five equally spaced points\nx = [0 0.25 0.5 0.75 1]", "keywords": ["linspace", "range", "vector", "gpu", "sequence"], "suggestedPath": "/linspace-1.m" }, { "id": "linspace:2", "builtinKey": "linspace", "builtinTitle": "linspace", "builtinSlug": "linspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Sampling 100 points when the third argument is omitted", "summary": "Generate linearly spaced row vectors that match MATLAB behaviour.", "code": "t = linspace(-pi, pi)", "output": "% t is a 1x100 row vector spanning [-pi, pi]\ndisp(t(1));\ndisp(t(end))", "keywords": ["linspace", "range", "vector", "gpu", "sequence"], "suggestedPath": "/linspace-2.m" }, { "id": "linspace:3", "builtinKey": "linspace", "builtinTitle": "linspace", "builtinSlug": "linspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Constructing complex breakpoints", "summary": "Generate linearly spaced row vectors that match MATLAB behaviour.", "code": "z = linspace(1+1i, -3+2i, 4)", "output": "z =\n 1.0000 + 1.0000i -0.3333 + 1.3333i -1.6667 + 1.6667i -3.0000 + 2.0000i", "keywords": ["linspace", "range", "vector", "gpu", "sequence"], "suggestedPath": "/linspace-3.m" }, { "id": "linspace:4", "builtinKey": "linspace", "builtinTitle": "linspace", "builtinSlug": "linspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Staying on the GPU automatically", "summary": "Generate linearly spaced row vectors that match MATLAB behaviour.", "code": "a = gpuArray(0);\nb = gpuArray(2*pi);\ntheta = linspace(a, b, 1024);\nwave = sin(theta)", "output": "% theta and wave remain on the GPU when an acceleration provider is active.\ndisp(gather(theta(1:5)))", "keywords": ["linspace", "range", "vector", "gpu", "sequence"], "suggestedPath": "/linspace-4.m" }, { "id": "load:1", "builtinKey": "load", "builtinTitle": "load", "builtinSlug": "load", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Load the entire file into the workspace", "summary": "Load variables from a MATLAB-compatible MAT-file into the workspace or return them as a struct.", "code": "weights = [0.5, 1.0, 1.5];\nsave('results.mat', 'weights');\nload('results.mat');\ndisp(norm(weights))", "keywords": ["load", "mat", "workspace", "io", "matlab load", "regex load"], "suggestedPath": "/load-1.m" }, { "id": "load:2", "builtinKey": "load", "builtinTitle": "load", "builtinSlug": "load", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Load a subset of variables by name", "summary": "Load variables from a MATLAB-compatible MAT-file into the workspace or return them as a struct.", "code": "time = 0:0.25:1;\nstate = [0, 0.5, 0.8, 0.6, 0.3];\nsave('sim_state.mat', 'time', 'state');\nload('sim_state.mat', 'state', 'time');\nplot(time, state)", "keywords": ["load", "mat", "workspace", "io", "matlab load", "regex load"], "suggestedPath": "/load-2.m" }, { "id": "load:3", "builtinKey": "load", "builtinTitle": "load", "builtinSlug": "load", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Load variables using regular expressions", "summary": "Load variables from a MATLAB-compatible MAT-file into the workspace or return them as a struct.", "code": "layer_1 = ones(4, 4);\nlayer_2 = ones(8, 8);\nsave('checkpoint.mat', 'layer_1', 'layer_2');\nload('checkpoint.mat', '-regexp', '^layer_\\d+$')", "keywords": ["load", "mat", "workspace", "io", "matlab load", "regex load"], "suggestedPath": "/load-3.m" }, { "id": "load:4", "builtinKey": "load", "builtinTitle": "load", "builtinSlug": "load", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Capture loaded variables in a struct without altering the workspace", "summary": "Load variables from a MATLAB-compatible MAT-file into the workspace or return them as a struct.", "code": "x = 3.14;\ny = 2.72;\nsave('snapshot.mat', 'x', 'y');\nS = load('snapshot.mat');\ndisp(fieldnames(S))", "keywords": ["load", "mat", "workspace", "io", "matlab load", "regex load"], "suggestedPath": "/load-4.m" }, { "id": "load:5", "builtinKey": "load", "builtinTitle": "load", "builtinSlug": "load", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Combine explicit names and regex filters", "summary": "Load variables from a MATLAB-compatible MAT-file into the workspace or return them as a struct.", "code": "config = struct('lr', 0.01);\nweights_conv = randn(3, 3);\nweights_fc = randn(4, 2);\nsave('model.mat', 'config', 'weights_conv', 'weights_fc');\nmodel = load('model.mat', 'config', '-regexp', '^weights_(conv|fc)')", "keywords": ["load", "mat", "workspace", "io", "matlab load", "regex load"], "suggestedPath": "/load-5.m" }, { "id": "load:6", "builtinKey": "load", "builtinTitle": "load", "builtinSlug": "load", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Honour a custom default filename", "summary": "Load variables from a MATLAB-compatible MAT-file into the workspace or return them as a struct.", "code": "x = 0;\nsave(fullfile(tempdir, 'autosave.mat'), 'x');\nsetenv('RUNMAT_LOAD_DEFAULT_PATH', fullfile(tempdir, 'autosave.mat'));\nload()", "keywords": ["load", "mat", "workspace", "io", "matlab load", "regex load"], "suggestedPath": "/load-6.m" }, { "id": "load:7", "builtinKey": "load", "builtinTitle": "load", "builtinSlug": "load", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Load character and string data", "summary": "Load variables from a MATLAB-compatible MAT-file into the workspace or return them as a struct.", "code": "labels = 'hello';\nsave('strings.mat', 'labels');\nvalues = load('strings.mat', 'labels');\ndisp(values.labels)", "keywords": ["load", "mat", "workspace", "io", "matlab load", "regex load"], "suggestedPath": "/load-7.m" }, { "id": "log:1", "builtinKey": "log", "builtinTitle": "log", "builtinSlug": "log", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Natural log of a positive scalar", "summary": "Natural logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "y = log(exp(3))", "output": "y = 3", "keywords": ["log", "natural logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log-1.m" }, { "id": "log:2", "builtinKey": "log", "builtinTitle": "log", "builtinSlug": "log", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Understanding log of zero", "summary": "Natural logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "value = log(0)", "output": "value = -Inf", "keywords": ["log", "natural logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log-2.m" }, { "id": "log:3", "builtinKey": "log", "builtinTitle": "log", "builtinSlug": "log", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Taking the logarithm of negative values", "summary": "Natural logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "data = [-1 -2 -4];\nresult = log(data)", "output": "result = [0.0000 + 3.1416i, 0.6931 + 3.1416i, 1.3863 + 3.1416i]", "keywords": ["log", "natural logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log-3.m" }, { "id": "log:4", "builtinKey": "log", "builtinTitle": "log", "builtinSlug": "log", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Applying log to complex numbers", "summary": "Natural logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "z = [1+2i, -1+pi*i];\nw = log(z)", "output": "w = [0.8047 + 1.1071i, 1.1447 + 1.2626i]", "keywords": ["log", "natural logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log-4.m" }, { "id": "log:5", "builtinKey": "log", "builtinTitle": "log", "builtinSlug": "log", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Element-wise log on a matrix living on the GPU", "summary": "Natural logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray([1 2; 4 8]);\nout = log(G);\nresult = gather(out)", "output": "result = [0.0000 0.6931; 1.3863 2.0794]", "keywords": ["log", "natural logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log-5.m" }, { "id": "log:6", "builtinKey": "log", "builtinTitle": "log", "builtinSlug": "log", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Logging character codes from a string", "summary": "Natural logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "C = 'ABC';\nvalues = log(C)", "output": "values = [4.1744 4.1897 4.2047]", "keywords": ["log", "natural logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log-6.m" }, { "id": "log10:1", "builtinKey": "log10", "builtinTitle": "log10", "builtinSlug": "log10", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Finding the order of magnitude of a number", "summary": "Base-10 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "value = log10(1000)", "output": "value = 3", "keywords": ["log10", "base-10 logarithm", "elementwise", "magnitude", "gpu"], "suggestedPath": "/log10-1.m" }, { "id": "log10:2", "builtinKey": "log10", "builtinTitle": "log10", "builtinSlug": "log10", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Computing base-10 logarithms of a matrix", "summary": "Base-10 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 10 100; 0.1 0.01 0.001];\nB = log10(A)", "output": "B = [0 1 2; -1 -2 -3]", "keywords": ["log10", "base-10 logarithm", "elementwise", "magnitude", "gpu"], "suggestedPath": "/log10-2.m" }, { "id": "log10:3", "builtinKey": "log10", "builtinTitle": "log10", "builtinSlug": "log10", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Understanding how `log10` handles zero", "summary": "Base-10 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "z = log10(0)", "output": "z = -Inf", "keywords": ["log10", "base-10 logarithm", "elementwise", "magnitude", "gpu"], "suggestedPath": "/log10-3.m" }, { "id": "log10:4", "builtinKey": "log10", "builtinTitle": "log10", "builtinSlug": "log10", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Working with negative inputs using complex results", "summary": "Base-10 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "neg = [-10 -100];\nout = log10(neg)", "output": "out = [1.0000 + 1.3644i, 2.0000 + 1.3644i]", "keywords": ["log10", "base-10 logarithm", "elementwise", "magnitude", "gpu"], "suggestedPath": "/log10-4.m" }, { "id": "log10:5", "builtinKey": "log10", "builtinTitle": "log10", "builtinSlug": "log10", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Running `log10` on GPU-resident data", "summary": "Base-10 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray([1 10 1000]);\nresult = log10(G);\nhost = gather(result)", "output": "host = [0 1 3]", "keywords": ["log10", "base-10 logarithm", "elementwise", "magnitude", "gpu"], "suggestedPath": "/log10-5.m" }, { "id": "log1p:1", "builtinKey": "log1p", "builtinTitle": "log1p", "builtinSlug": "log1p", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Protecting precision when adding tiny percentages", "summary": "Accurate element-wise computation of log(1 + x) for scalars, vectors, matrices, or N-D tensors.", "code": "delta = 1e-12;\nvalue = log1p(delta)", "output": "value = 9.999999999995e-13", "keywords": ["log1p", "log(1+x)", "natural logarithm", "elementwise", "gpu", "precision"], "suggestedPath": "/log1p-1.m" }, { "id": "log1p:2", "builtinKey": "log1p", "builtinTitle": "log1p", "builtinSlug": "log1p", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Computing log-growth factors from percentage changes", "summary": "Accurate element-wise computation of log(1 + x) for scalars, vectors, matrices, or N-D tensors.", "code": "rates = [-0.25 -0.10 0 0.10 0.25];\ngrowth = log1p(rates)", "output": "growth = [-0.2877 -0.1054 0 0.0953 0.2231]", "keywords": ["log1p", "log(1+x)", "natural logarithm", "elementwise", "gpu", "precision"], "suggestedPath": "/log1p-2.m" }, { "id": "log1p:3", "builtinKey": "log1p", "builtinTitle": "log1p", "builtinSlug": "log1p", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Handling the branch cut at x = -1", "summary": "Accurate element-wise computation of log(1 + x) for scalars, vectors, matrices, or N-D tensors.", "code": "y = log1p(-1)", "output": "y = -Inf", "keywords": ["log1p", "log(1+x)", "natural logarithm", "elementwise", "gpu", "precision"], "suggestedPath": "/log1p-3.m" }, { "id": "log1p:4", "builtinKey": "log1p", "builtinTitle": "log1p", "builtinSlug": "log1p", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Obtaining complex results for inputs less than -1", "summary": "Accurate element-wise computation of log(1 + x) for scalars, vectors, matrices, or N-D tensors.", "code": "data = [-2 -3 -5];\nresult = log1p(data)", "output": "result = [0.0000 + 3.1416i, 0.6931 + 3.1416i, 1.3863 + 3.1416i]", "keywords": ["log1p", "log(1+x)", "natural logarithm", "elementwise", "gpu", "precision"], "suggestedPath": "/log1p-4.m" }, { "id": "log1p:5", "builtinKey": "log1p", "builtinTitle": "log1p", "builtinSlug": "log1p", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Executing log1p on GPU arrays with automatic residency", "summary": "Accurate element-wise computation of log(1 + x) for scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray(linspace(-0.5, 0.5, 5));\nout = log1p(G);\nrealResult = gather(out)", "output": "realResult = [-0.6931 -0.2877 0 0.2231 0.4055]", "keywords": ["log1p", "log(1+x)", "natural logarithm", "elementwise", "gpu", "precision"], "suggestedPath": "/log1p-5.m" }, { "id": "log2:1", "builtinKey": "log2", "builtinTitle": "log2", "builtinSlug": "log2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Computing base-2 logarithms of powers of two", "summary": "Base-2 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "values = [1 2 4 8];\npowers = log2(values)", "output": "powers = [0 1 2 3]", "keywords": ["log2", "base-2 logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log2-1.m" }, { "id": "log2:2", "builtinKey": "log2", "builtinTitle": "log2", "builtinSlug": "log2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Understanding how `log2` handles zero", "summary": "Base-2 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "z = log2(0)", "output": "z = -Inf", "keywords": ["log2", "base-2 logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log2-2.m" }, { "id": "log2:3", "builtinKey": "log2", "builtinTitle": "log2", "builtinSlug": "log2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Working with negative inputs using complex results", "summary": "Base-2 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "neg = [-1 -2];\nout = log2(neg)", "output": "out = [0.0000 + 4.5324i 1.0000 + 4.5324i]", "keywords": ["log2", "base-2 logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log2-3.m" }, { "id": "log2:4", "builtinKey": "log2", "builtinTitle": "log2", "builtinSlug": "log2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Checking power-of-two exponents for matrix sizes", "summary": "Base-2 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "A = [64 128; 256 512];\nexponents = log2(A)", "output": "exponents = [6 7; 8 9]", "keywords": ["log2", "base-2 logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log2-4.m" }, { "id": "log2:5", "builtinKey": "log2", "builtinTitle": "log2", "builtinSlug": "log2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Running `log2` on GPU-resident data", "summary": "Base-2 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray([1 4 16 64]);\nresult = log2(G);\nhost = gather(result)", "output": "host = [0 2 4 6]", "keywords": ["log2", "base-2 logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log2-5.m" }, { "id": "log2:6", "builtinKey": "log2", "builtinTitle": "log2", "builtinSlug": "log2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Applying `log2` to character codes", "summary": "Base-2 logarithm of scalars, vectors, matrices, or N-D tensors.", "code": "C = 'ABC';\nvalues = log2(C)", "output": "values = [6.0224 6.0444 6.0661]", "keywords": ["log2", "base-2 logarithm", "elementwise", "gpu", "complex"], "suggestedPath": "/log2-6.m" }, { "id": "logical:1", "builtinKey": "logical", "builtinTitle": "logical", "builtinSlug": "logical", "category": "logical", "categoryPath": ["logical"], "exampleTitle": "Creating a logical mask from numeric data", "summary": "Convert scalars, arrays, and gpuArray values to MATLAB-compatible logical values.", "code": "values = [0 2 -3 0];\nmask = logical(values)", "output": "mask =\n 1×4 logical array\n 0 1 1 0", "keywords": ["logical", "boolean conversion", "truth mask", "gpuArray", "mask array"], "suggestedPath": "/logical-1.m" }, { "id": "logical:2", "builtinKey": "logical", "builtinTitle": "logical", "builtinSlug": "logical", "category": "logical", "categoryPath": ["logical"], "exampleTitle": "Building a logical mask from a matrix", "summary": "Convert scalars, arrays, and gpuArray values to MATLAB-compatible logical values.", "code": "M = [-4 0 8; 0 1 0];\nmask = logical(M)", "output": "mask =\n 2×3 logical array\n 1 0 1\n 0 1 0", "keywords": ["logical", "boolean conversion", "truth mask", "gpuArray", "mask array"], "suggestedPath": "/logical-2.m" }, { "id": "logical:3", "builtinKey": "logical", "builtinTitle": "logical", "builtinSlug": "logical", "category": "logical", "categoryPath": ["logical"], "exampleTitle": "Treating NaN and Inf values as true", "summary": "Convert scalars, arrays, and gpuArray values to MATLAB-compatible logical values.", "code": "flags = logical([NaN Inf 0])", "output": "flags =\n 1×3 logical array\n 1 1 0", "keywords": ["logical", "boolean conversion", "truth mask", "gpuArray", "mask array"], "suggestedPath": "/logical-3.m" }, { "id": "logical:4", "builtinKey": "logical", "builtinTitle": "logical", "builtinSlug": "logical", "category": "logical", "categoryPath": ["logical"], "exampleTitle": "Converting complex numbers to logical scalars", "summary": "Convert scalars, arrays, and gpuArray values to MATLAB-compatible logical values.", "code": "z = logical(3 + 4i);\nw = logical(0 + 0i)", "output": "z =\n 1\nw =\n 0", "keywords": ["logical", "boolean conversion", "truth mask", "gpuArray", "mask array"], "suggestedPath": "/logical-4.m" }, { "id": "logical:5", "builtinKey": "logical", "builtinTitle": "logical", "builtinSlug": "logical", "category": "logical", "categoryPath": ["logical"], "exampleTitle": "Converting character arrays to logical values", "summary": "Convert scalars, arrays, and gpuArray values to MATLAB-compatible logical values.", "code": "chars = ['A' 0 'C'];\nmask = logical(chars)", "output": "mask =\n 1×3 logical array\n 1 0 1", "keywords": ["logical", "boolean conversion", "truth mask", "gpuArray", "mask array"], "suggestedPath": "/logical-5.m" }, { "id": "logical:6", "builtinKey": "logical", "builtinTitle": "logical", "builtinSlug": "logical", "category": "logical", "categoryPath": ["logical"], "exampleTitle": "Keeping gpuArray inputs on the device", "summary": "Convert scalars, arrays, and gpuArray values to MATLAB-compatible logical values.", "code": "G = gpuArray([0 1 2]);\nmaskGPU = logical(G);\nhostMask = gather(maskGPU)", "output": "hostMask =\n 1×3 logical array\n 0 1 1", "keywords": ["logical", "boolean conversion", "truth mask", "gpuArray", "mask array"], "suggestedPath": "/logical-6.m" }, { "id": "logical:7", "builtinKey": "logical", "builtinTitle": "logical", "builtinSlug": "logical", "category": "logical", "categoryPath": ["logical"], "exampleTitle": "Preserving empty shapes through logical conversion", "summary": "Convert scalars, arrays, and gpuArray values to MATLAB-compatible logical values.", "code": "emptyVec = zeros(0, 3);\nlogicalEmpty = logical(emptyVec)", "output": "logicalEmpty =\n 0×3 logical array\n []", "keywords": ["logical", "boolean conversion", "truth mask", "gpuArray", "mask array"], "suggestedPath": "/logical-7.m" }, { "id": "loglog:1", "builtinKey": "loglog", "builtinTitle": "loglog", "builtinSlug": "loglog", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Plot a power-law curve on logarithmic axes", "summary": "Plot data on logarithmic x and y axes for power laws, scaling analysis, and MATLAB `loglog` comparisons.", "code": "x = logspace(0, 3, 200);\nloglog(x, x.^(-1.5));", "keywords": ["loglog", "log-log plot", "power law plot", "matlab loglog", "scaling analysis"], "suggestedPath": "/loglog-1.m" }, { "id": "loglog:2", "builtinKey": "loglog", "builtinTitle": "loglog", "builtinSlug": "loglog", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Compare multiple scaling laws", "summary": "Plot data on logarithmic x and y axes for power laws, scaling analysis, and MATLAB `loglog` comparisons.", "code": "x = logspace(0, 3, 200);\nh1 = loglog(x, x.^(-1));\nset(h1, 'DisplayName', 'x^{-1}');\nhold on;\nh2 = loglog(x, x.^(-2));\nset(h2, 'DisplayName', 'x^{-2}');\nlegend;", "keywords": ["loglog", "log-log plot", "power law plot", "matlab loglog", "scaling analysis"], "suggestedPath": "/loglog-2.m" }, { "id": "loglog:3", "builtinKey": "loglog", "builtinTitle": "loglog", "builtinSlug": "loglog", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect both axes after plotting", "summary": "Plot data on logarithmic x and y axes for power laws, scaling analysis, and MATLAB `loglog` comparisons.", "code": "x = logspace(0, 2, 50);\nloglog(x, x.^2);\nax = gca;\nxscale = get(ax, 'XScale');\nyscale = get(ax, 'YScale');", "output": "% Both axes report 'log'", "keywords": ["loglog", "log-log plot", "power law plot", "matlab loglog", "scaling analysis"], "suggestedPath": "/loglog-3.m" }, { "id": "logspace:1", "builtinKey": "logspace", "builtinTitle": "logspace", "builtinSlug": "logspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating decades between 10 and 1000", "summary": "Generate logarithmically spaced row vectors that mirror MATLAB behavior.", "code": "x = logspace(1, 3, 3)", "output": "x = [10 100 1000]", "keywords": ["logspace", "logarithmic", "vector", "decade", "gpu", "frequency"], "suggestedPath": "/logspace-1.m" }, { "id": "logspace:2", "builtinKey": "logspace", "builtinTitle": "logspace", "builtinSlug": "logspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Generating logarithmic spacing with the default 50 points", "summary": "Generate logarithmically spaced row vectors that mirror MATLAB behavior.", "code": "f = logspace(1, 4)", "output": "% f is a 1x50 row vector spanning [10, 10^4]\ndisp(f(1));\ndisp(f(end))", "keywords": ["logspace", "logarithmic", "vector", "decade", "gpu", "frequency"], "suggestedPath": "/logspace-2.m" }, { "id": "logspace:3", "builtinKey": "logspace", "builtinTitle": "logspace", "builtinSlug": "logspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Requesting a single logarithmic sample", "summary": "Generate logarithmically spaced row vectors that mirror MATLAB behavior.", "code": "edge = logspace(-3, 2, 1)", "output": "edge = 100", "keywords": ["logspace", "logarithmic", "vector", "decade", "gpu", "frequency"], "suggestedPath": "/logspace-3.m" }, { "id": "logspace:4", "builtinKey": "logspace", "builtinTitle": "logspace", "builtinSlug": "logspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Building a swept frequency vector on the GPU", "summary": "Generate logarithmically spaced row vectors that mirror MATLAB behavior.", "code": "lo = gpuArray(0);\nhi = gpuArray(3);\nfreq = logspace(lo, hi, 256);\nresp = sin(2*pi*freq)", "output": "% freq and resp remain on the GPU when an acceleration provider is active.\ndisp(gather(freq(1:5)))", "keywords": ["logspace", "logarithmic", "vector", "decade", "gpu", "frequency"], "suggestedPath": "/logspace-4.m" }, { "id": "logspace:5", "builtinKey": "logspace", "builtinTitle": "logspace", "builtinSlug": "logspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Producing complex logarithmic spacing", "summary": "Generate logarithmically spaced row vectors that mirror MATLAB behavior.", "code": "z = logspace(1+1i, 2+2i, 4)", "output": "% Complex row vector with magnitudes and phases progressing logarithmically\ndisp(z)", "keywords": ["logspace", "logarithmic", "vector", "decade", "gpu", "frequency"], "suggestedPath": "/logspace-5.m" }, { "id": "logspace:6", "builtinKey": "logspace", "builtinTitle": "logspace", "builtinSlug": "logspace", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Matching MATLAB's legacy `logspace(a, pi, n)` syntax", "summary": "Generate logarithmically spaced row vectors that mirror MATLAB behavior.", "code": "theta = logspace(-1, pi, 5)", "output": "% Interprets pi literally: theta(end) == 10^pi\ndisp(theta(end))", "keywords": ["logspace", "logarithmic", "vector", "decade", "gpu", "frequency"], "suggestedPath": "/logspace-6.m" }, { "id": "lower:1", "builtinKey": "lower", "builtinTitle": "lower", "builtinSlug": "lower", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Convert A String Scalar To Lowercase", "summary": "Convert strings, character arrays, and cell arrays of character vectors to lowercase.", "code": "txt = \"RunMat\";\nresult = lower(txt)", "output": "result = \"runmat\"", "keywords": ["lower", "lowercase", "convert to lowercase", "string case", "character arrays"], "suggestedPath": "/lower-1.m" }, { "id": "lower:2", "builtinKey": "lower", "builtinTitle": "lower", "builtinSlug": "lower", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Lowercase Each Element Of A String Array", "summary": "Convert strings, character arrays, and cell arrays of character vectors to lowercase.", "code": "labels = [\"NORTH\" \"South\"; \"EaSt\" \"WEST\"];\nlowered = lower(labels)", "output": "lowered = 2×2 string\n \"north\" \"south\"\n \"east\" \"west\"", "keywords": ["lower", "lowercase", "convert to lowercase", "string case", "character arrays"], "suggestedPath": "/lower-2.m" }, { "id": "lower:3", "builtinKey": "lower", "builtinTitle": "lower", "builtinSlug": "lower", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Lowercase Character Array Rows While Preserving Shape", "summary": "Convert strings, character arrays, and cell arrays of character vectors to lowercase.", "code": "animals = char(\"CAT\", \"DOGE\");\nresult = lower(animals)", "output": "result =\n\n 2×4 char array\n\n 'cat '\n 'doge'", "keywords": ["lower", "lowercase", "convert to lowercase", "string case", "character arrays"], "suggestedPath": "/lower-3.m" }, { "id": "lower:4", "builtinKey": "lower", "builtinTitle": "lower", "builtinSlug": "lower", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Lowercase A Cell Array Of Character Vectors", "summary": "Convert strings, character arrays, and cell arrays of character vectors to lowercase.", "code": "C = {'HELLO', 'World'};\nout = lower(C)", "output": "out = 1×2 cell array\n {'hello'} {'world'}", "keywords": ["lower", "lowercase", "convert to lowercase", "string case", "character arrays"], "suggestedPath": "/lower-4.m" }, { "id": "lower:5", "builtinKey": "lower", "builtinTitle": "lower", "builtinSlug": "lower", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Keep Missing Strings As Missing", "summary": "Convert strings, character arrays, and cell arrays of character vectors to lowercase.", "code": "vals = string([\"DATA\" \"<missing>\" \"GPU\"]);\nconverted = lower(vals)", "output": "converted = 1×3 string\n \"data\" <missing> \"gpu\"", "keywords": ["lower", "lowercase", "convert to lowercase", "string case", "character arrays"], "suggestedPath": "/lower-5.m" }, { "id": "lower:6", "builtinKey": "lower", "builtinTitle": "lower", "builtinSlug": "lower", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Lowercase Text Stored On A GPU Input", "summary": "Convert strings, character arrays, and cell arrays of character vectors to lowercase.", "code": "codes = gpuArray(uint16('RUNMAT'));\ntxt = char(gather(codes));\nresult = lower(txt)", "output": "result = 'runmat'", "keywords": ["lower", "lowercase", "convert to lowercase", "string case", "character arrays"], "suggestedPath": "/lower-6.m" }, { "id": "ls:1", "builtinKey": "ls", "builtinTitle": "ls", "builtinSlug": "ls", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "List Files In The Current Folder", "summary": "List files and folders in the current directory or matching a wildcard pattern.", "code": "fid = fopen(\"README.md\", \"w\"); fclose(fid);\nmkdir(\"src\");\nmkdir(\"tests\");\nls", "output": "README.md\nsrc/\ntests/", "keywords": ["ls", "list files", "folder contents", "wildcard listing", "dir"], "suggestedPath": "/ls-1.m" }, { "id": "ls:2", "builtinKey": "ls", "builtinTitle": "ls", "builtinSlug": "ls", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "List Only MATLAB Files Using Wildcards", "summary": "List files and folders in the current directory or matching a wildcard pattern.", "code": "fid = fopen(\"script.m\", \"w\"); fclose(fid);\nfid = fopen(\"solver.m\", \"w\"); fclose(fid);\nfid = fopen(\"test_helper.m\", \"w\"); fclose(fid);\nls(\"*.m\")", "output": "script.m\nsolver.m\ntest_helper.m", "keywords": ["ls", "list files", "folder contents", "wildcard listing", "dir"], "suggestedPath": "/ls-2.m" }, { "id": "ls:3", "builtinKey": "ls", "builtinTitle": "ls", "builtinSlug": "ls", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Capture A Directory Listing In A Variable", "summary": "List files and folders in the current directory or matching a wildcard pattern.", "code": "fid = fopen(\"README.md\", \"w\"); fclose(fid);\nlisting = ls;\ndisp(listing(1, :)); % Display the first entry", "output": "README.md", "keywords": ["ls", "list files", "folder contents", "wildcard listing", "dir"], "suggestedPath": "/ls-3.m" }, { "id": "ls:4", "builtinKey": "ls", "builtinTitle": "ls", "builtinSlug": "ls", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "List The Contents Of A Specific Folder", "summary": "List files and folders in the current directory or matching a wildcard pattern.", "code": "mkdir(\"tmp\");\nfid = fopen(fullfile(\"tmp\", \"tmpfile.txt\"), \"w\"); fclose(fid);\nmkdir(fullfile(\"tmp\", \"subdir\"));\ntempDir = fullfile(pwd, \"tmp\");\nls(tempDir)", "output": "tmpfile.txt\nsubdir/", "keywords": ["ls", "list files", "folder contents", "wildcard listing", "dir"], "suggestedPath": "/ls-4.m" }, { "id": "ls:5", "builtinKey": "ls", "builtinTitle": "ls", "builtinSlug": "ls", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use Wildcards With Nested Paths", "summary": "List files and folders in the current directory or matching a wildcard pattern.", "code": "mkdir(fullfile(\"src\", \"utils\"));\nfid = fopen(fullfile(\"src\", \"main.rs\"), \"w\"); fclose(fid);\nfid = fopen(fullfile(\"src\", \"utils\", \"helpers.rs\"), \"w\"); fclose(fid);\nls(\"src/**/*.rs\")", "output": "src/main.rs\nsrc/utils/helpers.rs", "keywords": ["ls", "list files", "folder contents", "wildcard listing", "dir"], "suggestedPath": "/ls-5.m" }, { "id": "ls:6", "builtinKey": "ls", "builtinTitle": "ls", "builtinSlug": "ls", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handle Missing Matches Gracefully", "summary": "List files and folders in the current directory or matching a wildcard pattern.", "code": "if isempty(ls(\"*.tmp\"))\n disp(\"No temporary files found.\");\nend", "output": "No temporary files found.", "keywords": ["ls", "list files", "folder contents", "wildcard listing", "dir"], "suggestedPath": "/ls-6.m" }, { "id": "ls:7", "builtinKey": "ls", "builtinTitle": "ls", "builtinSlug": "ls", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Combine `ls` With `cd` For Temporary Directory Changes", "summary": "List files and folders in the current directory or matching a wildcard pattern.", "code": "mkdir(\"examples\");\nfid = fopen(fullfile(\"examples\", \"animation.m\"), \"w\"); fclose(fid);\nfid = fopen(fullfile(\"examples\", \"plot_surface.m\"), \"w\"); fclose(fid);\nstart = cd(\"examples\");\ncleanup = onCleanup(@() cd(start));\nfiles = ls(\"*.m\")", "output": "animation.m\nplot_surface.m", "keywords": ["ls", "list files", "folder contents", "wildcard listing", "dir"], "suggestedPath": "/ls-7.m" }, { "id": "lt:1", "builtinKey": "lt", "builtinTitle": "lt", "builtinSlug": "lt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Determine Whether One Scalar Is Less Than Another", "summary": "Element-wise less-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "flag = lt(17, 42)", "output": "flag =\n 1", "keywords": ["lt", "<", "less than", "logical comparison", "gpuArray less-than"], "suggestedPath": "/lt-1.m" }, { "id": "lt:2", "builtinKey": "lt", "builtinTitle": "lt", "builtinSlug": "lt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Filter Matrix Elements Below A Threshold", "summary": "Element-wise less-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "M = [1 2 3; 4 5 6];\nmask = lt(M, 3)", "output": "mask =\n 2×3 logical array\n 1 1 0\n 0 0 0", "keywords": ["lt", "<", "less than", "logical comparison", "gpuArray less-than"], "suggestedPath": "/lt-2.m" }, { "id": "lt:3", "builtinKey": "lt", "builtinTitle": "lt", "builtinSlug": "lt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Apply Less-Than With Implicit Expansion", "summary": "Element-wise less-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "v = [1 3 5 7];\nmask = lt(v, [2 6])", "output": "mask =\n 1×4 logical array\n 1 0 0 0", "keywords": ["lt", "<", "less than", "logical comparison", "gpuArray less-than"], "suggestedPath": "/lt-3.m" }, { "id": "lt:4", "builtinKey": "lt", "builtinTitle": "lt", "builtinSlug": "lt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare Character Data To Numeric Codes", "summary": "Element-wise less-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "letters = ['A' 'B' 'C'];\nisBeforeC = lt(letters, 67)", "output": "isBeforeC =\n 1×3 logical array\n 1 1 0", "keywords": ["lt", "<", "less than", "logical comparison", "gpuArray less-than"], "suggestedPath": "/lt-4.m" }, { "id": "lt:5", "builtinKey": "lt", "builtinTitle": "lt", "builtinSlug": "lt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Compare String Arrays Lexicographically", "summary": "Element-wise less-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "names = [\"alice\" \"charlie\" \"bob\"];\nearlier = lt(names, \"bob\")", "output": "earlier =\n 1×3 logical array\n 1 0 0", "keywords": ["lt", "<", "less than", "logical comparison", "gpuArray less-than"], "suggestedPath": "/lt-5.m" }, { "id": "lt:6", "builtinKey": "lt", "builtinTitle": "lt", "builtinSlug": "lt", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Run `lt` Directly On `gpuArray` Inputs", "summary": "Element-wise less-than comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "G1 = gpuArray([1 4 7]);\nG2 = gpuArray([2 4 8]);\ndeviceResult = lt(G1, G2);\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1×3 gpuArray logical array\n 1 0 1\nhostResult =\n 1×3 logical array\n 1 0 1", "keywords": ["lt", "<", "less than", "logical comparison", "gpuArray less-than"], "suggestedPath": "/lt-6.m" }, { "id": "lu:1", "builtinKey": "lu", "builtinTitle": "lu", "builtinSlug": "lu", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Factorizing a square matrix with `lu`", "summary": "LU decomposition with partial pivoting, matching MATLAB semantics.", "code": "A = [2 1 1; 4 -6 0; -2 7 2];\n[L, U, P] = lu(A)", "output": "L =\n 1 0 0\n -1 1 0\n 0 -1 1\n\nU =\n 4 -6 0\n 0 1 1\n 0 0 3\n\nP =\n 0 1 0\n 1 0 0\n 0 0 1", "keywords": ["lu", "factorization", "decomposition", "lower-upper", "permutation"], "suggestedPath": "/lu-1.m" }, { "id": "lu:2", "builtinKey": "lu", "builtinTitle": "lu", "builtinSlug": "lu", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Obtaining only the combined LU factor", "summary": "LU decomposition with partial pivoting, matching MATLAB semantics.", "code": "LU = lu([1 3 5; 2 4 7; 1 1 0])", "output": "LU =\n 2 4 7\n 0.5 1 -1.5\n 0.5 -0.5 2", "keywords": ["lu", "factorization", "decomposition", "lower-upper", "permutation"], "suggestedPath": "/lu-2.m" }, { "id": "lu:3", "builtinKey": "lu", "builtinTitle": "lu", "builtinSlug": "lu", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Requesting the permutation vector with the `'vector'` option", "summary": "LU decomposition with partial pivoting, matching MATLAB semantics.", "code": "[L, U, p] = lu([4 3; 6 3], 'vector')", "output": "p =\n 2\n 1", "keywords": ["lu", "factorization", "decomposition", "lower-upper", "permutation"], "suggestedPath": "/lu-3.m" }, { "id": "lu:4", "builtinKey": "lu", "builtinTitle": "lu", "builtinSlug": "lu", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "LU factorization of a rectangular matrix", "summary": "LU decomposition with partial pivoting, matching MATLAB semantics.", "code": "A = [3 1 2; 6 3 4];\n[L, U, P] = lu(A)", "output": "L =\n 1 0\n 0.5 1\n\nU =\n 6 3 4\n 0 -0.5 0\n\nP =\n 0 1\n 1 0", "keywords": ["lu", "factorization", "decomposition", "lower-upper", "permutation"], "suggestedPath": "/lu-4.m" }, { "id": "lu:5", "builtinKey": "lu", "builtinTitle": "lu", "builtinSlug": "lu", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Using LU factors to solve a linear system", "summary": "LU decomposition with partial pivoting, matching MATLAB semantics.", "code": "A = [3 1 2; 6 3 4];\nb = [1; 2];\n[L, U, P] = lu(A);\ny = L \\ (P * b);\nx = U \\ y", "output": "x =\n 0.0\n 0.5\n -0.0", "keywords": ["lu", "factorization", "decomposition", "lower-upper", "permutation"], "suggestedPath": "/lu-5.m" }, { "id": "lu:6", "builtinKey": "lu", "builtinTitle": "lu", "builtinSlug": "lu", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Running `lu` on a `gpuArray`", "summary": "LU decomposition with partial pivoting, matching MATLAB semantics.", "code": "G = gpuArray([10 7; 3 2]);\n[L, U, P] = lu(G);\nclass(L)\nclass(U)\nclass(P)", "output": "ans =\n 'gpuArray'\n\nans =\n 'gpuArray'\n\nans =\n 'gpuArray'", "keywords": ["lu", "factorization", "decomposition", "lower-upper", "permutation"], "suggestedPath": "/lu-6.m" }, { "id": "magic:1", "builtinKey": "magic", "builtinTitle": "magic", "builtinSlug": "magic", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "A 3x3 magic square", "summary": "Generate an n-by-n magic square.", "code": "M = magic(3)", "output": "M =\n 8 1 6\n 3 5 7\n 4 9 2", "keywords": ["magic", "magic square", "matrix", "array"], "suggestedPath": "/magic-1.m" }, { "id": "magic:2", "builtinKey": "magic", "builtinTitle": "magic", "builtinSlug": "magic", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "A 4x4 magic square", "summary": "Generate an n-by-n magic square.", "code": "M = magic(4)", "output": "M =\n 16 2 3 13\n 5 11 10 8\n 9 7 6 12\n 4 14 15 1", "keywords": ["magic", "magic square", "matrix", "array"], "suggestedPath": "/magic-2.m" }, { "id": "magic:3", "builtinKey": "magic", "builtinTitle": "magic", "builtinSlug": "magic", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Use magic squares as structured input", "summary": "Generate an n-by-n magic square.", "code": "A = magic(5);\nresult = A * A'", "keywords": ["magic", "magic square", "matrix", "array"], "suggestedPath": "/magic-3.m" }, { "id": "mat2cell:1", "builtinKey": "mat2cell", "builtinTitle": "mat2cell", "builtinSlug": "mat2cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Splitting a matrix into four quadrants", "summary": "Split arrays into cell-array blocks using MATLAB-compatible dimension partitions.", "code": "A = reshape(1:16, 4, 4);\nC = mat2cell(A, [2 2], [1 3])", "output": "size(C) % => [2 2]\ndouble(C{2,2}) % => [7 11 15; 8 12 16]", "keywords": ["mat2cell", "cell array", "partition", "submatrix", "block slicing", "gpu fallback"], "suggestedPath": "/mat2cell-1.m" }, { "id": "mat2cell:2", "builtinKey": "mat2cell", "builtinTitle": "mat2cell", "builtinSlug": "mat2cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Splitting a column vector with only row sizes", "summary": "Split arrays into cell-array blocks using MATLAB-compatible dimension partitions.", "code": "v = (1:6)';\nblocks = mat2cell(v, [2 1 3])", "output": "cellfun(@numel, blocks) % => [2; 1; 3]\nblocks{3} % => [4; 5; 6]", "keywords": ["mat2cell", "cell array", "partition", "submatrix", "block slicing", "gpu fallback"], "suggestedPath": "/mat2cell-2.m" }, { "id": "mat2cell:3", "builtinKey": "mat2cell", "builtinTitle": "mat2cell", "builtinSlug": "mat2cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Partitioning a 3-D tensor", "summary": "Split arrays into cell-array blocks using MATLAB-compatible dimension partitions.", "code": "T = reshape(1:24, [3 4 2]);\nC = mat2cell(T, [1 2], [2 2], [1 1])", "output": "size(C) % => [2 2 2]\ndouble(C{2,1,2}(:,:,1)) % => [14 17; 15 18]", "keywords": ["mat2cell", "cell array", "partition", "submatrix", "block slicing", "gpu fallback"], "suggestedPath": "/mat2cell-3.m" }, { "id": "mat2cell:4", "builtinKey": "mat2cell", "builtinTitle": "mat2cell", "builtinSlug": "mat2cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Using zero-sized blocks", "summary": "Split arrays into cell-array blocks using MATLAB-compatible dimension partitions.", "code": "E = zeros(3, 2);\nC = mat2cell(E, [0 3], [1 1]);\ncellfun(@size, C, 'UniformOutput', false)", "output": "ans{1,1} = [0 1]\nans{1,2} = [0 1]\nans{2,1} = [3 1]\nans{2,2} = [3 1]", "keywords": ["mat2cell", "cell array", "partition", "submatrix", "block slicing", "gpu fallback"], "suggestedPath": "/mat2cell-4.m" }, { "id": "mat2cell:5", "builtinKey": "mat2cell", "builtinTitle": "mat2cell", "builtinSlug": "mat2cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Splitting a character matrix into rows", "summary": "Split arrays into cell-array blocks using MATLAB-compatible dimension partitions.", "code": "names = ['foo '; 'bar '; 'baz '];\nC = mat2cell(names, [1 2], size(names, 2))", "output": "C{1,1} % => 'foo '\nC{2,1} % => ['bar '; 'baz ']", "keywords": ["mat2cell", "cell array", "partition", "submatrix", "block slicing", "gpu fallback"], "suggestedPath": "/mat2cell-5.m" }, { "id": "mat2cell:6", "builtinKey": "mat2cell", "builtinTitle": "mat2cell", "builtinSlug": "mat2cell", "category": "cells/core", "categoryPath": ["cells", "core"], "exampleTitle": "Working with logical arrays", "summary": "Split arrays into cell-array blocks using MATLAB-compatible dimension partitions.", "code": "mask = logical([1 0 1; 0 1 0]);\ncells = mat2cell(mask, 2, [1 1 1])", "output": "cells{1,2} % => logical column vector [0; 1]\nclass(cells{1,2}) % => 'logical'", "keywords": ["mat2cell", "cell array", "partition", "submatrix", "block slicing", "gpu fallback"], "suggestedPath": "/mat2cell-6.m" }, { "id": "max:1", "builtinKey": "max", "builtinTitle": "max", "builtinSlug": "max", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Finding column-wise maxima of a matrix", "summary": "Return the maximum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [3 1 5; 4 2 6];\n[m, idx] = max(A)", "output": "m = [4 2 6];\nidx = [2 2 2]", "keywords": ["max", "maximum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/max-1.m" }, { "id": "max:2", "builtinKey": "max", "builtinTitle": "max", "builtinSlug": "max", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Reducing along the second dimension", "summary": "Return the maximum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [3 1 5; 4 2 6];\n[m, idx] = max(A, [], 2)", "output": "m = [5; 6];\nidx = [3; 3]", "keywords": ["max", "maximum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/max-2.m" }, { "id": "max:3", "builtinKey": "max", "builtinTitle": "max", "builtinSlug": "max", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Collapsing all elements with linear indices", "summary": "Return the maximum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = reshape(1:12, [3 4]);\n[m, idx] = max(A, [], 'all')", "output": "m = 12;\nidx = 12; % linear index into A(:)", "keywords": ["max", "maximum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/max-3.m" }, { "id": "max:4", "builtinKey": "max", "builtinTitle": "max", "builtinSlug": "max", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring NaN values during reduction", "summary": "Return the maximum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "values = [NaN 4 2; 3 NaN 1];\n[m, idx] = max(values, [], 1, 'omitnan')", "output": "m = [3 4 2];\nidx = [2 1 1]", "keywords": ["max", "maximum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/max-4.m" }, { "id": "max:5", "builtinKey": "max", "builtinTitle": "max", "builtinSlug": "max", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Elementwise maximum with broadcasting", "summary": "Return the maximum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [1 4 7];\nB = [2; 3; 5];\n[C, origin] = max(A, B)", "output": "C =\n 2 4 7\n 3 4 7\n 5 5 7\n\norigin =\n 2 1 1\n 2 1 1\n 2 2 1", "keywords": ["max", "maximum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/max-5.m" }, { "id": "max:6", "builtinKey": "max", "builtinTitle": "max", "builtinSlug": "max", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Comparing complex values by magnitude", "summary": "Return the maximum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "Z = [1+2i, 2+1i, -2+2i];\nM = max(Z); % magnitude ordering\nR = max(Z, [], 'ComparisonMethod', 'real')", "output": "M = -2.0000 + 2.0000i\nR = 2.0000 + 1.0000i", "keywords": ["max", "maximum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/max-6.m" }, { "id": "mean:1", "builtinKey": "mean", "builtinTitle": "mean", "builtinSlug": "mean", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Computing the mean of a matrix", "summary": "Average elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [1 2 3; 4 5 6];\ncolMeans = mean(A); % column averages\nrowMeans = mean(A, 2); % row averages", "output": "colMeans = [2.5 3.5 4.5];\nrowMeans = [2; 5]", "keywords": ["mean", "average", "reduction", "gpu", "omitnan", "like", "native"], "suggestedPath": "/mean-1.m" }, { "id": "mean:2", "builtinKey": "mean", "builtinTitle": "mean", "builtinSlug": "mean", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Computing the mean of a vector with NaN values", "summary": "Average elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "values = [1 NaN 3];\navg = mean(values, 'omitnan')", "output": "avg = 2", "keywords": ["mean", "average", "reduction", "gpu", "omitnan", "like", "native"], "suggestedPath": "/mean-2.m" }, { "id": "mean:3", "builtinKey": "mean", "builtinTitle": "mean", "builtinSlug": "mean", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Computing the overall mean across all elements", "summary": "Average elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "B = reshape(1:12, [3 4]);\noverall = mean(B, 'all')", "output": "overall = 6.5", "keywords": ["mean", "average", "reduction", "gpu", "omitnan", "like", "native"], "suggestedPath": "/mean-3.m" }, { "id": "mean:4", "builtinKey": "mean", "builtinTitle": "mean", "builtinSlug": "mean", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Reducing across multiple dimensions at once", "summary": "Average elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "C = cat(3, [1 2; 3 4], [5 6; 7 8]);\nslice_means = mean(C, [1 3]); % reduce rows and pages, keep columns", "output": "slice_means = [4 5]", "keywords": ["mean", "average", "reduction", "gpu", "omitnan", "like", "native"], "suggestedPath": "/mean-4.m" }, { "id": "mean:5", "builtinKey": "mean", "builtinTitle": "mean", "builtinSlug": "mean", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Matching a prototype with `'like'`", "summary": "Average elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "G = gpuArray(single([1 3; 5 7]));\nmu = mean(G, 'all', 'like', G);\nresult = gather(mu)", "output": "result = single(4)", "keywords": ["mean", "average", "reduction", "gpu", "omitnan", "like", "native"], "suggestedPath": "/mean-5.m" }, { "id": "mean:6", "builtinKey": "mean", "builtinTitle": "mean", "builtinSlug": "mean", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Computing the mean of a matrix on a GPU", "summary": "Average elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "G = gpuArray([1 2 NaN; 3 4 5]);\nmeans = mean(G, 2, 'omitnan');\nresult = gather(means)", "output": "result = [1.5; 4]", "keywords": ["mean", "average", "reduction", "gpu", "omitnan", "like", "native"], "suggestedPath": "/mean-6.m" }, { "id": "median:1", "builtinKey": "median", "builtinTitle": "median", "builtinSlug": "median", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Finding the median of an odd-length vector", "summary": "Median of scalars, vectors, matrices, or N-D tensors.", "code": "x = [7 2 9 4 5];\nm = median(x)", "output": "m = 5", "keywords": ["median", "reduction", "omitnan", "includenan", "statistics", "gpu"], "suggestedPath": "/median-1.m" }, { "id": "median:2", "builtinKey": "median", "builtinTitle": "median", "builtinSlug": "median", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Computing the median of an even-length vector with averaging", "summary": "Median of scalars, vectors, matrices, or N-D tensors.", "code": "x = [1 4 9 10];\nm = median(x)", "output": "m = 6.5", "keywords": ["median", "reduction", "omitnan", "includenan", "statistics", "gpu"], "suggestedPath": "/median-2.m" }, { "id": "median:3", "builtinKey": "median", "builtinTitle": "median", "builtinSlug": "median", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Column-wise median of a matrix", "summary": "Median of scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 3 5; 7 9 11; 2 4 6];\ncolMedians = median(A)", "output": "colMedians = [2 4 6]", "keywords": ["median", "reduction", "omitnan", "includenan", "statistics", "gpu"], "suggestedPath": "/median-3.m" }, { "id": "median:4", "builtinKey": "median", "builtinTitle": "median", "builtinSlug": "median", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Row medians while ignoring NaN values", "summary": "Median of scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 NaN 3; 4 5 NaN];\nrowMedians = median(A, 2, 'omitnan')", "output": "rowMedians = [2; 4.5]", "keywords": ["median", "reduction", "omitnan", "includenan", "statistics", "gpu"], "suggestedPath": "/median-4.m" }, { "id": "median:5", "builtinKey": "median", "builtinTitle": "median", "builtinSlug": "median", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Median of all elements in a matrix", "summary": "Median of scalars, vectors, matrices, or N-D tensors.", "code": "A = reshape(1:6, [3 2]);\noverall = median(A, 'all')", "output": "overall = 3.5", "keywords": ["median", "reduction", "omitnan", "includenan", "statistics", "gpu"], "suggestedPath": "/median-5.m" }, { "id": "median:6", "builtinKey": "median", "builtinTitle": "median", "builtinSlug": "median", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Median of all elements on a GPU-backed tensor", "summary": "Median of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray(randn(2048, 2048));\noverall = median(G, 'omitnan');\nresult = gather(overall)", "keywords": ["median", "reduction", "omitnan", "includenan", "statistics", "gpu"], "suggestedPath": "/median-6.m" }, { "id": "mesh:1", "builtinKey": "mesh", "builtinTitle": "mesh", "builtinSlug": "mesh", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a wireframe mesh from a height field", "summary": "Create wireframe surface plots for grids, height fields, and MATLAB `mesh` style visualization.", "code": "[X, Y] = meshgrid(linspace(-2, 2, 60), linspace(-2, 2, 60));\nZ = sin(X.^2 + Y.^2);\nmesh(X, Y, Z);", "keywords": ["mesh", "wireframe plot", "wireframe surface", "matlab mesh", "3-D grid visualization"], "suggestedPath": "/mesh-1.m" }, { "id": "mesh:2", "builtinKey": "mesh", "builtinTitle": "mesh", "builtinSlug": "mesh", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Compare wireframe presentation with subplot-local state", "summary": "Create wireframe surface plots for grids, height fields, and MATLAB `mesh` style visualization.", "code": "subplot(1, 2, 1);\n[X, Y] = meshgrid(linspace(-2, 2, 40), linspace(-2, 2, 40));\nZ = cos(X) .* sin(Y);\nmesh(X, Y, Z);\nview(3);\nsubplot(1, 2, 2);\nsurf(X, Y, Z);\nview(3);", "keywords": ["mesh", "wireframe plot", "wireframe surface", "matlab mesh", "3-D grid visualization"], "suggestedPath": "/mesh-2.m" }, { "id": "mesh:3", "builtinKey": "mesh", "builtinTitle": "mesh", "builtinSlug": "mesh", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect the returned surface handle from mesh", "summary": "Create wireframe surface plots for grids, height fields, and MATLAB `mesh` style visualization.", "code": "[X, Y] = meshgrid(1:20, 1:20);\nZ = X + Y;\nh = mesh(X, Y, Z);\nget(h, 'Type')", "output": "ans =\n 'surface'", "keywords": ["mesh", "wireframe plot", "wireframe surface", "matlab mesh", "3-D grid visualization"], "suggestedPath": "/mesh-3.m" }, { "id": "meshc:1", "builtinKey": "meshc", "builtinTitle": "meshc", "builtinSlug": "meshc", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a wireframe surface with contour overlays", "summary": "Create composite wireframe-and-contour plots for scalar fields with MATLAB `meshc` semantics and contour overlays.", "code": "[X, Y] = meshgrid(linspace(-2, 2, 50), linspace(-2, 2, 50));\nZ = sin(X.^2 + Y.^2);\nmeshc(X, Y, Z);", "keywords": ["meshc", "mesh with contour", "wireframe contour plot", "composite mesh plot", "matlab meshc"], "suggestedPath": "/meshc-1.m" }, { "id": "meshc:2", "builtinKey": "meshc", "builtinTitle": "meshc", "builtinSlug": "meshc", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Compare wireframe/composite behavior with camera controls", "summary": "Create composite wireframe-and-contour plots for scalar fields with MATLAB `meshc` semantics and contour overlays.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 60), linspace(-3, 3, 60));\nZ = cos(X) .* sin(Y);\nh = meshc(X, Y, Z);\nview(3);\ncolormap('parula');", "keywords": ["meshc", "mesh with contour", "wireframe contour plot", "composite mesh plot", "matlab meshc"], "suggestedPath": "/meshc-2.m" }, { "id": "meshc:3", "builtinKey": "meshc", "builtinTitle": "meshc", "builtinSlug": "meshc", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect the returned primary surface handle", "summary": "Create composite wireframe-and-contour plots for scalar fields with MATLAB `meshc` semantics and contour overlays.", "code": "[X, Y] = meshgrid(1:20, 1:20);\nZ = X - Y;\nh = meshc(X, Y, Z);\nget(h, 'Type')", "output": "ans =\n 'surface'", "keywords": ["meshc", "mesh with contour", "wireframe contour plot", "composite mesh plot", "matlab meshc"], "suggestedPath": "/meshc-3.m" }, { "id": "meshgrid:1", "builtinKey": "meshgrid", "builtinTitle": "meshgrid", "builtinSlug": "meshgrid", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Generating a square 2-D grid from one vector", "summary": "Generate MATLAB mesh grids for 2-D and 3-D coordinate vectors with optional GPU residency.", "code": "x = -2:2;\n[X, Y] = meshgrid(x)", "output": "X =\n -2 -1 0 1 2\n -2 -1 0 1 2\n -2 -1 0 1 2\n -2 -1 0 1 2\n -2 -1 0 1 2", "keywords": ["meshgrid", "grid", "surface", "gpu", "like", "3d"], "suggestedPath": "/meshgrid-1.m" }, { "id": "meshgrid:2", "builtinKey": "meshgrid", "builtinTitle": "meshgrid", "builtinSlug": "meshgrid", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Building a rectangular grid from two different vectors", "summary": "Generate MATLAB mesh grids for 2-D and 3-D coordinate vectors with optional GPU residency.", "code": "x = [0 0.5 1.0];\ny = [10 20];\n[X, Y] = meshgrid(x, y)", "output": "X =\n 0 0.5000 1.0000\n 0 0.5000 1.0000\n\nY =\n 10 10 10\n 20 20 20", "keywords": ["meshgrid", "grid", "surface", "gpu", "like", "3d"], "suggestedPath": "/meshgrid-2.m" }, { "id": "meshgrid:3", "builtinKey": "meshgrid", "builtinTitle": "meshgrid", "builtinSlug": "meshgrid", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a volumetric grid for 3-D plotting", "summary": "Generate MATLAB mesh grids for 2-D and 3-D coordinate vectors with optional GPU residency.", "code": "u = -1:1;\nv = 2:4;\nw = linspace(0, 1, 5);\n[U, V, W] = meshgrid(u, v, w);\nsize(U)", "output": "ans =\n 3 3 5", "keywords": ["meshgrid", "grid", "surface", "gpu", "like", "3d"], "suggestedPath": "/meshgrid-3.m" }, { "id": "meshgrid:4", "builtinKey": "meshgrid", "builtinTitle": "meshgrid", "builtinSlug": "meshgrid", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Matching an existing GPU prototype", "summary": "Generate MATLAB mesh grids for 2-D and 3-D coordinate vectors with optional GPU residency.", "code": "gx = gpuArray(single(linspace(-pi, pi, 4)));\ngy = gpuArray(single([-1 0 1]));\n[Xg, Yg] = meshgrid(gx, gy)", "keywords": ["meshgrid", "grid", "surface", "gpu", "like", "3d"], "suggestedPath": "/meshgrid-4.m" }, { "id": "meshgrid:5", "builtinKey": "meshgrid", "builtinTitle": "meshgrid", "builtinSlug": "meshgrid", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Using `'like'` to copy residency from another array", "summary": "Generate MATLAB mesh grids for 2-D and 3-D coordinate vectors with optional GPU residency.", "code": "proto = gpuArray.zeros(1, 1, 'double');\nangles = linspace(0, 2*pi, 8);\nradius = [0 1 2];\n[X, Y] = meshgrid(angles, radius, 'like', proto)", "keywords": ["meshgrid", "grid", "surface", "gpu", "like", "3d"], "suggestedPath": "/meshgrid-5.m" }, { "id": "meshgrid:6", "builtinKey": "meshgrid", "builtinTitle": "meshgrid", "builtinSlug": "meshgrid", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Complex inputs produce complex grids automatically", "summary": "Generate MATLAB mesh grids for 2-D and 3-D coordinate vectors with optional GPU residency.", "code": "z = [1+1i, 2+4i];\n[Zx, Zy] = meshgrid(z)", "keywords": ["meshgrid", "grid", "surface", "gpu", "like", "3d"], "suggestedPath": "/meshgrid-6.m" }, { "id": "min:1", "builtinKey": "min", "builtinTitle": "min", "builtinSlug": "min", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Finding column-wise minima of a matrix", "summary": "Return the minimum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [3 1 5; 4 2 6];\n[m, idx] = min(A)", "output": "m = [3 1 5];\nidx = [1 2 1]", "keywords": ["min", "minimum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/min-1.m" }, { "id": "min:2", "builtinKey": "min", "builtinTitle": "min", "builtinSlug": "min", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Reducing along the second dimension", "summary": "Return the minimum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [3 1 5; 4 2 6];\n[m, idx] = min(A, [], 2)", "output": "m = [1; 2];\nidx = [2; 2]", "keywords": ["min", "minimum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/min-2.m" }, { "id": "min:3", "builtinKey": "min", "builtinTitle": "min", "builtinSlug": "min", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Collapsing all elements with linear indices", "summary": "Return the minimum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = reshape(1:12, [3 4]);\n[m, idx] = min(A, [], 'all')", "output": "m = 1;\nidx = 1; % linear index into A(:)", "keywords": ["min", "minimum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/min-3.m" }, { "id": "min:4", "builtinKey": "min", "builtinTitle": "min", "builtinSlug": "min", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring NaN values during reduction", "summary": "Return the minimum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "values = [NaN 4 2; 3 NaN 1];\n[m, idx] = min(values, [], 1, 'omitnan')", "output": "m = [3 4 1];\nidx = [2 1 2]", "keywords": ["min", "minimum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/min-4.m" }, { "id": "min:5", "builtinKey": "min", "builtinTitle": "min", "builtinSlug": "min", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Elementwise minimum with broadcasting", "summary": "Return the minimum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [1 4 7];\nB = [2; 3; 5];\n[C, origin] = min(A, B)", "output": "C =\n 1 3 5\norigin =\n 1 2 2", "keywords": ["min", "minimum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/min-5.m" }, { "id": "min:6", "builtinKey": "min", "builtinTitle": "min", "builtinSlug": "min", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Comparing complex values by magnitude", "summary": "Return the minimum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "Z = [1+2i, 2+1i, -2+2i];\nM = min(Z); % magnitude ordering\nR = min(Z, [], 'ComparisonMethod', 'real')", "output": "M = 2.0000 + 1.0000i\nR = 1.0000 + 2.0000i", "keywords": ["min", "minimum", "reduction", "comparisonmethod", "omitnan", "gpu"], "suggestedPath": "/min-6.m" }, { "id": "minus:1", "builtinKey": "minus", "builtinTitle": "minus", "builtinSlug": "minus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Subtracting two matrices element-wise", "summary": "Element-wise subtraction A - B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "A = [7 8 9; 4 5 6];\nB = [1 2 3; 1 2 3];\nD = minus(A, B)", "output": "D =\n 6 6 6\n 3 3 3", "keywords": ["minus", "element-wise subtraction", "-", "gpu", "implicit expansion"], "suggestedPath": "/minus-1.m" }, { "id": "minus:2", "builtinKey": "minus", "builtinTitle": "minus", "builtinSlug": "minus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Subtracting a scalar from every matrix element", "summary": "Element-wise subtraction A - B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "A = magic(3);\nshifted = minus(A, 0.5)", "output": "shifted =\n 7.5 0.5 5.5\n 2.5 4.5 6.5\n 3.5 8.5 1.5", "keywords": ["minus", "element-wise subtraction", "-", "gpu", "implicit expansion"], "suggestedPath": "/minus-2.m" }, { "id": "minus:3", "builtinKey": "minus", "builtinTitle": "minus", "builtinSlug": "minus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Broadcasting a column minus a row vector", "summary": "Element-wise subtraction A - B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "col = (1:3)';\nrow = [10 20 30];\nM = minus(col, row)", "output": "M =\n -9 -19 -29\n -8 -18 -28\n -7 -17 -27", "keywords": ["minus", "element-wise subtraction", "-", "gpu", "implicit expansion"], "suggestedPath": "/minus-3.m" }, { "id": "minus:4", "builtinKey": "minus", "builtinTitle": "minus", "builtinSlug": "minus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Subtracting complex numbers element-wise", "summary": "Element-wise subtraction A - B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "z1 = [1+2i, 3-4i];\nz2 = [2-1i, -1+1i];\ndiffz = minus(z1, z2)", "output": "diffz =\n -1 + 3i 4 - 5i", "keywords": ["minus", "element-wise subtraction", "-", "gpu", "implicit expansion"], "suggestedPath": "/minus-4.m" }, { "id": "minus:5", "builtinKey": "minus", "builtinTitle": "minus", "builtinSlug": "minus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Subtracting from character codes", "summary": "Element-wise subtraction A - B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "letters = 'DEF';\ncodes = minus(letters, 1)", "output": "codes = [67 68 69]", "keywords": ["minus", "element-wise subtraction", "-", "gpu", "implicit expansion"], "suggestedPath": "/minus-5.m" }, { "id": "minus:6", "builtinKey": "minus", "builtinTitle": "minus", "builtinSlug": "minus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Keeping element-wise differences on the GPU with `'like'`", "summary": "Element-wise subtraction A - B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "proto = gpuArray.zeros(1, 1);\nG1 = gpuArray([10 20 30]);\nG2 = gpuArray([1 2 3]);\ndeviceDiff = minus(G1, G2, 'like', proto);\nresult = gather(deviceDiff)", "output": "deviceDiff =\n 1x3 gpuArray\n 9 18 27\nresult =\n 9 18 27", "keywords": ["minus", "element-wise subtraction", "-", "gpu", "implicit expansion"], "suggestedPath": "/minus-6.m" }, { "id": "mkdir:1", "builtinKey": "mkdir", "builtinTitle": "mkdir", "builtinSlug": "mkdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Create A New Folder In The Current Directory", "summary": "Create folders with MATLAB-compatible status, message, and message ID outputs.", "code": "status = mkdir(\"results\")", "output": "status =\n 1", "keywords": ["mkdir", "create directory", "folder", "filesystem", "status", "message", "messageid"], "suggestedPath": "/mkdir-1.m" }, { "id": "mkdir:2", "builtinKey": "mkdir", "builtinTitle": "mkdir", "builtinSlug": "mkdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Create A Nested Folder Using Parent And Child Arguments", "summary": "Create folders with MATLAB-compatible status, message, and message ID outputs.", "code": "mkdir(\"data\");\nstatus = mkdir(\"data\", \"archive/2024\")", "output": "status =\n 1", "keywords": ["mkdir", "create directory", "folder", "filesystem", "status", "message", "messageid"], "suggestedPath": "/mkdir-2.m" }, { "id": "mkdir:3", "builtinKey": "mkdir", "builtinTitle": "mkdir", "builtinSlug": "mkdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Detect When A Folder Already Exists", "summary": "Create folders with MATLAB-compatible status, message, and message ID outputs.", "code": "mkdir(\"logs\");\n[status, message, messageID] = mkdir(\"logs\")", "output": "status =\n 1\n\nmessage =\nDirectory already exists.\n\nmessageID =\nRunMat:MKDIR:DirectoryExists", "keywords": ["mkdir", "create directory", "folder", "filesystem", "status", "message", "messageid"], "suggestedPath": "/mkdir-3.m" }, { "id": "mkdir:4", "builtinKey": "mkdir", "builtinTitle": "mkdir", "builtinSlug": "mkdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handle Missing Parent Folder Gracefully", "summary": "Create folders with MATLAB-compatible status, message, and message ID outputs.", "code": "[status, message, messageID] = mkdir(\"missing-parent\", \"child\")", "output": "status =\n 0\nmessage =\nParent folder \"missing-parent\" does not exist.\nmessageID =\nRunMat:MKDIR:ParentDirectoryDoesNotExist", "keywords": ["mkdir", "create directory", "folder", "filesystem", "status", "message", "messageid"], "suggestedPath": "/mkdir-4.m" }, { "id": "mkdir:5", "builtinKey": "mkdir", "builtinTitle": "mkdir", "builtinSlug": "mkdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Capture Detailed Status And Messages", "summary": "Create folders with MATLAB-compatible status, message, and message ID outputs.", "code": "[status, message, messageID] = mkdir(\"reports\")", "output": "status =\n 1\nmessage =\n\nmessageID =", "keywords": ["mkdir", "create directory", "folder", "filesystem", "status", "message", "messageid"], "suggestedPath": "/mkdir-5.m" }, { "id": "mkdir:6", "builtinKey": "mkdir", "builtinTitle": "mkdir", "builtinSlug": "mkdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Create A Folder In Your Home Directory With Tilde Expansion", "summary": "Create folders with MATLAB-compatible status, message, and message ID outputs.", "code": "status = mkdir(\"~\", \"RunMatProjects\")", "output": "status =\n 1", "keywords": ["mkdir", "create directory", "folder", "filesystem", "status", "message", "messageid"], "suggestedPath": "/mkdir-6.m" }, { "id": "mkdir:7", "builtinKey": "mkdir", "builtinTitle": "mkdir", "builtinSlug": "mkdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use gpuArray Inputs For Paths", "summary": "Create folders with MATLAB-compatible status, message, and message ID outputs.", "code": "status = mkdir(gpuArray(\"gpu-output\"))", "output": "status =\n 1", "keywords": ["mkdir", "create directory", "folder", "filesystem", "status", "message", "messageid"], "suggestedPath": "/mkdir-7.m" }, { "id": "mldivide:1", "builtinKey": "mldivide", "builtinTitle": "mldivide", "builtinSlug": "mldivide", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Solving a square linear system with backslash", "summary": "Solve A * X = B using MATLAB's left-division operator (`\\`).", "code": "A = [1 2; 3 4];\nb = [5; 6];\nx = A \\ b", "output": "x =\n -4.0000\n 4.5000", "keywords": ["mldivide", "matrix left division", "linear systems", "least squares", "gpu"], "suggestedPath": "/mldivide-1.m" }, { "id": "mldivide:2", "builtinKey": "mldivide", "builtinTitle": "mldivide", "builtinSlug": "mldivide", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Computing a least-squares solution with backslash", "summary": "Solve A * X = B using MATLAB's left-division operator (`\\`).", "code": "A = [1 2; 3 4; 5 6];\nb = [7; 8; 9];\nx = A \\ b", "output": "x =\n -6.0000\n 6.5000", "keywords": ["mldivide", "matrix left division", "linear systems", "least squares", "gpu"], "suggestedPath": "/mldivide-2.m" }, { "id": "mldivide:3", "builtinKey": "mldivide", "builtinTitle": "mldivide", "builtinSlug": "mldivide", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Scaling by a scalar using backslash", "summary": "Solve A * X = B using MATLAB's left-division operator (`\\`).", "code": "s = 2;\nB = [2 4 6];\nscaled = s \\ B", "output": "scaled = [1 2 3]", "keywords": ["mldivide", "matrix left division", "linear systems", "least squares", "gpu"], "suggestedPath": "/mldivide-3.m" }, { "id": "mldivide:4", "builtinKey": "mldivide", "builtinTitle": "mldivide", "builtinSlug": "mldivide", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Solving multiple right-hand sides at once", "summary": "Solve A * X = B using MATLAB's left-division operator (`\\`).", "code": "A = [4 1; 2 3];\nB = [1 0; 0 1];\nX = A \\ B", "output": "X =\n 0.3 -0.1\n -0.2 0.4", "keywords": ["mldivide", "matrix left division", "linear systems", "least squares", "gpu"], "suggestedPath": "/mldivide-4.m" }, { "id": "mldivide:5", "builtinKey": "mldivide", "builtinTitle": "mldivide", "builtinSlug": "mldivide", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Left division with complex matrices", "summary": "Solve A * X = B using MATLAB's left-division operator (`\\`).", "code": "A = [2+i 1; -1 3-2i];\nB = [1; 4+i];\nX = A \\ B", "output": "X =\n -0.0732 - 0.3415i\n 0.8049 + 0.7561i", "keywords": ["mldivide", "matrix left division", "linear systems", "least squares", "gpu"], "suggestedPath": "/mldivide-5.m" }, { "id": "mod:1", "builtinKey": "mod", "builtinTitle": "mod", "builtinSlug": "mod", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Computing the modulus of positive integers", "summary": "Compute the MATLAB-style modulus a - b .* floor(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "r = mod(17, 5)", "output": "r = 2", "keywords": ["mod", "modulus", "remainder", "rounding", "gpu"], "suggestedPath": "/mod-1.m" }, { "id": "mod:2", "builtinKey": "mod", "builtinTitle": "mod", "builtinSlug": "mod", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Modulus with negative divisors keeps the divisor's sign", "summary": "Compute the MATLAB-style modulus a - b .* floor(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "values = [-7 -3 4 9];\nmods = mod(values, -4)", "output": "mods = [-3 -3 0 -3]", "keywords": ["mod", "modulus", "remainder", "rounding", "gpu"], "suggestedPath": "/mod-2.m" }, { "id": "mod:3", "builtinKey": "mod", "builtinTitle": "mod", "builtinSlug": "mod", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Broadcasting a scalar divisor across a matrix", "summary": "Compute the MATLAB-style modulus a - b .* floor(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "A = [4.5 7.1; -2.3 0.4];\nresult = mod(A, 2)", "output": "result =\n [0.5 1.1;\n 1.7 0.4]", "keywords": ["mod", "modulus", "remainder", "rounding", "gpu"], "suggestedPath": "/mod-3.m" }, { "id": "mod:4", "builtinKey": "mod", "builtinTitle": "mod", "builtinSlug": "mod", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "MATLAB-compatible modulus for complex numbers", "summary": "Compute the MATLAB-style modulus a - b .* floor(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "z = [3 + 4i, -2 + 5i];\ndiv = 2 + 1i;\nres = mod(z, div)", "output": "res =\n [0.0 + 0.0i, 0.0 + 1.0i]", "keywords": ["mod", "modulus", "remainder", "rounding", "gpu"], "suggestedPath": "/mod-4.m" }, { "id": "mod:5", "builtinKey": "mod", "builtinTitle": "mod", "builtinSlug": "mod", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Handling zeros in the divisor", "summary": "Compute the MATLAB-style modulus a - b .* floor(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "warn = mod([2, 0, -2], [0, 0, 0])", "output": "warn = [NaN NaN NaN]", "keywords": ["mod", "modulus", "remainder", "rounding", "gpu"], "suggestedPath": "/mod-5.m" }, { "id": "mod:6", "builtinKey": "mod", "builtinTitle": "mod", "builtinSlug": "mod", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Using `mod` with character arrays", "summary": "Compute the MATLAB-style modulus a - b .* floor(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "letters = mod('ABC', 5)", "output": "letters = [0 1 2]", "keywords": ["mod", "modulus", "remainder", "rounding", "gpu"], "suggestedPath": "/mod-6.m" }, { "id": "mod:7", "builtinKey": "mod", "builtinTitle": "mod", "builtinSlug": "mod", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Staying on the GPU when hooks are available", "summary": "Compute the MATLAB-style modulus a - b .* floor(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "G = gpuArray(-5:5);\nH = mod(G, 4);\ncpuCopy = gather(H)", "output": "cpuCopy = [3 0 1 2 3 0 1 2 3 0 1]", "keywords": ["mod", "modulus", "remainder", "rounding", "gpu"], "suggestedPath": "/mod-7.m" }, { "id": "movefile:1", "builtinKey": "movefile", "builtinTitle": "movefile", "builtinSlug": "movefile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Rename a file in the same folder", "summary": "Move or rename files and folders with MATLAB-compatible status, message, and message ID outputs.", "code": "fid = fopen(\"results.txt\", \"w\"); fclose(fid);\nstatus = movefile(\"results.txt\", \"archive.txt\")", "output": "status =\n 1", "keywords": ["movefile", "rename", "move file", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/movefile-1.m" }, { "id": "movefile:2", "builtinKey": "movefile", "builtinTitle": "movefile", "builtinSlug": "movefile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Move a file into an existing folder", "summary": "Move or rename files and folders with MATLAB-compatible status, message, and message ID outputs.", "code": "mkdir(\"reports\");\nfid = fopen(\"summary.txt\", \"w\"); fclose(fid);\nstatus = movefile(\"summary.txt\", \"reports\")", "output": "status =\n 1", "keywords": ["movefile", "rename", "move file", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/movefile-2.m" }, { "id": "movefile:3", "builtinKey": "movefile", "builtinTitle": "movefile", "builtinSlug": "movefile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Force overwrite an existing destination", "summary": "Move or rename files and folders with MATLAB-compatible status, message, and message ID outputs.", "code": "fid = fopen(\"draft.txt\", \"w\"); fclose(fid);\nfid = fopen(\"final.txt\", \"w\"); fclose(fid);\n[status, message, messageID] = movefile(\"draft.txt\", \"final.txt\", \"f\")", "output": "status =\n 1\nmessage =\n\nmessageID =", "keywords": ["movefile", "rename", "move file", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/movefile-3.m" }, { "id": "movefile:4", "builtinKey": "movefile", "builtinTitle": "movefile", "builtinSlug": "movefile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Move multiple files with a wildcard", "summary": "Move or rename files and folders with MATLAB-compatible status, message, and message ID outputs.", "code": "mkdir(\"data\");\nfid = fopen(\"a.log\", \"w\"); fclose(fid);\nfid = fopen(\"b.log\", \"w\"); fclose(fid);\nstatus = movefile(\"*.log\", \"data\")", "output": "status =\n 1", "keywords": ["movefile", "rename", "move file", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/movefile-4.m" }, { "id": "movefile:5", "builtinKey": "movefile", "builtinTitle": "movefile", "builtinSlug": "movefile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handle missing sources gracefully", "summary": "Move or rename files and folders with MATLAB-compatible status, message, and message ID outputs.", "code": "[status, message, messageID] = movefile(\"missing.txt\", \"dest.txt\")", "output": "status =\n 0\nmessage =\nSource \"missing.txt\" does not exist.\nmessageID =\nRunMat:MOVEFILE:FileDoesNotExist", "keywords": ["movefile", "rename", "move file", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/movefile-5.m" }, { "id": "movefile:6", "builtinKey": "movefile", "builtinTitle": "movefile", "builtinSlug": "movefile", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use gpuArray inputs for paths", "summary": "Move or rename files and folders with MATLAB-compatible status, message, and message ID outputs.", "code": "fid = fopen(\"draft.txt\", \"w\"); fclose(fid);\nstatus = movefile(gpuArray(\"draft.txt\"), gpuArray(\"final.txt\"))", "output": "status =\n 1", "keywords": ["movefile", "rename", "move file", "filesystem", "status", "message", "messageid", "force", "overwrite"], "suggestedPath": "/movefile-6.m" }, { "id": "mpower:1", "builtinKey": "mpower", "builtinTitle": "mpower", "builtinSlug": "mpower", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Raising a matrix to an integer power", "summary": "Raise scalars or square matrices to a scalar power (A^B) following MATLAB's matrix power semantics.", "code": "A = [1 3; 2 4];\nC = mpower(A, 2)", "output": "C =\n 7 15\n 10 22", "keywords": ["mpower", "matrix power", "linear algebra", "gpu"], "suggestedPath": "/mpower-1.m" }, { "id": "mpower:2", "builtinKey": "mpower", "builtinTitle": "mpower", "builtinSlug": "mpower", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Returning the identity matrix when exponent is zero", "summary": "Raise scalars or square matrices to a scalar power (A^B) following MATLAB's matrix power semantics.", "code": "A = [5 2; 7 1];\nI = mpower(A, 0)", "output": "I =\n 1 0\n 0 1", "keywords": ["mpower", "matrix power", "linear algebra", "gpu"], "suggestedPath": "/mpower-2.m" }, { "id": "mpower:3", "builtinKey": "mpower", "builtinTitle": "mpower", "builtinSlug": "mpower", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Scalar bases behave like ordinary exponentiation", "summary": "Raise scalars or square matrices to a scalar power (A^B) following MATLAB's matrix power semantics.", "code": "result = mpower(4, 0.5)", "output": "result = 2", "keywords": ["mpower", "matrix power", "linear algebra", "gpu"], "suggestedPath": "/mpower-3.m" }, { "id": "mpower:4", "builtinKey": "mpower", "builtinTitle": "mpower", "builtinSlug": "mpower", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Non-integer exponents raise an error for matrices", "summary": "Raise scalars or square matrices to a scalar power (A^B) following MATLAB's matrix power semantics.", "code": "A = [1 2; 3 4];\nC = mpower(A, 1.5)", "output": "Error using mpower\nMatrix power requires integer exponent.", "keywords": ["mpower", "matrix power", "linear algebra", "gpu"], "suggestedPath": "/mpower-4.m" }, { "id": "mpower:5", "builtinKey": "mpower", "builtinTitle": "mpower", "builtinSlug": "mpower", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Computing matrix powers on the GPU", "summary": "Raise scalars or square matrices to a scalar power (A^B) following MATLAB's matrix power semantics.", "code": "G = gpuArray([2 0; 0 2]);\nH = mpower(G, 3);\ngather(H)", "output": "ans =\n 8 0\n 0 8", "keywords": ["mpower", "matrix power", "linear algebra", "gpu"], "suggestedPath": "/mpower-5.m" }, { "id": "mrdivide:1", "builtinKey": "mrdivide", "builtinTitle": "mrdivide", "builtinSlug": "mrdivide", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Solving a square linear system", "summary": "Solve X * B = A using MATLAB's right-division operator (`/`).", "code": "A = [1 2; 3 4];\nB = [5 6; 7 8];\nX = A / B;\n\n% Verify the solution\nresidual = X * B", "output": "X =\n 3 -2\n 2 -1\n\nresidual =\n 1 2\n 3 4", "keywords": ["mrdivide", "matrix right division", "linear systems", "least squares", "gpu"], "suggestedPath": "/mrdivide-1.m" }, { "id": "mrdivide:2", "builtinKey": "mrdivide", "builtinTitle": "mrdivide", "builtinSlug": "mrdivide", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Computing a least-squares right division", "summary": "Solve X * B = A using MATLAB's right-division operator (`/`).", "code": "A = [1 2 3];\nB = [1 0 1; 0 1 1];\nX = A / B", "output": "X = [1 2]", "keywords": ["mrdivide", "matrix right division", "linear systems", "least squares", "gpu"], "suggestedPath": "/mrdivide-2.m" }, { "id": "mrdivide:3", "builtinKey": "mrdivide", "builtinTitle": "mrdivide", "builtinSlug": "mrdivide", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Dividing by a scalar", "summary": "Solve X * B = A using MATLAB's right-division operator (`/`).", "code": "A = [2 4 6];\nscaled = A / 2", "output": "scaled = [1 2 3]", "keywords": ["mrdivide", "matrix right division", "linear systems", "least squares", "gpu"], "suggestedPath": "/mrdivide-3.m" }, { "id": "mrdivide:4", "builtinKey": "mrdivide", "builtinTitle": "mrdivide", "builtinSlug": "mrdivide", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Right division with complex inputs", "summary": "Solve X * B = A using MATLAB's right-division operator (`/`).", "code": "A = [1+2i 3-4i];\nB = [2-i 1+i];\nX = A / B", "output": "X = -0.1429 - 0.2857i", "keywords": ["mrdivide", "matrix right division", "linear systems", "least squares", "gpu"], "suggestedPath": "/mrdivide-4.m" }, { "id": "mtimes:1", "builtinKey": "mtimes", "builtinTitle": "mtimes", "builtinSlug": "mtimes", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Multiply two 2-D matrices", "summary": "Matrix multiplication (A * B) with MATLAB-compatible semantics.", "code": "A = [1 2 3; 4 5 6];\nB = [7 8; 9 10; 11 12];\nC = A * B", "output": "C = [58 64; 139 154]", "keywords": ["mtimes", "matrix multiplication", "linear algebra", "gpu"], "suggestedPath": "/mtimes-1.m" }, { "id": "mtimes:2", "builtinKey": "mtimes", "builtinTitle": "mtimes", "builtinSlug": "mtimes", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Compute a dot product with row and column vectors", "summary": "Matrix multiplication (A * B) with MATLAB-compatible semantics.", "code": "u = [1 2 3];\nv = [4; 5; 6];\ndotVal = u * v", "output": "dotVal = 32", "keywords": ["mtimes", "matrix multiplication", "linear algebra", "gpu"], "suggestedPath": "/mtimes-2.m" }, { "id": "mtimes:3", "builtinKey": "mtimes", "builtinTitle": "mtimes", "builtinSlug": "mtimes", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Scale a matrix by a scalar using `mtimes`", "summary": "Matrix multiplication (A * B) with MATLAB-compatible semantics.", "code": "S = 0.5 * eye(3)", "output": "S =\n 0.5000 0 0\n 0 0.5000 0\n 0 0 0.5000", "keywords": ["mtimes", "matrix multiplication", "linear algebra", "gpu"], "suggestedPath": "/mtimes-3.m" }, { "id": "mtimes:4", "builtinKey": "mtimes", "builtinTitle": "mtimes", "builtinSlug": "mtimes", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Multiply complex matrices", "summary": "Matrix multiplication (A * B) with MATLAB-compatible semantics.", "code": "A = [1+2i 3-4i; 5+6i 7+8i];\nB = [1-1i; 2+2i];\nC = A * B", "output": "C =\n 17 - 1i\n 9 + 31i", "keywords": ["mtimes", "matrix multiplication", "linear algebra", "gpu"], "suggestedPath": "/mtimes-4.m" }, { "id": "mtimes:5", "builtinKey": "mtimes", "builtinTitle": "mtimes", "builtinSlug": "mtimes", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Perform matrix multiplication on GPU arrays", "summary": "Matrix multiplication (A * B) with MATLAB-compatible semantics.", "code": "G1 = gpuArray([1 2; 3 4]);\nG2 = gpuArray([5; 6]);\nG = G1 * G2;\nresult = gather(G)", "output": "isa(G, 'gpuArray') % logical 1\n\nresult =\n 17\n 39", "keywords": ["mtimes", "matrix multiplication", "linear algebra", "gpu"], "suggestedPath": "/mtimes-5.m" }, { "id": "mtimes:6", "builtinKey": "mtimes", "builtinTitle": "mtimes", "builtinSlug": "mtimes", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Dimension mismatch raises a MATLAB-style error", "summary": "Matrix multiplication (A * B) with MATLAB-compatible semantics.", "code": "A = rand(2, 3);\nB = rand(4, 2);\nC = A * B", "output": "Error using *\nInner matrix dimensions must agree.", "keywords": ["mtimes", "matrix multiplication", "linear algebra", "gpu"], "suggestedPath": "/mtimes-6.m" }, { "id": "ndims:1", "builtinKey": "ndims", "builtinTitle": "ndims", "builtinSlug": "ndims", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Checking how many dimensions a scalar has", "summary": "Return the number of dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "n = ndims(42)", "output": "n = 2", "keywords": ["ndims", "number of dimensions", "array rank", "gpu metadata", "MATLAB compatibility"], "suggestedPath": "/ndims-1.m" }, { "id": "ndims:2", "builtinKey": "ndims", "builtinTitle": "ndims", "builtinSlug": "ndims", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Counting the dimensions of a matrix", "summary": "Return the number of dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "A = rand(5, 3);\nr = ndims(A)", "output": "r = 2", "keywords": ["ndims", "number of dimensions", "array rank", "gpu metadata", "MATLAB compatibility"], "suggestedPath": "/ndims-2.m" }, { "id": "ndims:3", "builtinKey": "ndims", "builtinTitle": "ndims", "builtinSlug": "ndims", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Detecting 3-D array dimensionality", "summary": "Return the number of dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "V = rand(4, 5, 6);\nr = ndims(V)", "output": "r = 3", "keywords": ["ndims", "number of dimensions", "array rank", "gpu metadata", "MATLAB compatibility"], "suggestedPath": "/ndims-3.m" }, { "id": "ndims:4", "builtinKey": "ndims", "builtinTitle": "ndims", "builtinSlug": "ndims", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Finding ndims for gpuArray data without gathering", "summary": "Return the number of dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "G = gpuArray(ones(16, 32, 2));\nr = ndims(G)", "output": "r = 3", "keywords": ["ndims", "number of dimensions", "array rank", "gpu metadata", "MATLAB compatibility"], "suggestedPath": "/ndims-4.m" }, { "id": "ndims:5", "builtinKey": "ndims", "builtinTitle": "ndims", "builtinSlug": "ndims", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Understanding ndims with cell arrays", "summary": "Return the number of dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "C = {1, 2, 3; 4, 5, 6};\nr = ndims(C)", "output": "r = 2", "keywords": ["ndims", "number of dimensions", "array rank", "gpu metadata", "MATLAB compatibility"], "suggestedPath": "/ndims-5.m" }, { "id": "ndims:6", "builtinKey": "ndims", "builtinTitle": "ndims", "builtinSlug": "ndims", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Verifying ndims on string arrays", "summary": "Return the number of dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "S = [\"alpha\"; \"beta\"; \"gamma\"];\nr = ndims(S)", "output": "r = 2", "keywords": ["ndims", "number of dimensions", "array rank", "gpu metadata", "MATLAB compatibility"], "suggestedPath": "/ndims-6.m" }, { "id": "ne:1", "builtinKey": "ne", "builtinTitle": "ne", "builtinSlug": "ne", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Checking if two scalars differ", "summary": "Element-wise inequality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "flag = ne(42, 7)", "output": "flag =\n 1", "keywords": ["ne", "~=", "not equal", "logical comparison", "gpuArray inequality"], "suggestedPath": "/ne-1.m" }, { "id": "ne:2", "builtinKey": "ne", "builtinTitle": "ne", "builtinSlug": "ne", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Finding mismatched elements between vectors", "summary": "Element-wise inequality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "A = [1 2 3 4];\nB = [1 0 3 5];\nmask = ne(A, B)", "output": "mask =\n 1×4 logical array\n 0 1 0 1", "keywords": ["ne", "~=", "not equal", "logical comparison", "gpuArray inequality"], "suggestedPath": "/ne-2.m" }, { "id": "ne:3", "builtinKey": "ne", "builtinTitle": "ne", "builtinSlug": "ne", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Using implicit expansion for inequality", "summary": "Element-wise inequality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "M = [1 2 3; 4 5 6];\nsel = ne(M, 2)", "output": "sel =\n 2×3 logical array\n 1 0 1\n 1 1 1", "keywords": ["ne", "~=", "not equal", "logical comparison", "gpuArray inequality"], "suggestedPath": "/ne-3.m" }, { "id": "ne:4", "builtinKey": "ne", "builtinTitle": "ne", "builtinSlug": "ne", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Comparing text values to numeric codes", "summary": "Element-wise inequality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "letters = ['A' 'B' 'C'];\nnotA = ne(letters, 65)", "output": "notA =\n 1×3 logical array\n 0 1 1", "keywords": ["ne", "~=", "not equal", "logical comparison", "gpuArray inequality"], "suggestedPath": "/ne-4.m" }, { "id": "ne:5", "builtinKey": "ne", "builtinTitle": "ne", "builtinSlug": "ne", "category": "logical/rel", "categoryPath": ["logical", "rel"], "exampleTitle": "Running `~=` directly on gpuArray inputs", "summary": "Element-wise inequality comparison for scalars, arrays, strings, and gpuArray inputs.", "code": "G1 = gpuArray([1 2 3]);\nG2 = gpuArray([0 2 4]);\ndeviceResult = ne(G1, G2);\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1×3 gpuArray logical array\n 1 0 1\nhostResult =\n 1×3 logical array\n 1 0 1", "keywords": ["ne", "~=", "not equal", "logical comparison", "gpuArray inequality"], "suggestedPath": "/ne-5.m" }, { "id": "nnz:1", "builtinKey": "nnz", "builtinTitle": "nnz", "builtinSlug": "nnz", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Counting nonzero elements in a dense matrix", "summary": "Count the number of nonzero elements in an array with MATLAB-compatible semantics.", "code": "A = [1 0 3; 0 0 5];\ncount = nnz(A)", "output": "count = 3", "keywords": ["nnz", "nonzero", "count", "sparsity", "gpu"], "suggestedPath": "/nnz-1.m" }, { "id": "nnz:2", "builtinKey": "nnz", "builtinTitle": "nnz", "builtinSlug": "nnz", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Counting nonzero entries in each column", "summary": "Count the number of nonzero elements in an array with MATLAB-compatible semantics.", "code": "A = [1 0 3; 0 7 5];\nperColumn = nnz(A, 1)", "output": "perColumn = [1 1 2]", "keywords": ["nnz", "nonzero", "count", "sparsity", "gpu"], "suggestedPath": "/nnz-2.m" }, { "id": "nnz:3", "builtinKey": "nnz", "builtinTitle": "nnz", "builtinSlug": "nnz", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Counting nonzero entries in each row", "summary": "Count the number of nonzero elements in an array with MATLAB-compatible semantics.", "code": "A = [1 0 3; 0 7 0];\nperRow = nnz(A, 2)", "output": "perRow = [2; 1]", "keywords": ["nnz", "nonzero", "count", "sparsity", "gpu"], "suggestedPath": "/nnz-3.m" }, { "id": "nnz:4", "builtinKey": "nnz", "builtinTitle": "nnz", "builtinSlug": "nnz", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Recognising `NaN` values as nonzero", "summary": "Count the number of nonzero elements in an array with MATLAB-compatible semantics.", "code": "values = [0 NaN 5];\nnanCount = nnz(values)", "output": "nanCount = 2", "keywords": ["nnz", "nonzero", "count", "sparsity", "gpu"], "suggestedPath": "/nnz-4.m" }, { "id": "nnz:5", "builtinKey": "nnz", "builtinTitle": "nnz", "builtinSlug": "nnz", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Counting GPU-resident values without manual gathers", "summary": "Count the number of nonzero elements in an array with MATLAB-compatible semantics.", "code": "G = gpuArray([1 0 2 0 3]);\ngpuCount = nnz(G)", "output": "gpuCount = 3", "keywords": ["nnz", "nonzero", "count", "sparsity", "gpu"], "suggestedPath": "/nnz-5.m" }, { "id": "norm:1", "builtinKey": "norm", "builtinTitle": "norm", "builtinSlug": "norm", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Computing the Euclidean norm of a vector", "summary": "Compute vector and matrix norms with MATLAB-compatible semantics, including Frobenius and nuclear norms.", "code": "x = [3 4];\nmag = norm(x)", "output": "mag = 5", "keywords": ["norm", "vector norm", "matrix norm", "frobenius", "nuclear", "gpu"], "suggestedPath": "/norm-1.m" }, { "id": "norm:2", "builtinKey": "norm", "builtinTitle": "norm", "builtinSlug": "norm", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Calculating the Frobenius norm of a matrix", "summary": "Compute vector and matrix norms with MATLAB-compatible semantics, including Frobenius and nuclear norms.", "code": "A = [1 -2 3; -4 5 -6];\nf = norm(A, 'fro')", "output": "f = 9.5394", "keywords": ["norm", "vector norm", "matrix norm", "frobenius", "nuclear", "gpu"], "suggestedPath": "/norm-2.m" }, { "id": "norm:3", "builtinKey": "norm", "builtinTitle": "norm", "builtinSlug": "norm", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Using the infinity norm for robust bounds", "summary": "Compute vector and matrix norms with MATLAB-compatible semantics, including Frobenius and nuclear norms.", "code": "x = [2 -7 4];\nbound = norm(x, Inf)", "output": "bound = 7", "keywords": ["norm", "vector norm", "matrix norm", "frobenius", "nuclear", "gpu"], "suggestedPath": "/norm-3.m" }, { "id": "norm:4", "builtinKey": "norm", "builtinTitle": "norm", "builtinSlug": "norm", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Summing singular values with the nuclear norm", "summary": "Compute vector and matrix norms with MATLAB-compatible semantics, including Frobenius and nuclear norms.", "code": "A = [2 0 0; 0 1 0];\ntau = norm(A, 'nuc')", "output": "tau = 3", "keywords": ["norm", "vector norm", "matrix norm", "frobenius", "nuclear", "gpu"], "suggestedPath": "/norm-4.m" }, { "id": "norm:5", "builtinKey": "norm", "builtinTitle": "norm", "builtinSlug": "norm", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Computing the norm of complex-valued data", "summary": "Compute vector and matrix norms with MATLAB-compatible semantics, including Frobenius and nuclear norms.", "code": "z = [1+2i 3-4i];\nmag = norm(z)", "output": "mag = 5.4772", "keywords": ["norm", "vector norm", "matrix norm", "frobenius", "nuclear", "gpu"], "suggestedPath": "/norm-5.m" }, { "id": "norm:6", "builtinKey": "norm", "builtinTitle": "norm", "builtinSlug": "norm", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Preserving GPU residency transparently", "summary": "Compute vector and matrix norms with MATLAB-compatible semantics, including Frobenius and nuclear norms.", "code": "G = gpuArray([3 4 12]);\nmag = norm(G); % falls back to CPU today; future providers can stay on device", "output": "mag = 13", "keywords": ["norm", "vector norm", "matrix norm", "frobenius", "nuclear", "gpu"], "suggestedPath": "/norm-6.m" }, { "id": "not:1", "builtinKey": "not", "builtinTitle": "not", "builtinSlug": "not", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Checking if a scalar value is zero", "summary": "Element-wise logical negation for scalars, arrays, and gpuArray values.", "code": "result = not(5)", "output": "result =\n 0", "keywords": ["logical not", "boolean negation", "gpuArray not", "MATLAB not", "logical invert"], "suggestedPath": "/not-1.m" }, { "id": "not:2", "builtinKey": "not", "builtinTitle": "not", "builtinSlug": "not", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Negating a logical mask to find the complement", "summary": "Element-wise logical negation for scalars, arrays, and gpuArray values.", "code": "mask = [true false true];\ninverseMask = not(mask)", "output": "inverseMask =\n 1×3 logical array\n 0 1 0", "keywords": ["logical not", "boolean negation", "gpuArray not", "MATLAB not", "logical invert"], "suggestedPath": "/not-2.m" }, { "id": "not:3", "builtinKey": "not", "builtinTitle": "not", "builtinSlug": "not", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Turning nonzero numeric entries into false values", "summary": "Element-wise logical negation for scalars, arrays, and gpuArray values.", "code": "A = [0 1 2 0];\nB = not(A)", "output": "B =\n 1×4 logical array\n 1 0 0 1", "keywords": ["logical not", "boolean negation", "gpuArray not", "MATLAB not", "logical invert"], "suggestedPath": "/not-3.m" }, { "id": "not:4", "builtinKey": "not", "builtinTitle": "not", "builtinSlug": "not", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Flipping zero and nonzero character codes", "summary": "Element-wise logical negation for scalars, arrays, and gpuArray values.", "code": "chars = ['A' 0 'C'];\nflags = not(chars)", "output": "flags =\n 1×3 logical array\n 0 1 0", "keywords": ["logical not", "boolean negation", "gpuArray not", "MATLAB not", "logical invert"], "suggestedPath": "/not-4.m" }, { "id": "not:5", "builtinKey": "not", "builtinTitle": "not", "builtinSlug": "not", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Performing logical NOT directly on the GPU", "summary": "Element-wise logical negation for scalars, arrays, and gpuArray values.", "code": "G = gpuArray([0 4 0 9]);\ndeviceResult = not(G);\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1×4 gpuArray logical array\n 1 0 1 0\nhostResult =\n 1×4 logical array\n 1 0 1 0", "keywords": ["logical not", "boolean negation", "gpuArray not", "MATLAB not", "logical invert"], "suggestedPath": "/not-5.m" }, { "id": "num2str:1", "builtinKey": "num2str", "builtinTitle": "num2str", "builtinSlug": "num2str", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Converting A Scalar With Default Precision", "summary": "Convert numeric scalars, vectors, and matrices into MATLAB-style character arrays using general or custom formats.", "code": "label = num2str(pi)", "output": "label =\n '3.14159265358979'", "keywords": ["num2str", "number to string", "format", "precision", "gpu"], "suggestedPath": "/num2str-1.m" }, { "id": "num2str:2", "builtinKey": "num2str", "builtinTitle": "num2str", "builtinSlug": "num2str", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting With A Specific Number Of Significant Digits", "summary": "Convert numeric scalars, vectors, and matrices into MATLAB-style character arrays using general or custom formats.", "code": "digits = num2str(pi, 4)", "output": "digits =\n '3.142'", "keywords": ["num2str", "number to string", "format", "precision", "gpu"], "suggestedPath": "/num2str-2.m" }, { "id": "num2str:3", "builtinKey": "num2str", "builtinTitle": "num2str", "builtinSlug": "num2str", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Using A Custom Format String", "summary": "Convert numeric scalars, vectors, and matrices into MATLAB-style character arrays using general or custom formats.", "code": "row = num2str([1.234 5.678], '%.2f')", "output": "row =\n '1.23 5.68'", "keywords": ["num2str", "number to string", "format", "precision", "gpu"], "suggestedPath": "/num2str-3.m" }, { "id": "num2str:4", "builtinKey": "num2str", "builtinTitle": "num2str", "builtinSlug": "num2str", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Displaying A Matrix With Column Alignment", "summary": "Convert numeric scalars, vectors, and matrices into MATLAB-style character arrays using general or custom formats.", "code": "block = num2str([1 23 456; 78 9 10])", "output": "block =\n ' 1 23 456'\n '78 9 10'", "keywords": ["num2str", "number to string", "format", "precision", "gpu"], "suggestedPath": "/num2str-4.m" }, { "id": "num2str:5", "builtinKey": "num2str", "builtinTitle": "num2str", "builtinSlug": "num2str", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting Complex Numbers", "summary": "Convert numeric scalars, vectors, and matrices into MATLAB-style character arrays using general or custom formats.", "code": "z = num2str([3+4i 5-6i])", "output": "z =\n '3 + 4i 5 - 6i'", "keywords": ["num2str", "number to string", "format", "precision", "gpu"], "suggestedPath": "/num2str-5.m" }, { "id": "num2str:6", "builtinKey": "num2str", "builtinTitle": "num2str", "builtinSlug": "num2str", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Respecting Locale-Specific Decimal Separators", "summary": "Convert numeric scalars, vectors, and matrices into MATLAB-style character arrays using general or custom formats.", "code": "text = num2str(0.125, 'local')", "keywords": ["num2str", "number to string", "format", "precision", "gpu"], "suggestedPath": "/num2str-6.m" }, { "id": "num2str:7", "builtinKey": "num2str", "builtinTitle": "num2str", "builtinSlug": "num2str", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Converting GPU-Resident Data", "summary": "Convert numeric scalars, vectors, and matrices into MATLAB-style character arrays using general or custom formats.", "code": "G = gpuArray([10.5 20.5]);\ntxt = num2str(G, '%.1f')", "output": "txt =\n '10.5 20.5'", "keywords": ["num2str", "number to string", "format", "precision", "gpu"], "suggestedPath": "/num2str-7.m" }, { "id": "numel:1", "builtinKey": "numel", "builtinTitle": "numel", "builtinSlug": "numel", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Counting elements in a matrix", "summary": "Count the number of elements in scalars, vectors, matrices, and N-D arrays.", "code": "A = [1 2 3; 4 5 6];\nn = numel(A)", "output": "n = 6", "keywords": ["numel", "number of elements", "array length", "gpu metadata", "dimensions"], "suggestedPath": "/numel-1.m" }, { "id": "numel:2", "builtinKey": "numel", "builtinTitle": "numel", "builtinSlug": "numel", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Checking the number of elements in a cell array", "summary": "Count the number of elements in scalars, vectors, matrices, and N-D arrays.", "code": "C = {1, 2, 3; 4, 5, 6};\ncells = numel(C)", "output": "cells = 6", "keywords": ["numel", "number of elements", "array length", "gpu metadata", "dimensions"], "suggestedPath": "/numel-2.m" }, { "id": "numel:3", "builtinKey": "numel", "builtinTitle": "numel", "builtinSlug": "numel", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Getting the number of elements along selected dimensions", "summary": "Count the number of elements in scalars, vectors, matrices, and N-D arrays.", "code": "T = rand(4, 3, 2);\nplane = numel(T, 1, 2); % product of the first two dimensions", "output": "plane = 12", "keywords": ["numel", "number of elements", "array length", "gpu metadata", "dimensions"], "suggestedPath": "/numel-3.m" }, { "id": "numel:4", "builtinKey": "numel", "builtinTitle": "numel", "builtinSlug": "numel", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Using `numel` with gpuArray data", "summary": "Count the number of elements in scalars, vectors, matrices, and N-D arrays.", "code": "G = gpuArray(ones(256, 4));\ncount = numel(G)", "output": "count = 1024", "keywords": ["numel", "number of elements", "array length", "gpu metadata", "dimensions"], "suggestedPath": "/numel-4.m" }, { "id": "numel:5", "builtinKey": "numel", "builtinTitle": "numel", "builtinSlug": "numel", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Confirming the number of characters in a char array", "summary": "Count the number of elements in scalars, vectors, matrices, and N-D arrays.", "code": "name = ['R' 'u' 'n' 'M' 'a' 't'];\nchars = numel(name)", "output": "chars = 6", "keywords": ["numel", "number of elements", "array length", "gpu metadata", "dimensions"], "suggestedPath": "/numel-5.m" }, { "id": "ones:1", "builtinKey": "ones", "builtinTitle": "ones", "builtinSlug": "ones", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 3x3 matrix of ones", "summary": "Create arrays filled with ones within the MATLAB language.", "code": "B = ones(3)", "output": "B = [1 1 1; 1 1 1; 1 1 1]", "keywords": ["ones", "array", "logical", "gpu", "like"], "suggestedPath": "/ones-1.m" }, { "id": "ones:2", "builtinKey": "ones", "builtinTitle": "ones", "builtinSlug": "ones", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 4x1 logical matrix of ones", "summary": "Create arrays filled with ones within the MATLAB language.", "code": "mask = ones(4, 1, 'logical')", "output": "mask = [1 1 1 1]", "keywords": ["ones", "array", "logical", "gpu", "like"], "suggestedPath": "/ones-2.m" }, { "id": "ones:3", "builtinKey": "ones", "builtinTitle": "ones", "builtinSlug": "ones", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 64x64 matrix of ones on a GPU", "summary": "Create arrays filled with ones within the MATLAB language.", "code": "H = ones(64, 64)", "output": "H = [1 1 1 ... 1; 1 1 1 ... 1; ...; 1 1 1 ... 1]", "keywords": ["ones", "array", "logical", "gpu", "like"], "suggestedPath": "/ones-3.m" }, { "id": "or:1", "builtinKey": "or", "builtinTitle": "or", "builtinSlug": "or", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Check if either logical scalar is true", "summary": "Element-wise logical OR for scalars, arrays, and gpuArray values.", "code": "result = or(true, false)", "output": "result =\n 1", "keywords": ["logical or", "elementwise or", "boolean or", "MATLAB or", "gpuArray or"], "suggestedPath": "/or-1.m" }, { "id": "or:2", "builtinKey": "or", "builtinTitle": "or", "builtinSlug": "or", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Combine numeric arrays element-wise with logical OR", "summary": "Element-wise logical OR for scalars, arrays, and gpuArray values.", "code": "A = [1 0 2 0];\nB = [3 4 0 0];\nC = or(A, B)", "output": "C =\n 1×4 logical array\n 1 1 1 0", "keywords": ["logical or", "elementwise or", "boolean or", "MATLAB or", "gpuArray or"], "suggestedPath": "/or-2.m" }, { "id": "or:3", "builtinKey": "or", "builtinTitle": "or", "builtinSlug": "or", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Apply logical OR with automatic scalar expansion", "summary": "Element-wise logical OR for scalars, arrays, and gpuArray values.", "code": "mask = [1; 0; 3; 0];\nflag = or(mask, 0)", "output": "flag =\n 4×1 logical array\n 1\n 0\n 1\n 0", "keywords": ["logical or", "elementwise or", "boolean or", "MATLAB or", "gpuArray or"], "suggestedPath": "/or-3.m" }, { "id": "or:4", "builtinKey": "or", "builtinTitle": "or", "builtinSlug": "or", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Use logical OR with character arrays", "summary": "Element-wise logical OR for scalars, arrays, and gpuArray values.", "code": "lhs = ['R' 'u' 0];\nrhs = ['R' 0 'n'];\nmatch = or(lhs, rhs)", "output": "match =\n 1×3 logical array\n 1 1 1", "keywords": ["logical or", "elementwise or", "boolean or", "MATLAB or", "gpuArray or"], "suggestedPath": "/or-4.m" }, { "id": "or:5", "builtinKey": "or", "builtinTitle": "or", "builtinSlug": "or", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Run logical OR directly on the GPU", "summary": "Element-wise logical OR for scalars, arrays, and gpuArray values.", "code": "G1 = gpuArray([0 2 0 4]);\nG2 = gpuArray([1 0 3 0]);\ndeviceResult = or(G1, G2)\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1×4 gpuArray logical array\n 1 1 1 1\nhostResult =\n 1×4 logical array\n 1 1 1 1", "keywords": ["logical or", "elementwise or", "boolean or", "MATLAB or", "gpuArray or"], "suggestedPath": "/or-5.m" }, { "id": "orderfields:1", "builtinKey": "orderfields", "builtinTitle": "orderfields", "builtinSlug": "orderfields", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "How to sort struct fields alphabetically", "summary": "Reorder structure field definitions alphabetically or according to a custom order.", "code": "s = struct(\"beta\", 2, \"alpha\", 1, \"gamma\", 3);\nt = orderfields(s);\nfieldnames(t)", "output": "ans =\n {'alpha'}\n {'beta'}\n {'gamma'}", "keywords": ["orderfields", "struct", "reorder fields", "alphabetical", "struct array", "field order"], "suggestedPath": "/orderfields-1.m" }, { "id": "orderfields:2", "builtinKey": "orderfields", "builtinTitle": "orderfields", "builtinSlug": "orderfields", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Match the field order of another struct", "summary": "Reorder structure field definitions alphabetically or according to a custom order.", "code": "source = struct(\"y\", 20, \"x\", 10);\ntemplate = struct(\"x\", 0, \"y\", 0);\n[aligned, order] = orderfields(source, template)", "keywords": ["orderfields", "struct", "reorder fields", "alphabetical", "struct array", "field order"], "suggestedPath": "/orderfields-2.m" }, { "id": "orderfields:3", "builtinKey": "orderfields", "builtinTitle": "orderfields", "builtinSlug": "orderfields", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Reorder fields with a cell array of names", "summary": "Reorder structure field definitions alphabetically or according to a custom order.", "code": "s = struct(\"a\", 1, \"b\", 2, \"c\", 3);\nu = orderfields(s, {\"c\", \"a\", \"b\"});\nfieldnames(u)", "output": "ans =\n {'c'}\n {'a'}\n {'b'}", "keywords": ["orderfields", "struct", "reorder fields", "alphabetical", "struct array", "field order"], "suggestedPath": "/orderfields-3.m" }, { "id": "orderfields:4", "builtinKey": "orderfields", "builtinTitle": "orderfields", "builtinSlug": "orderfields", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Reorder fields with an index vector", "summary": "Reorder structure field definitions alphabetically or according to a custom order.", "code": "s = struct(\"first\", 1, \"second\", 2, \"third\", 3);\npermuted = orderfields(s, [3 1 2]);\nfieldnames(permuted)", "output": "ans =\n {'third'}\n {'first'}\n {'second'}", "keywords": ["orderfields", "struct", "reorder fields", "alphabetical", "struct array", "field order"], "suggestedPath": "/orderfields-4.m" }, { "id": "orderfields:5", "builtinKey": "orderfields", "builtinTitle": "orderfields", "builtinSlug": "orderfields", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Apply a custom order to every element of a struct array", "summary": "Reorder structure field definitions alphabetically or according to a custom order.", "code": "records = struct(\"name\", {\"Ada\", \"Grace\"}, \"id\", {101, 102});\n[reordered, perm] = orderfields(records, {\"id\", \"name\"});\n{reordered.id}", "output": "ans =\n {[101]} {[102]}", "keywords": ["orderfields", "struct", "reorder fields", "alphabetical", "struct array", "field order"], "suggestedPath": "/orderfields-5.m" }, { "id": "orderfields:6", "builtinKey": "orderfields", "builtinTitle": "orderfields", "builtinSlug": "orderfields", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Sort fields in descending alphabetical order", "summary": "Reorder structure field definitions alphabetically or according to a custom order.", "code": "s = struct(\"alpha\", 1, \"delta\", 4, \"beta\", 2);\nnames = string(fieldnames(s));\ndesc = orderfields(s, flip(names));\nfieldnames(desc)", "output": "ans =\n {'delta'}\n {'beta'}\n {'alpha'}", "keywords": ["orderfields", "struct", "reorder fields", "alphabetical", "struct array", "field order"], "suggestedPath": "/orderfields-6.m" }, { "id": "pad:1", "builtinKey": "pad", "builtinTitle": "pad", "builtinSlug": "pad", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Pad Strings To A Common Width", "summary": "Pad strings, character arrays, and cell arrays to a target length using MATLAB-compatible options.", "code": "labels = [\"GPU\"; \"Accelerate\"; \"RunMat\"];\naligned = pad(labels)", "output": "aligned =\n 3×1 string\n \"GPU \"\n \"Accelerate\"\n \"RunMat \"", "keywords": ["pad", "pad string", "left pad", "right pad", "center text", "character arrays"], "suggestedPath": "/pad-1.m" }, { "id": "pad:2", "builtinKey": "pad", "builtinTitle": "pad", "builtinSlug": "pad", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Pad Strings On The Left With Zeros", "summary": "Pad strings, character arrays, and cell arrays to a target length using MATLAB-compatible options.", "code": "ids = [\"42\"; \"7\"; \"512\"];\nzero_padded = pad(ids, 4, 'left', '0')", "output": "zero_padded =\n 3×1 string\n \"0042\"\n \"0007\"\n \"0512\"", "keywords": ["pad", "pad string", "left pad", "right pad", "center text", "character arrays"], "suggestedPath": "/pad-2.m" }, { "id": "pad:3", "builtinKey": "pad", "builtinTitle": "pad", "builtinSlug": "pad", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Center Text With Both-Sided Padding", "summary": "Pad strings, character arrays, and cell arrays to a target length using MATLAB-compatible options.", "code": "titles = [\"core\"; \"planner\"];\ncentered = pad(titles, 10, 'both', '*')", "output": "centered =\n 2×1 string\n \"***core***\"\n \"*planner**\"", "keywords": ["pad", "pad string", "left pad", "right pad", "center text", "character arrays"], "suggestedPath": "/pad-3.m" }, { "id": "pad:4", "builtinKey": "pad", "builtinTitle": "pad", "builtinSlug": "pad", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Pad Character Array Rows", "summary": "Pad strings, character arrays, and cell arrays to a target length using MATLAB-compatible options.", "code": "chars = char(\"GPU\", \"RunMat\");\nout = pad(chars, 8)", "output": "out =\n\n 2×8 char array\n\n 'GPU '\n 'RunMat '", "keywords": ["pad", "pad string", "left pad", "right pad", "center text", "character arrays"], "suggestedPath": "/pad-4.m" }, { "id": "pad:5", "builtinKey": "pad", "builtinTitle": "pad", "builtinSlug": "pad", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Pad A Cell Array Of Character Vectors", "summary": "Pad strings, character arrays, and cell arrays to a target length using MATLAB-compatible options.", "code": "C = {'solver', \"planner\", 'jit'};\ncell_out = pad(C, 'right', '.')", "output": "cell_out = 1×3 cell array\n {'solver.'} {\"planner\"} {'jit....'}", "keywords": ["pad", "pad string", "left pad", "right pad", "center text", "character arrays"], "suggestedPath": "/pad-5.m" }, { "id": "pad:6", "builtinKey": "pad", "builtinTitle": "pad", "builtinSlug": "pad", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Leave Missing Strings Unchanged", "summary": "Pad strings, character arrays, and cell arrays to a target length using MATLAB-compatible options.", "code": "values = [\"RunMat\", \"<missing>\", \"GPU\"];\nkept = pad(values, 8)", "output": "kept =\n 1×3 string\n \"RunMat \" <missing> \"GPU \"", "keywords": ["pad", "pad string", "left pad", "right pad", "center text", "character arrays"], "suggestedPath": "/pad-6.m" }, { "id": "pagefun:1", "builtinKey": "pagefun", "builtinTitle": "pagefun", "builtinSlug": "pagefun", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Batched matrix multiplication across pages", "summary": "Apply MATLAB operators page-by-page across higher-dimensional arrays.", "code": "A = reshape(1:12, [2 2 3]);\nB = reshape(13:24, [2 2 3]);\nC = pagefun(@mtimes, A, B)", "output": "C(:,:,1) =\n 55 63\n 82 94\n\nC(:,:,2) =\n 211 235\n 246 274\n\nC(:,:,3) =\n 431 471\n 474 518", "keywords": ["pagefun", "gpuArray", "batched matrix multiply", "mtimes", "pages"], "suggestedPath": "/pagefun-1.m" }, { "id": "pagefun:2", "builtinKey": "pagefun", "builtinTitle": "pagefun", "builtinSlug": "pagefun", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Broadcasting a single page against multiple pages", "summary": "Apply MATLAB operators page-by-page across higher-dimensional arrays.", "code": "A = reshape(1:8, [2 2 2]);\nB = eye(2);\nC = pagefun(@mtimes, A, B); % B broadcasts across the page dimension", "keywords": ["pagefun", "gpuArray", "batched matrix multiply", "mtimes", "pages"], "suggestedPath": "/pagefun-2.m" }, { "id": "pagefun:3", "builtinKey": "pagefun", "builtinTitle": "pagefun", "builtinSlug": "pagefun", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Working with `gpuArray` inputs", "summary": "Apply MATLAB operators page-by-page across higher-dimensional arrays.", "code": "G1 = gpuArray(rand(4, 4, 8));\nG2 = gpuArray(rand(4, 4, 8));\nH = pagefun(@mtimes, G1, G2);\nfirstPage = gather(H(:, :, 1)); % Inspect the first product page on the host", "keywords": ["pagefun", "gpuArray", "batched matrix multiply", "mtimes", "pages"], "suggestedPath": "/pagefun-3.m" }, { "id": "pagefun:4", "builtinKey": "pagefun", "builtinTitle": "pagefun", "builtinSlug": "pagefun", "category": "acceleration/gpu", "categoryPath": ["acceleration", "gpu"], "exampleTitle": "Handling empty page dimensions", "summary": "Apply MATLAB operators page-by-page across higher-dimensional arrays.", "code": "Z = zeros(2, 2, 0);\nR = pagefun(@mtimes, Z, Z);\nsize(R)", "output": "ans =\n 2 2 0", "keywords": ["pagefun", "gpuArray", "batched matrix multiply", "mtimes", "pages"], "suggestedPath": "/pagefun-4.m" }, { "id": "path:1", "builtinKey": "path", "builtinTitle": "path", "builtinSlug": "path", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Display the current MATLAB search path", "summary": "Query or replace the MATLAB search path used by RunMat.", "code": "p = path();\ndisp(p)", "output": "//runmat/toolbox://runmat/user", "keywords": ["path", "search path", "matlab path", "addpath", "rmpath"], "suggestedPath": "/path-1.m" }, { "id": "path:2", "builtinKey": "path", "builtinTitle": "path", "builtinSlug": "path", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Temporarily replace the MATLAB path", "summary": "Query or replace the MATLAB search path used by RunMat.", "code": "old = path(\"//runmat-addons\");\n% ... run code that relies on the temporary path ...\npath(old); % Restore the previous path", "output": "old =\n '//runmat/toolbox://runmat/user'", "keywords": ["path", "search path", "matlab path", "addpath", "rmpath"], "suggestedPath": "/path-2.m" }, { "id": "path:3", "builtinKey": "path", "builtinTitle": "path", "builtinSlug": "path", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Append folders to the end of the search path", "summary": "Query or replace the MATLAB search path used by RunMat.", "code": "extra = \"//projects/analysis\";\npath(path(), extra);\npath()", "output": "ans =\n '//runmat/toolbox://runmat/user://projects/analysis'", "keywords": ["path", "search path", "matlab path", "addpath", "rmpath"], "suggestedPath": "/path-3.m" }, { "id": "path:4", "builtinKey": "path", "builtinTitle": "path", "builtinSlug": "path", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Prepend folders ahead of the existing path", "summary": "Query or replace the MATLAB search path used by RunMat.", "code": "extra = \"/opt/runmat/toolbox\";\npath(extra, path());\npath()", "output": "ans =\n '/opt/runmat/toolbox://runmat/toolbox://runmat/user'", "keywords": ["path", "search path", "matlab path", "addpath", "rmpath"], "suggestedPath": "/path-4.m" }, { "id": "path:5", "builtinKey": "path", "builtinTitle": "path", "builtinSlug": "path", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Combine generated folder lists", "summary": "Query or replace the MATLAB search path used by RunMat.", "code": "tooling = genpath(\"submodules/tooling\");\nold = path(tooling, path())", "output": "% The directories returned by genpath now appear ahead of the previous path entries.", "keywords": ["path", "search path", "matlab path", "addpath", "rmpath"], "suggestedPath": "/path-5.m" }, { "id": "pause:1", "builtinKey": "pause", "builtinTitle": "pause", "builtinSlug": "pause", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Pausing for a fixed duration", "summary": "Suspend execution until the user presses a key or a specified time elapses.", "code": "tic;\npause(0.05); % wait 50 milliseconds\nelapsed = toc", "keywords": ["pause", "sleep", "wait", "delay", "press any key", "execution"], "suggestedPath": "/pause-1.m" }, { "id": "pause:2", "builtinKey": "pause", "builtinTitle": "pause", "builtinSlug": "pause", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Waiting for user input mid-script", "summary": "Suspend execution until the user presses a key or a specified time elapses.", "code": "disp(\"Press any key to continue the demo...\");\npause; % waits until the user presses a key (while pause is 'on')", "keywords": ["pause", "sleep", "wait", "delay", "press any key", "execution"], "suggestedPath": "/pause-2.m" }, { "id": "pause:3", "builtinKey": "pause", "builtinTitle": "pause", "builtinSlug": "pause", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Temporarily disabling pauses in automated runs", "summary": "Suspend execution until the user presses a key or a specified time elapses.", "code": "state = pause('off'); % returns previous state so it can be restored\ncleanup = onCleanup(@() pause(state)); % ensure state is restored\npause(1.0); % returns immediately because pause is disabled", "keywords": ["pause", "sleep", "wait", "delay", "press any key", "execution"], "suggestedPath": "/pause-3.m" }, { "id": "pause:4", "builtinKey": "pause", "builtinTitle": "pause", "builtinSlug": "pause", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Querying the current pause mode", "summary": "Suspend execution until the user presses a key or a specified time elapses.", "code": "current = pause('query'); % returns 'on' or 'off'", "keywords": ["pause", "sleep", "wait", "delay", "press any key", "execution"], "suggestedPath": "/pause-4.m" }, { "id": "pause:5", "builtinKey": "pause", "builtinTitle": "pause", "builtinSlug": "pause", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Using empty input to rely on the default behaviour", "summary": "Suspend execution until the user presses a key or a specified time elapses.", "code": "pause([]); % equivalent to calling pause with no arguments", "keywords": ["pause", "sleep", "wait", "delay", "press any key", "execution"], "suggestedPath": "/pause-5.m" }, { "id": "permute:1", "builtinKey": "permute", "builtinTitle": "permute", "builtinSlug": "permute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Swapping the first two dimensions of a 3-D tensor", "summary": "Reorder the dimensions of arrays, tensors, logical masks, and gpuArray values.", "code": "A = reshape(1:24, [2 3 4]);\nB = permute(A, [2 1 3]);\nsize(B)", "output": "ans = [3 2 4]", "keywords": ["permute", "dimension reorder", "swap axes", "gpu"], "suggestedPath": "/permute-1.m" }, { "id": "permute:2", "builtinKey": "permute", "builtinTitle": "permute", "builtinSlug": "permute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Moving the last dimension to the front", "summary": "Reorder the dimensions of arrays, tensors, logical masks, and gpuArray values.", "code": "A = rand(4, 2, 5);\nC = permute(A, [3 1 2]);\nsize(C)", "output": "ans = [5 4 2]", "keywords": ["permute", "dimension reorder", "swap axes", "gpu"], "suggestedPath": "/permute-2.m" }, { "id": "permute:3", "builtinKey": "permute", "builtinTitle": "permute", "builtinSlug": "permute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Adding an explicit trailing singleton dimension", "summary": "Reorder the dimensions of arrays, tensors, logical masks, and gpuArray values.", "code": "row = 1:5;\nT = permute(row, [2 1 3]);\nsize(T)", "output": "ans = [5 1 1]", "keywords": ["permute", "dimension reorder", "swap axes", "gpu"], "suggestedPath": "/permute-3.m" }, { "id": "permute:4", "builtinKey": "permute", "builtinTitle": "permute", "builtinSlug": "permute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Permuting logical masks without losing type information", "summary": "Reorder the dimensions of arrays, tensors, logical masks, and gpuArray values.", "code": "mask = false(2, 1, 3);\nmask(1, 1, 2) = true;\nrotated = permute(mask, [3 1 2]);\nclass(rotated)", "output": "ans = 'logical'", "keywords": ["permute", "dimension reorder", "swap axes", "gpu"], "suggestedPath": "/permute-4.m" }, { "id": "permute:5", "builtinKey": "permute", "builtinTitle": "permute", "builtinSlug": "permute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Transposing character arrays", "summary": "Reorder the dimensions of arrays, tensors, logical masks, and gpuArray values.", "code": "C = ['r','u','n'; 'm','a','t'];\nCt = permute(C, [2 1])", "output": "Ct =\n 'rm'\n 'ua'\n 'nt'", "keywords": ["permute", "dimension reorder", "swap axes", "gpu"], "suggestedPath": "/permute-5.m" }, { "id": "permute:6", "builtinKey": "permute", "builtinTitle": "permute", "builtinSlug": "permute", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Permuting gpuArray data while staying on the device", "summary": "Reorder the dimensions of arrays, tensors, logical masks, and gpuArray values.", "code": "G = gpuArray(rand(4, 2, 3));\nH = permute(G, [3 1 2]);\nisgpuarray(H)", "output": "ans = logical 1", "keywords": ["permute", "dimension reorder", "swap axes", "gpu"], "suggestedPath": "/permute-6.m" }, { "id": "pie:1", "builtinKey": "pie", "builtinTitle": "pie", "builtinSlug": "pie", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a basic pie chart", "summary": "Create pie charts for part-to-whole comparisons, exploded slices, and MATLAB `pie` workflows.", "code": "pie([2 3 5]);", "keywords": ["pie", "pie chart", "exploded pie chart", "slice labels", "matlab pie"], "suggestedPath": "/pie-1.m" }, { "id": "pie:2", "builtinKey": "pie", "builtinTitle": "pie", "builtinSlug": "pie", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create an exploded pie chart", "summary": "Create pie charts for part-to-whole comparisons, exploded slices, and MATLAB `pie` workflows.", "code": "values = [4 2 3 1];\nexplode = [1 0 1 0];\npie(values, explode);", "keywords": ["pie", "pie chart", "exploded pie chart", "slice labels", "matlab pie"], "suggestedPath": "/pie-2.m" }, { "id": "pie:3", "builtinKey": "pie", "builtinTitle": "pie", "builtinSlug": "pie", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use labels for slice names", "summary": "Create pie charts for part-to-whole comparisons, exploded slices, and MATLAB `pie` workflows.", "code": "values = [5 3 2];\nlabels = {'compute', 'io', 'render'};\npie(values, labels);", "keywords": ["pie", "pie chart", "exploded pie chart", "slice labels", "matlab pie"], "suggestedPath": "/pie-3.m" }, { "id": "pinv:1", "builtinKey": "pinv", "builtinTitle": "pinv", "builtinSlug": "pinv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Finding the pseudoinverse of a tall matrix", "summary": "Compute the Moore–Penrose pseudoinverse of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "A = [1 0; 0 0; 0 1];\nX = pinv(A)", "output": "X =\n 1 0 0\n 0 0 1", "keywords": ["pinv", "pseudoinverse", "least squares", "svd", "gpu"], "suggestedPath": "/pinv-1.m" }, { "id": "pinv:2", "builtinKey": "pinv", "builtinTitle": "pinv", "builtinSlug": "pinv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Solving an overdetermined least-squares problem", "summary": "Compute the Moore–Penrose pseudoinverse of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "A = [1 1; 1 2; 1 3];\nb = [1; 0; 0];\nx = pinv(A) * b", "output": "x =\n 1.1667\n -0.5000", "keywords": ["pinv", "pseudoinverse", "least squares", "svd", "gpu"], "suggestedPath": "/pinv-2.m" }, { "id": "pinv:3", "builtinKey": "pinv", "builtinTitle": "pinv", "builtinSlug": "pinv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Suppressing small singular values with a custom tolerance", "summary": "Compute the Moore–Penrose pseudoinverse of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "A = diag([1, 1e-10]);\nX = pinv(A, 1e-6)", "output": "X =\n 1 0\n 0 0", "keywords": ["pinv", "pseudoinverse", "least squares", "svd", "gpu"], "suggestedPath": "/pinv-3.m" }, { "id": "pinv:4", "builtinKey": "pinv", "builtinTitle": "pinv", "builtinSlug": "pinv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Pseudoinverse of a rank-deficient square matrix", "summary": "Compute the Moore–Penrose pseudoinverse of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "A = [1 2; 2 4];\nX = pinv(A)", "output": "X =\n 0.0400 0.0800\n 0.0800 0.1600", "keywords": ["pinv", "pseudoinverse", "least squares", "svd", "gpu"], "suggestedPath": "/pinv-4.m" }, { "id": "pinv:5", "builtinKey": "pinv", "builtinTitle": "pinv", "builtinSlug": "pinv", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Pseudoinverse of a complex diagonal matrix", "summary": "Compute the Moore–Penrose pseudoinverse of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "A = diag([2+1i, 3-2i]);\nX = pinv(A)", "output": "X =\n 0.4000 - 0.2000i 0\n 0 0.2308 + 0.1538i", "keywords": ["pinv", "pseudoinverse", "least squares", "svd", "gpu"], "suggestedPath": "/pinv-5.m" }, { "id": "plot:1", "builtinKey": "plot", "builtinTitle": "plot", "builtinSlug": "plot", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Plot paired x/y data as a basic line chart", "summary": "Create 2-D line plots with handle-based styling, multi-series support, and MATLAB `plot(x, y)` semantics.", "code": "x = linspace(0, 2*pi, 200);\ny = sin(x);\nh = plot(x, y);", "output": "% h is a numeric handle for the first line object", "keywords": ["plot", "line plot", "2-D plotting", "plot x y", "matlab plot", "gpu plotting", "runmat plotting"], "suggestedPath": "/plot-1.m" }, { "id": "plot:2", "builtinKey": "plot", "builtinTitle": "plot", "builtinSlug": "plot", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use MATLAB-style y-only shorthand", "summary": "Create 2-D line plots with handle-based styling, multi-series support, and MATLAB `plot(x, y)` semantics.", "code": "samples = [1 4 2 5 3];\nplot(samples);", "output": "% RunMat uses 1:length(samples) for the x-axis", "keywords": ["plot", "line plot", "2-D plotting", "plot x y", "matlab plot", "gpu plotting", "runmat plotting"], "suggestedPath": "/plot-2.m" }, { "id": "plot:3", "builtinKey": "plot", "builtinTitle": "plot", "builtinSlug": "plot", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create multiple series and drive the legend from display names", "summary": "Create 2-D line plots with handle-based styling, multi-series support, and MATLAB `plot(x, y)` semantics.", "code": "x = linspace(0, 2*pi, 200);\nh1 = plot(x, sin(x));\nset(h1, 'DisplayName', 'sin(x)', 'LineWidth', 2);\nhold on;\nh2 = plot(x, cos(x));\nset(h2, 'DisplayName', 'cos(x)');\nlegend;", "output": "% The legend uses the line DisplayName properties", "keywords": ["plot", "line plot", "2-D plotting", "plot x y", "matlab plot", "gpu plotting", "runmat plotting"], "suggestedPath": "/plot-3.m" }, { "id": "plot:4", "builtinKey": "plot", "builtinTitle": "plot", "builtinSlug": "plot", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect and update a plotted line through handles", "summary": "Create 2-D line plots with handle-based styling, multi-series support, and MATLAB `plot(x, y)` semantics.", "code": "x = 0:0.1:1;\nh = plot(x, x.^2);\nget(h, 'Type')\nset(h, 'Color', 'r', 'Marker', 'o', 'MarkerSize', 6);", "output": "ans =\n 'line'", "keywords": ["plot", "line plot", "2-D plotting", "plot x y", "matlab plot", "gpu plotting", "runmat plotting"], "suggestedPath": "/plot-4.m" }, { "id": "plot3:1", "builtinKey": "plot3", "builtinTitle": "plot3", "builtinSlug": "plot3", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a 3-D helix", "summary": "Create 3-D line plots for trajectories, parametric curves, and spatial paths with MATLAB `plot3` semantics.", "code": "t = linspace(0, 6*pi, 300);\nplot3(cos(t), sin(t), t);", "keywords": ["plot3", "3-D line plot", "trajectory plot", "parametric curve", "matlab plot3", "spatial path"], "suggestedPath": "/plot3-1.m" }, { "id": "plot3:2", "builtinKey": "plot3", "builtinTitle": "plot3", "builtinSlug": "plot3", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Plot multiple 3-D trajectories and label them", "summary": "Create 3-D line plots for trajectories, parametric curves, and spatial paths with MATLAB `plot3` semantics.", "code": "t = linspace(0, 4*pi, 200);\nh1 = plot3(cos(t), sin(t), t);\nset(h1, 'DisplayName', 'helix A');\nhold on;\nh2 = plot3(cos(t), sin(t), -t);\nset(h2, 'DisplayName', 'helix B');\nlegend;", "keywords": ["plot3", "3-D line plot", "trajectory plot", "parametric curve", "matlab plot3", "spatial path"], "suggestedPath": "/plot3-2.m" }, { "id": "plot3:3", "builtinKey": "plot3", "builtinTitle": "plot3", "builtinSlug": "plot3", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Control the camera and z-axis after plotting", "summary": "Create 3-D line plots for trajectories, parametric curves, and spatial paths with MATLAB `plot3` semantics.", "code": "t = linspace(0, 4*pi, 150);\nh = plot3(cos(t), sin(t), t);\nzlabel('Height');\nview(45, 20);\nget(h, 'Type')", "output": "ans =\n 'line'", "keywords": ["plot3", "3-D line plot", "trajectory plot", "parametric curve", "matlab plot3", "spatial path"], "suggestedPath": "/plot3-3.m" }, { "id": "plus:1", "builtinKey": "plus", "builtinTitle": "plus", "builtinSlug": "plus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Adding two matrices element-wise", "summary": "Element-wise addition A + B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "A = [1 2 3; 4 5 6];\nB = [7 8 9; 1 2 3];\nS = plus(A, B)", "output": "S =\n 8 10 12\n 5 7 9", "keywords": ["plus", "element-wise addition", "+", "gpu", "implicit expansion"], "suggestedPath": "/plus-1.m" }, { "id": "plus:2", "builtinKey": "plus", "builtinTitle": "plus", "builtinSlug": "plus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Adding a scalar to every element of a matrix", "summary": "Element-wise addition A + B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "A = magic(3);\nshifted = plus(A, 0.5)", "output": "shifted =\n 8.5 1.5 6.5\n 3.5 5.5 9.5\n 10.5 7.5 2.5", "keywords": ["plus", "element-wise addition", "+", "gpu", "implicit expansion"], "suggestedPath": "/plus-2.m" }, { "id": "plus:3", "builtinKey": "plus", "builtinTitle": "plus", "builtinSlug": "plus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Using implicit expansion between a column and row vector", "summary": "Element-wise addition A + B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "col = (1:3)';\nrow = [10 20 30];\nm = plus(col, row)", "output": "m =\n 11 21 31\n 12 22 32\n 13 23 33", "keywords": ["plus", "element-wise addition", "+", "gpu", "implicit expansion"], "suggestedPath": "/plus-3.m" }, { "id": "plus:4", "builtinKey": "plus", "builtinTitle": "plus", "builtinSlug": "plus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Adding complex inputs element-wise", "summary": "Element-wise addition A + B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "z1 = [1+2i, 3-4i];\nz2 = [2-1i, -1+1i];\nsumz = plus(z1, z2)", "output": "sumz =\n 3 + 1i 2 - 3i", "keywords": ["plus", "element-wise addition", "+", "gpu", "implicit expansion"], "suggestedPath": "/plus-4.m" }, { "id": "plus:5", "builtinKey": "plus", "builtinTitle": "plus", "builtinSlug": "plus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Adding character codes to produce numeric arrays", "summary": "Element-wise addition A + B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "letters = 'ABC';\ncodes = plus(letters, 2)", "output": "codes = [67 68 69]", "keywords": ["plus", "element-wise addition", "+", "gpu", "implicit expansion"], "suggestedPath": "/plus-5.m" }, { "id": "plus:6", "builtinKey": "plus", "builtinTitle": "plus", "builtinSlug": "plus", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Keeping element-wise sums on the GPU with `'like'`", "summary": "Element-wise addition A + B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "proto = gpuArray.zeros(1, 1);\nG1 = gpuArray([1 2 3]);\nG2 = gpuArray([4 5 6]);\ndeviceSum = plus(G1, G2, 'like', proto);\nresult = gather(deviceSum)", "output": "deviceSum =\n 1x3 gpuArray\n 5 7 9\nresult =\n 5 7 9", "keywords": ["plus", "element-wise addition", "+", "gpu", "implicit expansion"], "suggestedPath": "/plus-6.m" }, { "id": "polyder:1", "builtinKey": "polyder", "builtinTitle": "polyder", "builtinSlug": "polyder", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Differentiating a cubic polynomial", "summary": "Differentiate polynomials, products, and ratios with MATLAB-compatible coefficient vectors.", "code": "p = [3 -2 5 7]; % 3x^3 - 2x^2 + 5x + 7\ndp = polyder(p)", "output": "dp = [9 -4 5]", "keywords": ["polyder", "polynomial derivative", "product rule", "quotient rule", "gpu"], "suggestedPath": "/polyder-1.m" }, { "id": "polyder:2", "builtinKey": "polyder", "builtinTitle": "polyder", "builtinSlug": "polyder", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Applying the product rule", "summary": "Differentiate polynomials, products, and ratios with MATLAB-compatible coefficient vectors.", "code": "p = [1 0 -2]; % x^2 - 2\na = [1 1]; % x + 1\ndp = polyder(p, a); % derivative of conv(p, a)", "output": "dp = [3 2 -2]", "keywords": ["polyder", "polynomial derivative", "product rule", "quotient rule", "gpu"], "suggestedPath": "/polyder-2.m" }, { "id": "polyder:3", "builtinKey": "polyder", "builtinTitle": "polyder", "builtinSlug": "polyder", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Differentiating a rational function", "summary": "Differentiate polynomials, products, and ratios with MATLAB-compatible coefficient vectors.", "code": "u = [1 0 -4]; % x^2 - 4\nv = [1 -1]; % x - 1\n[num, den] = polyder(u, v); % derivative of (u / v)", "output": "num = [1 -2 4];\nden = [1 -2 1]", "keywords": ["polyder", "polynomial derivative", "product rule", "quotient rule", "gpu"], "suggestedPath": "/polyder-3.m" }, { "id": "polyder:4", "builtinKey": "polyder", "builtinTitle": "polyder", "builtinSlug": "polyder", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Preserving column-vector orientation", "summary": "Differentiate polynomials, products, and ratios with MATLAB-compatible coefficient vectors.", "code": "p = [1; 0; -3]; % column vector coefficients\ndp = polyder(p)", "output": "dp =\n 2\n 0", "keywords": ["polyder", "polynomial derivative", "product rule", "quotient rule", "gpu"], "suggestedPath": "/polyder-4.m" }, { "id": "polyder:5", "builtinKey": "polyder", "builtinTitle": "polyder", "builtinSlug": "polyder", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Differentiating complex-valued coefficients", "summary": "Differentiate polynomials, products, and ratios with MATLAB-compatible coefficient vectors.", "code": "p = [1+2i, -3, 4i];\ndp = polyder(p)", "output": "dp = [2+4i, -3]", "keywords": ["polyder", "polynomial derivative", "product rule", "quotient rule", "gpu"], "suggestedPath": "/polyder-5.m" }, { "id": "polyder:6", "builtinKey": "polyder", "builtinTitle": "polyder", "builtinSlug": "polyder", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Working with gpuArray inputs", "summary": "Differentiate polynomials, products, and ratios with MATLAB-compatible coefficient vectors.", "code": "g = gpuArray([2 0 -5 4]);\ndp = polyder(g); % stays on the GPU when provider hooks are available\nresult = gather(dp)", "output": "result = [6 0 -5]", "keywords": ["polyder", "polynomial derivative", "product rule", "quotient rule", "gpu"], "suggestedPath": "/polyder-6.m" }, { "id": "polyfit:1", "builtinKey": "polyfit", "builtinTitle": "polyfit", "builtinSlug": "polyfit", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Fitting a straight line through noisy samples", "summary": "Fit an n-th degree polynomial to data points using least squares with MATLAB-compatible outputs.", "code": "x = 0:5;\ny = 2.5 * x + 1 + 0.05 * randn(size(x));\np = polyfit(x, y, 1)", "output": "p ≈ [2.5 1.0]; % slope and intercept recovered from noisy data", "keywords": ["polyfit", "polynomial fitting", "least squares", "prediction intervals", "gpu"], "suggestedPath": "/polyfit-1.m" }, { "id": "polyfit:2", "builtinKey": "polyfit", "builtinTitle": "polyfit", "builtinSlug": "polyfit", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Computing a quadratic fit and reusing `mu`", "summary": "Fit an n-th degree polynomial to data points using least squares with MATLAB-compatible outputs.", "code": "x = -3:3;\ny = x.^2 - 2 * x + 4;\n[p, S, mu] = polyfit(x, y, 2);\nsmoothed = polyval(p, x, [], mu)", "output": "smoothed matches y exactly because the quadratic model fits perfectly.", "keywords": ["polyfit", "polynomial fitting", "least squares", "prediction intervals", "gpu"], "suggestedPath": "/polyfit-2.m" }, { "id": "polyfit:3", "builtinKey": "polyfit", "builtinTitle": "polyfit", "builtinSlug": "polyfit", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Retrieving the structure `S` for prediction intervals", "summary": "Fit an n-th degree polynomial to data points using least squares with MATLAB-compatible outputs.", "code": "t = linspace(0, 2*pi, 25);\ny = sin(t) + 0.1 * randn(size(t));\n[p, S, mu] = polyfit(t, y, 3);\n[fitted, delta] = polyval(p, t, S, mu)", "output": "delta contains the one-standard-deviation prediction interval for each fitted sample.", "keywords": ["polyfit", "polynomial fitting", "least squares", "prediction intervals", "gpu"], "suggestedPath": "/polyfit-3.m" }, { "id": "polyfit:4", "builtinKey": "polyfit", "builtinTitle": "polyfit", "builtinSlug": "polyfit", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Weighted polynomial fit", "summary": "Fit an n-th degree polynomial to data points using least squares with MATLAB-compatible outputs.", "code": "x = linspace(-1, 1, 7);\ny = [1.1 0.4 0.2 0.0 0.1 0.5 1.4];\nw = [1 2 2 4 2 2 1];\np = polyfit(x, y, 2, w)", "output": "Central samples influence the fit more heavily, matching MATLAB's weighting semantics.", "keywords": ["polyfit", "polynomial fitting", "least squares", "prediction intervals", "gpu"], "suggestedPath": "/polyfit-4.m" }, { "id": "polyfit:5", "builtinKey": "polyfit", "builtinTitle": "polyfit", "builtinSlug": "polyfit", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Using `polyfit` with `gpuArray` inputs", "summary": "Fit an n-th degree polynomial to data points using least squares with MATLAB-compatible outputs.", "code": "x = gpuArray.linspace(-2, 2, 50);\ny = gpuArray((x - 0.5).^3);\np = polyfit(x, y, 3)", "output": "p is returned on the host today; convert it back to gpuArray if desired.", "keywords": ["polyfit", "polynomial fitting", "least squares", "prediction intervals", "gpu"], "suggestedPath": "/polyfit-5.m" }, { "id": "polyfit:6", "builtinKey": "polyfit", "builtinTitle": "polyfit", "builtinSlug": "polyfit", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Complex-valued data with `polyfit`", "summary": "Fit an n-th degree polynomial to data points using least squares with MATLAB-compatible outputs.", "code": "x = 0:4;\ny = exp(1i * x);\np = polyfit(x, y, 2)", "output": "p is complex-valued and matches MATLAB's complex least-squares solution.", "keywords": ["polyfit", "polynomial fitting", "least squares", "prediction intervals", "gpu"], "suggestedPath": "/polyfit-6.m" }, { "id": "polyint:1", "builtinKey": "polyint", "builtinTitle": "polyint", "builtinSlug": "polyint", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Integrating a cubic polynomial", "summary": "Integrate polynomial coefficient vectors and append a constant of integration.", "code": "p = [3 -2 5 7]; % 3x^3 - 2x^2 + 5x + 7\nq = polyint(p)", "output": "q = [0.75 -0.6667 2.5 7 0]", "keywords": ["polyint", "polynomial integral", "antiderivative", "integration constant", "gpu"], "suggestedPath": "/polyint-1.m" }, { "id": "polyint:2", "builtinKey": "polyint", "builtinTitle": "polyint", "builtinSlug": "polyint", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Supplying a constant of integration", "summary": "Integrate polynomial coefficient vectors and append a constant of integration.", "code": "p = [4 0 -8];\nq = polyint(p, 3)", "output": "q = [1.3333 0 -8 3]", "keywords": ["polyint", "polynomial integral", "antiderivative", "integration constant", "gpu"], "suggestedPath": "/polyint-2.m" }, { "id": "polyint:3", "builtinKey": "polyint", "builtinTitle": "polyint", "builtinSlug": "polyint", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Preserving column-vector orientation", "summary": "Integrate polynomial coefficient vectors and append a constant of integration.", "code": "p = [2; 0; -6];\nq = polyint(p)", "output": "q =\n 0.6667\n 0\n -6.0000\n 0", "keywords": ["polyint", "polynomial integral", "antiderivative", "integration constant", "gpu"], "suggestedPath": "/polyint-3.m" }, { "id": "polyint:4", "builtinKey": "polyint", "builtinTitle": "polyint", "builtinSlug": "polyint", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Integrating the zero polynomial", "summary": "Integrate polynomial coefficient vectors and append a constant of integration.", "code": "q = polyint([])", "output": "q = 0", "keywords": ["polyint", "polynomial integral", "antiderivative", "integration constant", "gpu"], "suggestedPath": "/polyint-4.m" }, { "id": "polyint:5", "builtinKey": "polyint", "builtinTitle": "polyint", "builtinSlug": "polyint", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Integrating complex coefficients", "summary": "Integrate polynomial coefficient vectors and append a constant of integration.", "code": "p = [1+2i -3 4i];\nq = polyint(p, -1i)", "output": "q = [(1+2i)/3 -1.5 4i -1i]", "keywords": ["polyint", "polynomial integral", "antiderivative", "integration constant", "gpu"], "suggestedPath": "/polyint-5.m" }, { "id": "polyint:6", "builtinKey": "polyint", "builtinTitle": "polyint", "builtinSlug": "polyint", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Working with gpuArray inputs", "summary": "Integrate polynomial coefficient vectors and append a constant of integration.", "code": "g = gpuArray([1 -4 6]);\nq = polyint(g); % Gathered to host, integrated, and re-uploaded\nresult = gather(q)", "output": "result = [0.3333 -2 6 0]", "keywords": ["polyint", "polynomial integral", "antiderivative", "integration constant", "gpu"], "suggestedPath": "/polyint-6.m" }, { "id": "polyval:1", "builtinKey": "polyval", "builtinTitle": "polyval", "builtinSlug": "polyval", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Evaluating a polynomial at scalar points", "summary": "Evaluate a polynomial at given points and optionally compute prediction intervals using polyfit output.", "code": "p = [2 -3 5]; % 2x^2 - 3x + 5\ny = polyval(p, 4)", "output": "y = 21", "keywords": ["polyval", "polynomial evaluation", "prediction interval", "polyfit", "gpu"], "suggestedPath": "/polyval-1.m" }, { "id": "polyval:2", "builtinKey": "polyval", "builtinTitle": "polyval", "builtinSlug": "polyval", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Evaluating across a vector of inputs", "summary": "Evaluate a polynomial at given points and optionally compute prediction intervals using polyfit output.", "code": "p = [1 0 -2 1];\nx = linspace(-2, 2, 5);\ny = polyval(p, x)", "output": "y = [ -3 2 1 0 5 ]", "keywords": ["polyval", "polynomial evaluation", "prediction interval", "polyfit", "gpu"], "suggestedPath": "/polyval-2.m" }, { "id": "polyval:3", "builtinKey": "polyval", "builtinTitle": "polyval", "builtinSlug": "polyval", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Evaluating a polynomial over a matrix grid", "summary": "Evaluate a polynomial at given points and optionally compute prediction intervals using polyfit output.", "code": "[X, Y] = meshgrid(-1:1);\nZ = polyval([1 -3 2], X + Y)", "output": "Z =\n 12 6 2\n 6 2 0\n 2 0 0", "keywords": ["polyval", "polynomial evaluation", "prediction interval", "polyfit", "gpu"], "suggestedPath": "/polyval-3.m" }, { "id": "polyval:4", "builtinKey": "polyval", "builtinTitle": "polyval", "builtinSlug": "polyval", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Using centering and scaling parameters from `polyfit`", "summary": "Evaluate a polynomial at given points and optionally compute prediction intervals using polyfit output.", "code": "x = -2:2;\nnoise = 0.05 * randn(size(x));\n[p, S, mu] = polyfit(x, sin(x) + noise, 3);\ny = polyval(p, x, [], mu)", "output": "% y closely matches sin(x) + noise with polynomial smoothing", "keywords": ["polyval", "polynomial evaluation", "prediction interval", "polyfit", "gpu"], "suggestedPath": "/polyval-4.m" }, { "id": "polyval:5", "builtinKey": "polyval", "builtinTitle": "polyval", "builtinSlug": "polyval", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Computing prediction intervals with polyfit output", "summary": "Evaluate a polynomial at given points and optionally compute prediction intervals using polyfit output.", "code": "[p, S, mu] = polyfit((0:10)', exp((0:10)'/10), 3);\n[y, delta] = polyval(p, 5, S, mu)", "output": "% y is the fitted value at x = 5\n% delta is the 1σ prediction interval (standard error)", "keywords": ["polyval", "polynomial evaluation", "prediction interval", "polyfit", "gpu"], "suggestedPath": "/polyval-5.m" }, { "id": "polyval:6", "builtinKey": "polyval", "builtinTitle": "polyval", "builtinSlug": "polyval", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Handling complex coefficients and inputs", "summary": "Evaluate a polynomial at given points and optionally compute prediction intervals using polyfit output.", "code": "p = [1+2i, -3, 4i];\nz = [-1+1i, 0, 1-2i];\ny = polyval(p, z)", "output": "% Complex results that agree with MATLAB's polyval", "keywords": ["polyval", "polynomial evaluation", "prediction interval", "polyfit", "gpu"], "suggestedPath": "/polyval-6.m" }, { "id": "polyval:7", "builtinKey": "polyval", "builtinTitle": "polyval", "builtinSlug": "polyval", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Evaluating on a gpuArray input", "summary": "Evaluate a polynomial at given points and optionally compute prediction intervals using polyfit output.", "code": "x = gpuArray.linspace(-1, 1, 2048);\np = [1 0 1];\ny = polyval(p, x); % Runs on the GPU for real-valued inputs", "output": "y is a gpuArray because the result is real-valued.", "keywords": ["polyval", "polynomial evaluation", "prediction interval", "polyfit", "gpu"], "suggestedPath": "/polyval-7.m" }, { "id": "pow2:1", "builtinKey": "pow2", "builtinTitle": "pow2", "builtinSlug": "pow2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Compute power-of-two for scalar exponents", "summary": "Compute 2.^X or scale mantissas by binary exponents with MATLAB-compatible semantics.", "code": "y = pow2(3)", "output": "y = 8", "keywords": ["pow2", "ldexp", "binary scaling", "gpu"], "suggestedPath": "/pow2-1.m" }, { "id": "pow2:2", "builtinKey": "pow2", "builtinTitle": "pow2", "builtinSlug": "pow2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Apply `pow2` to a vector of exponents", "summary": "Compute 2.^X or scale mantissas by binary exponents with MATLAB-compatible semantics.", "code": "exponents = [-1 0 1 2];\nvalues = pow2(exponents)", "output": "values = [0.5 1 2 4]", "keywords": ["pow2", "ldexp", "binary scaling", "gpu"], "suggestedPath": "/pow2-2.m" }, { "id": "pow2:3", "builtinKey": "pow2", "builtinTitle": "pow2", "builtinSlug": "pow2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Scale mantissas by binary exponents", "summary": "Compute 2.^X or scale mantissas by binary exponents with MATLAB-compatible semantics.", "code": "mantissa = [0.75 1.5];\nexponent = [4 5];\nscaled = pow2(mantissa, exponent)", "output": "scaled = [12 48]", "keywords": ["pow2", "ldexp", "binary scaling", "gpu"], "suggestedPath": "/pow2-3.m" }, { "id": "pow2:4", "builtinKey": "pow2", "builtinTitle": "pow2", "builtinSlug": "pow2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Use complex exponents with `pow2`", "summary": "Compute 2.^X or scale mantissas by binary exponents with MATLAB-compatible semantics.", "code": "z = pow2(1 + 2i)", "output": "z = -0.3667 + 0.8894i", "keywords": ["pow2", "ldexp", "binary scaling", "gpu"], "suggestedPath": "/pow2-4.m" }, { "id": "pow2:5", "builtinKey": "pow2", "builtinTitle": "pow2", "builtinSlug": "pow2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Run `pow2` on GPU arrays", "summary": "Compute 2.^X or scale mantissas by binary exponents with MATLAB-compatible semantics.", "code": "G = gpuArray([1 2 3]);\nresult_gpu = pow2(G);\nresult = gather(result_gpu)", "output": "result = [2 4 8]", "keywords": ["pow2", "ldexp", "binary scaling", "gpu"], "suggestedPath": "/pow2-5.m" }, { "id": "pow2:6", "builtinKey": "pow2", "builtinTitle": "pow2", "builtinSlug": "pow2", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert characters to power-of-two values", "summary": "Compute 2.^X or scale mantissas by binary exponents with MATLAB-compatible semantics.", "code": "codes = pow2('ABC')", "output": "codes = [3.6893e+19 7.3787e+19 1.4757e+20]", "keywords": ["pow2", "ldexp", "binary scaling", "gpu"], "suggestedPath": "/pow2-6.m" }, { "id": "power:1", "builtinKey": "power", "builtinTitle": "power", "builtinSlug": "power", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Raise a scalar to a power", "summary": "Element-wise exponentiation A .^ B with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "y = power(2, 5)", "output": "y = 32", "keywords": ["power", "element-wise power", "dot caret", "gpu", "broadcasting"], "suggestedPath": "/power-1.m" }, { "id": "power:2", "builtinKey": "power", "builtinTitle": "power", "builtinSlug": "power", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Compute element-wise powers of a matrix", "summary": "Element-wise exponentiation A .^ B with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "A = [1 2 3; 4 5 6];\nB = power(A, 2)", "output": "B =\n 1 4 9\n 16 25 36", "keywords": ["power", "element-wise power", "dot caret", "gpu", "broadcasting"], "suggestedPath": "/power-2.m" }, { "id": "power:3", "builtinKey": "power", "builtinTitle": "power", "builtinSlug": "power", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Broadcast exponents across rows", "summary": "Element-wise exponentiation A .^ B with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "base = (1:3)';\nexponent = [1 2 3];\nresult = power(base, exponent)", "output": "result =\n 1 1 1\n 2 4 8\n 3 9 27", "keywords": ["power", "element-wise power", "dot caret", "gpu", "broadcasting"], "suggestedPath": "/power-3.m" }, { "id": "power:4", "builtinKey": "power", "builtinTitle": "power", "builtinSlug": "power", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Generate complex powers from negative bases", "summary": "Element-wise exponentiation A .^ B with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "values = power([-2 -1 0 1 2], 0.5)", "output": "values = [0.0000 + 1.4142i, 0.0000 + 1.0000i, 0, 1, 1.4142]", "keywords": ["power", "element-wise power", "dot caret", "gpu", "broadcasting"], "suggestedPath": "/power-4.m" }, { "id": "power:5", "builtinKey": "power", "builtinTitle": "power", "builtinSlug": "power", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Keep GPU results with a `'like'` prototype", "summary": "Element-wise exponentiation A .^ B with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "proto = gpuArray.zeros(1, 1, 'single');\nx = [1 2 3];\ny = [2 3 4];\ndevicePowers = power(x, y, 'like', proto);\nresult = gather(devicePowers)", "output": "devicePowers =\n 1x3 gpuArray single\n 1 8 81\nresult =\n 1 8 81", "keywords": ["power", "element-wise power", "dot caret", "gpu", "broadcasting"], "suggestedPath": "/power-5.m" }, { "id": "power:6", "builtinKey": "power", "builtinTitle": "power", "builtinSlug": "power", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert character codes before powering", "summary": "Element-wise exponentiation A .^ B with MATLAB-compatible broadcasting, complex support, and GPU fallbacks.", "code": "codes = power('ABC', 2)", "output": "codes = [4225 4356 4489]", "keywords": ["power", "element-wise power", "dot caret", "gpu", "broadcasting"], "suggestedPath": "/power-6.m" }, { "id": "prod:1", "builtinKey": "prod", "builtinTitle": "prod", "builtinSlug": "prod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Multiplying the elements of a matrix", "summary": "Multiply elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [1 2 3; 4 5 6];\ncolProd = prod(A);\nrowProd = prod(A, 2)", "output": "colProd = [4 10 18];\nrowProd = [6; 120]", "keywords": ["prod", "product", "reduction", "omitnan", "gpu"], "suggestedPath": "/prod-1.m" }, { "id": "prod:2", "builtinKey": "prod", "builtinTitle": "prod", "builtinSlug": "prod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Multiplying across multiple dimensions", "summary": "Multiply elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "B = reshape(1:24, [3 4 2]);\nprod13 = prod(B, [1 3])", "output": "prod13 =\n 16380 587520 4021920 16030080", "keywords": ["prod", "product", "reduction", "omitnan", "gpu"], "suggestedPath": "/prod-2.m" }, { "id": "prod:3", "builtinKey": "prod", "builtinTitle": "prod", "builtinSlug": "prod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Multiplying with NaN values ignored", "summary": "Multiply elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "values = [2 NaN 4];\ncleanProd = prod(values, 'omitnan')", "output": "cleanProd = 8", "keywords": ["prod", "product", "reduction", "omitnan", "gpu"], "suggestedPath": "/prod-3.m" }, { "id": "prod:4", "builtinKey": "prod", "builtinTitle": "prod", "builtinSlug": "prod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Multiplying on the GPU and matching an existing prototype", "summary": "Multiply elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "G = gpuArray(ones(1024, 1024) + 0.01);\nproto = gpuArray(zeros(1, 1));\ngpuResult = prod(G, 'like', proto);\nresult = gather(gpuResult)", "keywords": ["prod", "product", "reduction", "omitnan", "gpu"], "suggestedPath": "/prod-4.m" }, { "id": "prod:5", "builtinKey": "prod", "builtinTitle": "prod", "builtinSlug": "prod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Multiplying all elements of an array into a scalar", "summary": "Multiply elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "P = prod(1:10, 'all')", "output": "P = 3628800", "keywords": ["prod", "product", "reduction", "omitnan", "gpu"], "suggestedPath": "/prod-5.m" }, { "id": "prod:6", "builtinKey": "prod", "builtinTitle": "prod", "builtinSlug": "prod", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Multiplying with native output type", "summary": "Multiply elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "ints = int16([2 3 4]);\nnativeProd = prod(ints, 'native')", "output": "nativeProd = int16(24)", "keywords": ["prod", "product", "reduction", "omitnan", "gpu"], "suggestedPath": "/prod-6.m" }, { "id": "pwd:1", "builtinKey": "pwd", "builtinTitle": "pwd", "builtinSlug": "pwd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Show The Current Working Folder", "summary": "Return the absolute path to the folder where RunMat is currently executing.", "code": "current = pwd;\ndisp(current)", "output": "/", "keywords": ["pwd", "current directory", "working folder", "present working directory"], "suggestedPath": "/pwd-1.m" }, { "id": "pwd:2", "builtinKey": "pwd", "builtinTitle": "pwd", "builtinSlug": "pwd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Capture The Folder Before Changing Directories", "summary": "Return the absolute path to the folder where RunMat is currently executing.", "code": "startDir = pwd;\nif ~exist(\"results\", \"dir\")\n mkdir(\"results\");\nend\ncd(\"results\");\n% ... produce artifacts in results/ ...\ncd(startDir)", "output": "% Restores the original folder after work completes", "keywords": ["pwd", "current directory", "working folder", "present working directory"], "suggestedPath": "/pwd-2.m" }, { "id": "pwd:3", "builtinKey": "pwd", "builtinTitle": "pwd", "builtinSlug": "pwd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Combine `pwd` With `cd` To Print Relative Paths", "summary": "Return the absolute path to the folder where RunMat is currently executing.", "code": "old = cd(\"..\");\nfprintf(\"Now working in: %s\\n\", pwd);\ncd(old)", "output": "% Prints the absolute path to the parent directory, then returns to the old folder\n% For example:\n% Now working in: /home", "keywords": ["pwd", "current directory", "working folder", "present working directory"], "suggestedPath": "/pwd-3.m" }, { "id": "pwd:4", "builtinKey": "pwd", "builtinTitle": "pwd", "builtinSlug": "pwd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Confirm The Folder Inside Scripts", "summary": "Return the absolute path to the folder where RunMat is currently executing.", "code": "fprintf(\"Script started in %s\\n\", pwd)", "output": "% Example output:\n% Script started in /", "keywords": ["pwd", "current directory", "working folder", "present working directory"], "suggestedPath": "/pwd-4.m" }, { "id": "pwd:5", "builtinKey": "pwd", "builtinTitle": "pwd", "builtinSlug": "pwd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Log The Working Folder Together With Results", "summary": "Return the absolute path to the folder where RunMat is currently executing.", "code": "logFile = \"run.log\";\nfid = fopen(logFile, \"w\");\nfprintf(fid, \"Working folder: %s\\n\", pwd);\nfclose(fid)", "output": "% The log file contains a line such as:\n% Working folder: /", "keywords": ["pwd", "current directory", "working folder", "present working directory"], "suggestedPath": "/pwd-5.m" }, { "id": "pwd:6", "builtinKey": "pwd", "builtinTitle": "pwd", "builtinSlug": "pwd", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handle Errors When The Working Folder Is Unavailable", "summary": "Return the absolute path to the folder where RunMat is currently executing.", "code": "try\n location = pwd;\ncatch err\n disp(err.message);\nend", "output": "% Displays a descriptive error message if RunMat cannot query the folder,\n% for example:\n% pwd: unable to determine current directory (Permission denied)", "keywords": ["pwd", "current directory", "working folder", "present working directory"], "suggestedPath": "/pwd-6.m" }, { "id": "qr:1", "builtinKey": "qr", "builtinTitle": "qr", "builtinSlug": "qr", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Computing the full QR factorization of a square matrix", "summary": "QR factorization with optional column pivoting and economy-size outputs.", "code": "A = [12 -51 4; 6 167 -68; -4 24 -41];\n[Q, R] = qr(A)", "keywords": ["qr", "factorization", "decomposition", "householder", "pivoting"], "suggestedPath": "/qr-1.m" }, { "id": "qr:2", "builtinKey": "qr", "builtinTitle": "qr", "builtinSlug": "qr", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Obtaining orthonormal Q and upper-triangular R for a tall matrix", "summary": "QR factorization with optional column pivoting and economy-size outputs.", "code": "A = [1 2; 3 4; 5 6];\n[Q, R] = qr(A)", "keywords": ["qr", "factorization", "decomposition", "householder", "pivoting"], "suggestedPath": "/qr-2.m" }, { "id": "qr:3", "builtinKey": "qr", "builtinTitle": "qr", "builtinSlug": "qr", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Working with column pivoting when requesting three outputs", "summary": "QR factorization with optional column pivoting and economy-size outputs.", "code": "A = [1 1 0; 1 0 1; 0 1 1];\n[Q, R, E] = qr(A)", "keywords": ["qr", "factorization", "decomposition", "householder", "pivoting"], "suggestedPath": "/qr-3.m" }, { "id": "qr:4", "builtinKey": "qr", "builtinTitle": "qr", "builtinSlug": "qr", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Using economy-size QR to reduce memory footprint", "summary": "QR factorization with optional column pivoting and economy-size outputs.", "code": "A = randn(1000, 20);\n[Q, R] = qr(A, 0)", "keywords": ["qr", "factorization", "decomposition", "householder", "pivoting"], "suggestedPath": "/qr-4.m" }, { "id": "qr:5", "builtinKey": "qr", "builtinTitle": "qr", "builtinSlug": "qr", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Receiving the permutation vector instead of a matrix", "summary": "QR factorization with optional column pivoting and economy-size outputs.", "code": "A = magic(4);\n[Q, R, p] = qr(A, 'vector')", "keywords": ["qr", "factorization", "decomposition", "householder", "pivoting"], "suggestedPath": "/qr-5.m" }, { "id": "qr:6", "builtinKey": "qr", "builtinTitle": "qr", "builtinSlug": "qr", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Running QR on a gpuArray input (with automatic fallback)", "summary": "QR factorization with optional column pivoting and economy-size outputs.", "code": "G = gpuArray(rand(256, 64));\n[Q, R] = qr(G, 'econ');\nclass(Q)", "keywords": ["qr", "factorization", "decomposition", "householder", "pivoting"], "suggestedPath": "/qr-6.m" }, { "id": "quiver:1", "builtinKey": "quiver", "builtinTitle": "quiver", "builtinSlug": "quiver", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a vector field from `U` and `V` only", "summary": "Visualize 2-D vector fields with scalable arrows, GPU-aware execution, and MATLAB `quiver` call forms.", "code": "[X, Y] = meshgrid(-2:0.5:2, -2:0.5:2);\nU = -Y;\nV = X;\nquiver(U, V);", "output": "% RunMat infers the coordinate grid from the vector-field shape", "keywords": ["quiver", "vector field", "arrow plot", "flow field", "matlab quiver", "direction field"], "suggestedPath": "/quiver-1.m" }, { "id": "quiver:2", "builtinKey": "quiver", "builtinTitle": "quiver", "builtinSlug": "quiver", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Provide explicit coordinates for a flow field", "summary": "Visualize 2-D vector fields with scalable arrows, GPU-aware execution, and MATLAB `quiver` call forms.", "code": "[X, Y] = meshgrid(-2:0.5:2, -2:0.5:2);\nU = -Y;\nV = X;\nquiver(X, Y, U, V);", "keywords": ["quiver", "vector field", "arrow plot", "flow field", "matlab quiver", "direction field"], "suggestedPath": "/quiver-2.m" }, { "id": "quiver:3", "builtinKey": "quiver", "builtinTitle": "quiver", "builtinSlug": "quiver", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Adjust arrow scaling and head size through the handle", "summary": "Visualize 2-D vector fields with scalable arrows, GPU-aware execution, and MATLAB `quiver` call forms.", "code": "[X, Y] = meshgrid(-2:0.5:2, -2:0.5:2);\nU = -Y;\nV = X;\nh = quiver(X, Y, U, V);\nset(h, 'AutoScaleFactor', 1.5, 'MaxHeadSize', 0.2, 'DisplayName', 'rotation');\nlegend;", "keywords": ["quiver", "vector field", "arrow plot", "flow field", "matlab quiver", "direction field"], "suggestedPath": "/quiver-3.m" }, { "id": "rand:1", "builtinKey": "rand", "builtinTitle": "rand", "builtinSlug": "rand", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 3x3 matrix of random numbers", "summary": "Uniform random numbers on (0, 1) within the MATLAB language.", "code": "R = rand(3); % 3x3 doubles in (0, 1)", "output": "R = [0.8147 0.9134 0.1270; 0.9058 0.6324 0.0975; 0.1270 0.0975 0.2785]", "keywords": ["rand", "random", "uniform", "gpu", "like"], "suggestedPath": "/rand-1.m" }, { "id": "rand:2", "builtinKey": "rand", "builtinTitle": "rand", "builtinSlug": "rand", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 2x4x3 matrix of random numbers", "summary": "Uniform random numbers on (0, 1) within the MATLAB language.", "code": "sz = [2 4 3];\nT = rand(sz)", "output": "T = [0.8147 0.9134 0.1270 0.9058 0.6324 0.0975 0.1270 0.0975 0.2785; 0.9134 0.6324 0.0975 0.2785 0.0975 0.1270 0.9058 0.6324 0.0975]", "keywords": ["rand", "random", "uniform", "gpu", "like"], "suggestedPath": "/rand-2.m" }, { "id": "rand:3", "builtinKey": "rand", "builtinTitle": "rand", "builtinSlug": "rand", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 128x128 matrix of random numbers on a GPU", "summary": "Uniform random numbers on (0, 1) within the MATLAB language.", "code": "G = rand(128, 128)", "output": "H = [0.8147 0.9134 0.1270 0.9058 0.6324 0.0975 0.1270 0.0975 0.2785; 0.9134 0.6324 0.0975 0.2785 0.0975 0.1270 0.9058 0.6324 0.0975]", "keywords": ["rand", "random", "uniform", "gpu", "like"], "suggestedPath": "/rand-3.m" }, { "id": "randi:1", "builtinKey": "randi", "builtinTitle": "randi", "builtinSlug": "randi", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Drawing a single die roll", "summary": "Uniform random integers with inclusive bounds.", "code": "rng(0);\nroll = randi(6)", "output": "roll = 1", "keywords": ["randi", "random", "integer", "gpu", "like"], "suggestedPath": "/randi-1.m" }, { "id": "randi:2", "builtinKey": "randi", "builtinTitle": "randi", "builtinSlug": "randi", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a matrix of random indices", "summary": "Uniform random integers with inclusive bounds.", "code": "rng(0);\nidx = randi(10, 2, 3)", "output": "idx =\n 1 9 7\n 10 2 1", "keywords": ["randi", "random", "integer", "gpu", "like"], "suggestedPath": "/randi-2.m" }, { "id": "randi:3", "builtinKey": "randi", "builtinTitle": "randi", "builtinSlug": "randi", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Generating bounded integers with a size vector", "summary": "Uniform random integers with inclusive bounds.", "code": "rng(0);\nshape = [3 4 2];\ntiles = randi([5 20], shape)", "output": "tiles(:, :, 1) =\n 6 7 5 15\n 19 14 9 16\n 18 5 10 13\n\ntiles(:, :, 2) =\n 20 5 17 8\n 20 14 5 9\n 10 9 18 5", "keywords": ["randi", "random", "integer", "gpu", "like"], "suggestedPath": "/randi-3.m" }, { "id": "randi:4", "builtinKey": "randi", "builtinTitle": "randi", "builtinSlug": "randi", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Matching an existing `gpuArray`", "summary": "Uniform random integers with inclusive bounds.", "code": "rng(0);\nG = gpuArray.zeros(4, 4);\nlabels = randi([0 3], 'like', G);\npeek = gather(labels)", "output": "peek =\n 0 2 1 3\n 3 0 2 3\n 3 0 2 1\n 0 1 2 0\n\nisa(labels, 'gpuArray')\nans =\n logical\n 1", "keywords": ["randi", "random", "integer", "gpu", "like"], "suggestedPath": "/randi-4.m" }, { "id": "randi:5", "builtinKey": "randi", "builtinTitle": "randi", "builtinSlug": "randi", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Building a random logical mask", "summary": "Uniform random integers with inclusive bounds.", "code": "rng(0);\nmask = randi([0 1], 4, 4, 'logical')", "output": "mask =\n 0 1 0 1\n 1 0 1 1\n 1 0 1 0\n 0 0 1 0", "keywords": ["randi", "random", "integer", "gpu", "like"], "suggestedPath": "/randi-5.m" }, { "id": "randi:6", "builtinKey": "randi", "builtinTitle": "randi", "builtinSlug": "randi", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Reproducible integer tensors inside tests", "summary": "Uniform random integers with inclusive bounds.", "code": "rng(0);\np = randi([1 4], 1, 5)", "output": "p = [1 4 4 1 3]", "keywords": ["randi", "random", "integer", "gpu", "like"], "suggestedPath": "/randi-6.m" }, { "id": "randn:1", "builtinKey": "randn", "builtinTitle": "randn", "builtinSlug": "randn", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Drawing a single standard normal variate", "summary": "Standard normal random numbers that mirror MATLAB semantics.", "code": "rng(0);\nz = randn()", "output": "z = 1.8179", "keywords": ["randn", "random", "normal", "gaussian", "gpu", "like"], "suggestedPath": "/randn-1.m" }, { "id": "randn:2", "builtinKey": "randn", "builtinTitle": "randn", "builtinSlug": "randn", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a matrix of Gaussian noise", "summary": "Standard normal random numbers that mirror MATLAB semantics.", "code": "rng(0);\nE = randn(2, 3)", "output": "E =\n 1.8179 0.3895 0.9838\n -1.1645 0.4175 0.1386", "keywords": ["randn", "random", "normal", "gaussian", "gpu", "like"], "suggestedPath": "/randn-2.m" }, { "id": "randn:3", "builtinKey": "randn", "builtinTitle": "randn", "builtinSlug": "randn", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Specifying dimensions with a size vector", "summary": "Standard normal random numbers that mirror MATLAB semantics.", "code": "rng(0);\nshape = [2 2 2];\nT = randn(shape)", "output": "T(:, :, 1) =\n 1.8179 0.3895\n -1.1645 0.4175\n\nT(:, :, 2) =\n 0.9838 -1.1226\n 0.1386 2.7430", "keywords": ["randn", "random", "normal", "gaussian", "gpu", "like"], "suggestedPath": "/randn-3.m" }, { "id": "randn:4", "builtinKey": "randn", "builtinTitle": "randn", "builtinSlug": "randn", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Matching an existing `gpuArray` prototype", "summary": "Standard normal random numbers that mirror MATLAB semantics.", "code": "rng(0);\nG = gpuArray.zeros(512, 512);\nnoise = randn('like', G);\nstats = [mean(gather(noise(:))) std(gather(noise(:)))]", "output": "size(noise)\nans =\n 512 512\n\nstats =\n -0.0009 0.9986", "keywords": ["randn", "random", "normal", "gaussian", "gpu", "like"], "suggestedPath": "/randn-4.m" }, { "id": "randn:5", "builtinKey": "randn", "builtinTitle": "randn", "builtinSlug": "randn", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Generating complex Gaussian samples", "summary": "Standard normal random numbers that mirror MATLAB semantics.", "code": "rng(0);\nz = randn(3, 1, 'like', 1 + 1i)", "output": "z =\n 1.8179 - 1.1645i\n 0.3895 + 0.4175i\n 0.9838 + 0.1386i", "keywords": ["randn", "random", "normal", "gaussian", "gpu", "like"], "suggestedPath": "/randn-5.m" }, { "id": "randn:6", "builtinKey": "randn", "builtinTitle": "randn", "builtinSlug": "randn", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Producing reproducible noise for Monte Carlo tests", "summary": "Standard normal random numbers that mirror MATLAB semantics.", "code": "rng(0);\nsamples = randn(1, 5)", "output": "samples = [1.8179 -1.1645 0.3895 0.4175 0.9838]", "keywords": ["randn", "random", "normal", "gaussian", "gpu", "like"], "suggestedPath": "/randn-6.m" }, { "id": "randperm:1", "builtinKey": "randperm", "builtinTitle": "randperm", "builtinSlug": "randperm", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Getting a random permutation of integers 1 through N", "summary": "Random permutations of the integers 1:n with MATLAB-compatible semantics.", "code": "rng(0);\np = randperm(6)", "output": "p = [1 6 2 4 3 5]", "keywords": ["randperm", "permutation", "random", "indices", "gpu", "like"], "suggestedPath": "/randperm-1.m" }, { "id": "randperm:2", "builtinKey": "randperm", "builtinTitle": "randperm", "builtinSlug": "randperm", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Selecting K unique indices without replacement", "summary": "Random permutations of the integers 1:n with MATLAB-compatible semantics.", "code": "rng(0);\nidx = randperm(10, 3)", "output": "idx = [1 10 9]", "keywords": ["randperm", "permutation", "random", "indices", "gpu", "like"], "suggestedPath": "/randperm-2.m" }, { "id": "randperm:3", "builtinKey": "randperm", "builtinTitle": "randperm", "builtinSlug": "randperm", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Generating a reproducible permutation after seeding RNG", "summary": "Random permutations of the integers 1:n with MATLAB-compatible semantics.", "code": "rng(42);\np1 = randperm(8);\nrng(42);\np2 = randperm(8)", "output": "isequal(p1, p2)\nans = logical\n 1", "keywords": ["randperm", "permutation", "random", "indices", "gpu", "like"], "suggestedPath": "/randperm-3.m" }, { "id": "randperm:4", "builtinKey": "randperm", "builtinTitle": "randperm", "builtinSlug": "randperm", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a GPU-resident random permutation", "summary": "Random permutations of the integers 1:n with MATLAB-compatible semantics.", "code": "G = gpuArray.zeros(4, 4);\np = randperm(12, 4, 'like', G);\npeek = gather(p)", "output": "isa(p, 'gpuArray')\nans = logical\n 1", "keywords": ["randperm", "permutation", "random", "indices", "gpu", "like"], "suggestedPath": "/randperm-4.m" }, { "id": "randperm:5", "builtinKey": "randperm", "builtinTitle": "randperm", "builtinSlug": "randperm", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Working with empty permutations", "summary": "Random permutations of the integers 1:n with MATLAB-compatible semantics.", "code": "p = randperm(0);\nq = randperm(5, 0)", "output": "size(p)\nans =\n 1 0\n\nsize(q)\nans =\n 1 0", "keywords": ["randperm", "permutation", "random", "indices", "gpu", "like"], "suggestedPath": "/randperm-5.m" }, { "id": "range:1", "builtinKey": "range", "builtinTitle": "range", "builtinSlug": "range", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Measuring column-wise range of a matrix", "summary": "Compute the difference between the maximum and minimum values (max - min).", "code": "A = [1 4 2; 3 7 5];\nspread = range(A)", "output": "% Each column's maximum minus minimum\nspread = [2 3 3]", "keywords": ["range", "max", "min", "spread", "omitnan", "gpu"], "suggestedPath": "/range-1.m" }, { "id": "range:2", "builtinKey": "range", "builtinTitle": "range", "builtinSlug": "range", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Selecting a dimension explicitly", "summary": "Compute the difference between the maximum and minimum values (max - min).", "code": "A = [1 4 2; 3 7 5];\nrow_spread = range(A, 2)", "output": "row_spread = [3; 4]", "keywords": ["range", "max", "min", "spread", "omitnan", "gpu"], "suggestedPath": "/range-2.m" }, { "id": "range:3", "builtinKey": "range", "builtinTitle": "range", "builtinSlug": "range", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Collapsing all elements with 'all'", "summary": "Compute the difference between the maximum and minimum values (max - min).", "code": "temperatures = [68 72 75; 70 74 78];\noverall = range(temperatures, 'all')", "output": "overall = 10", "keywords": ["range", "max", "min", "spread", "omitnan", "gpu"], "suggestedPath": "/range-3.m" }, { "id": "range:4", "builtinKey": "range", "builtinTitle": "range", "builtinSlug": "range", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Ignoring NaNs when computing range", "summary": "Compute the difference between the maximum and minimum values (max - min).", "code": "samples = [2 NaN 5; 4 6 NaN];\nspread = range(samples, 1, 'omitnan')", "output": "spread = [2 0 0]", "keywords": ["range", "max", "min", "spread", "omitnan", "gpu"], "suggestedPath": "/range-4.m" }, { "id": "range:5", "builtinKey": "range", "builtinTitle": "range", "builtinSlug": "range", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Keeping gpuArray results on the device", "summary": "Compute the difference between the maximum and minimum values (max - min).", "code": "G = gpuArray([1 10 3; 2 8 4]);\ncolumn_spread = range(G);\ngather(column_spread)", "output": "ans =\n 1 2 1", "keywords": ["range", "max", "min", "spread", "omitnan", "gpu"], "suggestedPath": "/range-5.m" }, { "id": "range:6", "builtinKey": "range", "builtinTitle": "range", "builtinSlug": "range", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Handling higher-dimensional inputs", "summary": "Compute the difference between the maximum and minimum values (max - min).", "code": "data = reshape(1:24, [3, 4, 2]);\nslice_spread = range(data, [1 2])", "output": "slice_spread(:,:,1) =\n 11\n\nslice_spread(:,:,2) =\n 11", "keywords": ["range", "max", "min", "spread", "omitnan", "gpu"], "suggestedPath": "/range-6.m" }, { "id": "rank:1", "builtinKey": "rank", "builtinTitle": "rank", "builtinSlug": "rank", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Determining the rank of a full matrix", "summary": "Compute the numerical rank of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "A = [1 2; 3 4];\nrk = rank(A)", "output": "rk = 2", "keywords": ["rank", "singular value decomposition", "tolerance", "matrix rank", "gpu"], "suggestedPath": "/rank-1.m" }, { "id": "rank:2", "builtinKey": "rank", "builtinTitle": "rank", "builtinSlug": "rank", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Detecting rank deficiency in a singular matrix", "summary": "Compute the numerical rank of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "B = [1 2; 2 4];\nrk = rank(B)", "output": "rk = 1", "keywords": ["rank", "singular value decomposition", "tolerance", "matrix rank", "gpu"], "suggestedPath": "/rank-2.m" }, { "id": "rank:3", "builtinKey": "rank", "builtinTitle": "rank", "builtinSlug": "rank", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Applying a custom tolerance to suppress tiny singular values", "summary": "Compute the numerical rank of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "C = diag([1, 1e-12]);\nrk_default = rank(C); % counts both singular values (rank 2)\nrk_custom = rank(C, 1e-9); % treats the small value as zero (rank 1)", "keywords": ["rank", "singular value decomposition", "tolerance", "matrix rank", "gpu"], "suggestedPath": "/rank-3.m" }, { "id": "rank:4", "builtinKey": "rank", "builtinTitle": "rank", "builtinSlug": "rank", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Computing the rank of a tall matrix", "summary": "Compute the numerical rank of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "A = [1 0; 0 0; 0 1];\nrk = rank(A)", "output": "rk = 2", "keywords": ["rank", "singular value decomposition", "tolerance", "matrix rank", "gpu"], "suggestedPath": "/rank-4.m" }, { "id": "rank:5", "builtinKey": "rank", "builtinTitle": "rank", "builtinSlug": "rank", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Evaluating the rank of a complex matrix", "summary": "Compute the numerical rank of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "Z = [1+1i 0; 0 2-3i];\nrk = rank(Z)", "output": "rk = 2", "keywords": ["rank", "singular value decomposition", "tolerance", "matrix rank", "gpu"], "suggestedPath": "/rank-5.m" }, { "id": "rank:6", "builtinKey": "rank", "builtinTitle": "rank", "builtinSlug": "rank", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Checking the rank of an empty matrix", "summary": "Compute the numerical rank of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "E = [];\nrk = rank(E)", "output": "rk = 0", "keywords": ["rank", "singular value decomposition", "tolerance", "matrix rank", "gpu"], "suggestedPath": "/rank-6.m" }, { "id": "rank:7", "builtinKey": "rank", "builtinTitle": "rank", "builtinSlug": "rank", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Using `rank` with `gpuArray` data", "summary": "Compute the numerical rank of a matrix using SVD with MATLAB-compatible tolerance handling.", "code": "G = gpuArray([1 2 3; 3 6 9; 0 1 0]);\nrk = rank(G); % Computation stays on the GPU when the provider supports it\nrk_host = gather(rk)", "output": "rk_host = 2", "keywords": ["rank", "singular value decomposition", "tolerance", "matrix rank", "gpu"], "suggestedPath": "/rank-7.m" }, { "id": "rcond:1", "builtinKey": "rcond", "builtinTitle": "rcond", "builtinSlug": "rcond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Reciprocal condition of the identity matrix", "summary": "Estimate the reciprocal condition number of a square matrix (1 / cond(A)) with MATLAB-compatible behaviour.", "code": "A = eye(3);\nrc = rcond(A)", "output": "rc = 1", "keywords": ["rcond", "reciprocal condition", "condition number", "linear algebra", "gpu"], "suggestedPath": "/rcond-1.m" }, { "id": "rcond:2", "builtinKey": "rcond", "builtinTitle": "rcond", "builtinSlug": "rcond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Detecting a nearly singular matrix", "summary": "Estimate the reciprocal condition number of a square matrix (1 / cond(A)) with MATLAB-compatible behaviour.", "code": "A = diag([1, 1e-8]);\nrc = rcond(A)", "output": "rc = 1e-8", "keywords": ["rcond", "reciprocal condition", "condition number", "linear algebra", "gpu"], "suggestedPath": "/rcond-2.m" }, { "id": "rcond:3", "builtinKey": "rcond", "builtinTitle": "rcond", "builtinSlug": "rcond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Reciprocal condition of a singular matrix", "summary": "Estimate the reciprocal condition number of a square matrix (1 / cond(A)) with MATLAB-compatible behaviour.", "code": "A = [1 2; 2 4];\nrc = rcond(A)", "output": "rc = 0", "keywords": ["rcond", "reciprocal condition", "condition number", "linear algebra", "gpu"], "suggestedPath": "/rcond-3.m" }, { "id": "rcond:4", "builtinKey": "rcond", "builtinTitle": "rcond", "builtinSlug": "rcond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Reciprocal condition for a complex matrix", "summary": "Estimate the reciprocal condition number of a square matrix (1 / cond(A)) with MATLAB-compatible behaviour.", "code": "A = [1+2i 0; 3i 2-1i];\nrc = rcond(A)", "output": "rc = 0.1887", "keywords": ["rcond", "reciprocal condition", "condition number", "linear algebra", "gpu"], "suggestedPath": "/rcond-4.m" }, { "id": "rcond:5", "builtinKey": "rcond", "builtinTitle": "rcond", "builtinSlug": "rcond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Handling the empty matrix", "summary": "Estimate the reciprocal condition number of a square matrix (1 / cond(A)) with MATLAB-compatible behaviour.", "code": "rc = rcond([])", "output": "rc = Inf", "keywords": ["rcond", "reciprocal condition", "condition number", "linear algebra", "gpu"], "suggestedPath": "/rcond-5.m" }, { "id": "rcond:6", "builtinKey": "rcond", "builtinTitle": "rcond", "builtinSlug": "rcond", "category": "math/linalg/solve", "categoryPath": ["math", "linalg", "solve"], "exampleTitle": "Estimating conditioning on GPU data", "summary": "Estimate the reciprocal condition number of a square matrix (1 / cond(A)) with MATLAB-compatible behaviour.", "code": "G = gpuArray([2 0; 0 0.5]);\nrc_gpu = rcond(G);\nrc = gather(rc_gpu)", "output": "rc = 0.25", "keywords": ["rcond", "reciprocal condition", "condition number", "linear algebra", "gpu"], "suggestedPath": "/rcond-6.m" }, { "id": "rdivide:1", "builtinKey": "rdivide", "builtinTitle": "rdivide", "builtinSlug": "rdivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Divide two matrices element-wise", "summary": "Element-wise division A ./ B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "A = [8 12 18; 2 10 18];\nB = [2 3 6; 2 5 9];\nQ = rdivide(A, B)", "output": "Q =\n 4 4 3\n 1 2 2", "keywords": ["rdivide", "element-wise division", "./", "gpu", "implicit expansion"], "suggestedPath": "/rdivide-1.m" }, { "id": "rdivide:2", "builtinKey": "rdivide", "builtinTitle": "rdivide", "builtinSlug": "rdivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Divide a matrix by a scalar", "summary": "Element-wise division A ./ B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "A = magic(3);\nscaled = rdivide(A, 2)", "output": "scaled =\n 4.5 0.5 3.5\n 1.5 5.0 9.0\n 8.0 6.5 2.0", "keywords": ["rdivide", "element-wise division", "./", "gpu", "implicit expansion"], "suggestedPath": "/rdivide-2.m" }, { "id": "rdivide:3", "builtinKey": "rdivide", "builtinTitle": "rdivide", "builtinSlug": "rdivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Use implicit expansion between a column and row vector", "summary": "Element-wise division A ./ B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "col = (1:3)';\nrow = [10 20 30];\nratio = rdivide(col, row)", "output": "ratio =\n 0.1 0.05 0.0333\n 0.2 0.10 0.0667\n 0.3 0.15 0.1000", "keywords": ["rdivide", "element-wise division", "./", "gpu", "implicit expansion"], "suggestedPath": "/rdivide-3.m" }, { "id": "rdivide:4", "builtinKey": "rdivide", "builtinTitle": "rdivide", "builtinSlug": "rdivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Divide complex inputs element-wise", "summary": "Element-wise division A ./ B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "z1 = [1+2i, 3-4i];\nz2 = [2-1i, -1+1i];\nquot = rdivide(z1, z2)", "output": "quot =\n 0.0 + 1.0i -3.5 + 0.5i", "keywords": ["rdivide", "element-wise division", "./", "gpu", "implicit expansion"], "suggestedPath": "/rdivide-4.m" }, { "id": "rdivide:5", "builtinKey": "rdivide", "builtinTitle": "rdivide", "builtinSlug": "rdivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Divide character codes by a numeric scalar", "summary": "Element-wise division A ./ B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "letters = 'ABC';\ncodes = rdivide(letters, 2)", "output": "codes = [32.5 33 33.5]", "keywords": ["rdivide", "element-wise division", "./", "gpu", "implicit expansion"], "suggestedPath": "/rdivide-5.m" }, { "id": "rdivide:6", "builtinKey": "rdivide", "builtinTitle": "rdivide", "builtinSlug": "rdivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Execute `rdivide` directly on gpuArray inputs", "summary": "Element-wise division A ./ B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "G1 = gpuArray([10 20 30]);\nG2 = gpuArray([2 5 10]);\ndeviceQuot = rdivide(G1, G2);\nresult = gather(deviceQuot)", "output": "deviceQuot =\n 1x3 gpuArray\n 5 4 3\nresult =\n 5 4 3", "keywords": ["rdivide", "element-wise division", "./", "gpu", "implicit expansion"], "suggestedPath": "/rdivide-6.m" }, { "id": "rdivide:7", "builtinKey": "rdivide", "builtinTitle": "rdivide", "builtinSlug": "rdivide", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Keep the result on the GPU with a `'like'` prototype", "summary": "Element-wise division A ./ B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "proto = gpuArray.zeros(1, 1);\nA = [1 2 3];\nB = [2 4 6];\nC = rdivide(A, B, 'like', proto); % stays on the GPU for downstream work", "output": "C =\n 1x3 gpuArray\n 0.5 0.5 0.5", "keywords": ["rdivide", "element-wise division", "./", "gpu", "implicit expansion"], "suggestedPath": "/rdivide-7.m" }, { "id": "read:1", "builtinKey": "read", "builtinTitle": "read", "builtinSlug": "read", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Reading a fixed number of bytes from a TCP echo service", "summary": "Read numeric or text data from a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"127.0.0.1\", 50000);\nwrite(client, uint8(1:6));\npayload = read(client, 6)", "output": "payload =\n 1 2 3 4 5 6", "keywords": ["read", "tcpclient", "networking", "socket", "binary data"], "suggestedPath": "/read-1.m" }, { "id": "read:2", "builtinKey": "read", "builtinTitle": "read", "builtinSlug": "read", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Reading ASCII text as characters", "summary": "Read numeric or text data from a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"127.0.0.1\", 50001);\nwrite(client, \"RunMat TCP\");\nchars = read(client, 10, \"char\")", "output": "chars =\n 'RunMat TCP'", "keywords": ["read", "tcpclient", "networking", "socket", "binary data"], "suggestedPath": "/read-2.m" }, { "id": "read:3", "builtinKey": "read", "builtinTitle": "read", "builtinSlug": "read", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Reading doubles written in big-endian byte order", "summary": "Read numeric or text data from a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"localhost\", 50002, \"ByteOrder\", \"big-endian\");\nwrite(client, swapbytes([1 2 3], \"double\"));\nvalues = read(client, 3, \"double\")", "output": "values =\n 1 2 3", "keywords": ["read", "tcpclient", "networking", "socket", "binary data"], "suggestedPath": "/read-3.m" }, { "id": "read:4", "builtinKey": "read", "builtinTitle": "read", "builtinSlug": "read", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Reading all available data without specifying a count", "summary": "Read numeric or text data from a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"127.0.0.1\", 50003);\nwrite(client, uint8([10 20 30]));\nburst = read(client)", "output": "burst =\n 10 20 30", "keywords": ["read", "tcpclient", "networking", "socket", "binary data"], "suggestedPath": "/read-4.m" }, { "id": "read:5", "builtinKey": "read", "builtinTitle": "read", "builtinSlug": "read", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Handling read timeouts gracefully", "summary": "Read numeric or text data from a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"example.com\", 12345, \"Timeout\", 0.5);\ntry\n data = read(client, 64);\ncatch err\n disp(err.identifier)\nend", "output": "RunMat:read:Timeout", "keywords": ["read", "tcpclient", "networking", "socket", "binary data"], "suggestedPath": "/read-5.m" }, { "id": "readline:1", "builtinKey": "readline", "builtinTitle": "readline", "builtinSlug": "readline", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Reading a newline-terminated response from an echo server", "summary": "Read ASCII text until the terminator from a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"127.0.0.1\", 55000);\nwrite(client, \"ping\\n\");\nreply = readline(client)", "output": "reply = \"ping\"", "keywords": ["readline", "tcpclient", "networking", "terminator", "text"], "suggestedPath": "/readline-1.m" }, { "id": "readline:2", "builtinKey": "readline", "builtinTitle": "readline", "builtinSlug": "readline", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Handling CRLF-terminated lines from legacy services", "summary": "Read ASCII text until the terminator from a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"legacy.example.com\", 1600);\nwrite(client, \"HELLO\\r\\n\");\nline = readline(client); % CRLF is removed automatically", "output": "line = \"OK HELLO\"", "keywords": ["readline", "tcpclient", "networking", "terminator", "text"], "suggestedPath": "/readline-2.m" }, { "id": "readline:3", "builtinKey": "readline", "builtinTitle": "readline", "builtinSlug": "readline", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Looping over streaming telemetry one line at a time", "summary": "Read ASCII text until the terminator from a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"telemetry.example.com\", 9000, \"Timeout\", 5);\nwhile true\n payload = readline(client);\n if isequal(payload, [])\n continue % timeout, try again once more data arrives\n end\n disp(payload)\nend", "keywords": ["readline", "tcpclient", "networking", "terminator", "text"], "suggestedPath": "/readline-3.m" }, { "id": "readline:4", "builtinKey": "readline", "builtinTitle": "readline", "builtinSlug": "readline", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Detecting closed connections without losing buffered text", "summary": "Read ASCII text until the terminator from a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"sensor.example.com\", 7000);\ntry\n line = readline(client); % returns partial line if peer closed without LF\n disp(line)\n readline(client); % second call raises RunMat:readline:NotConnected\ncatch err\n if err.identifier == \"RunMat:readline:NotConnected\"\n disp(\"Sensor disconnected\")\n else\n rethrow(err)\n end\nend", "keywords": ["readline", "tcpclient", "networking", "terminator", "text"], "suggestedPath": "/readline-4.m" }, { "id": "readline:5", "builtinKey": "readline", "builtinTitle": "readline", "builtinSlug": "readline", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Responding gracefully to quiet periods with finite timeouts", "summary": "Read ASCII text until the terminator from a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"chat.example.com\", 4040, \"Timeout\", 0.5);\nmsg = readline(client); % returns [] when no line arrives within 0.5 s\nif isequal(msg, [])\n disp(\"No complete chat messages yet.\")\nend", "keywords": ["readline", "tcpclient", "networking", "terminator", "text"], "suggestedPath": "/readline-5.m" }, { "id": "readline:6", "builtinKey": "readline", "builtinTitle": "readline", "builtinSlug": "readline", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Parsing numeric payloads that arrive as text lines", "summary": "Read ASCII text until the terminator from a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"metrics.example.com\", 5050);\nline = readline(client);\nvalues = str2double(split(line, \",\")); % convert comma-separated numbers", "keywords": ["readline", "tcpclient", "networking", "terminator", "text"], "suggestedPath": "/readline-6.m" }, { "id": "readline:7", "builtinKey": "readline", "builtinTitle": "readline", "builtinSlug": "readline", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Logging line-delimited JSON messages from a service", "summary": "Read ASCII text until the terminator from a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"json.example.com\", 6000);\nwhile true\n payload = readline(client);\n if isequal(payload, [])\n break\n end\n decoded = jsondecode(payload);\n disp(decoded.status)\nend", "keywords": ["readline", "tcpclient", "networking", "terminator", "text"], "suggestedPath": "/readline-7.m" }, { "id": "readmatrix:1", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Read Comma-Separated Values With Automatic Delimiter Detection", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "M = readmatrix(\"data/scores.csv\")", "output": "% Returns a numeric matrix containing the CSV data.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-1.m" }, { "id": "readmatrix:2", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Skip Header Lines Before Reading Numeric Data", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "M = readmatrix(\"data/sensor_log.txt\", 'NumHeaderLines', 2)", "output": "% The first two lines are skipped; the remaining numeric rows are returned.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-2.m" }, { "id": "readmatrix:3", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Import Tab-Delimited Text By Specifying The Delimiter", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "M = readmatrix(\"data/report.tsv\", 'Delimiter', 'tab')", "output": "% Numeric matrix representing the tab-delimited values.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-3.m" }, { "id": "readmatrix:4", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Treat Custom Tokens As Missing Values", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "M = readmatrix(\"data/results.csv\", 'TreatAsMissing', [\"NA\", \"missing\"])", "output": "% Entries equal to \"NA\" or \"missing\" become NaN in the output matrix.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-4.m" }, { "id": "readmatrix:5", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Use European Decimal And Thousands Separators", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "M = readmatrix(\"data/europe.csv\", 'Delimiter', ';', 'DecimalSeparator', ',', 'ThousandsSeparator', '.')", "output": "% Values like \"1.234,56\" are interpreted as 1234.56.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-5.m" }, { "id": "readmatrix:6", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Replace Empty Numeric Fields With A Custom Value", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "M = readmatrix(\"data/with_blanks.csv\", 'EmptyValue', 0)", "output": "% Blank entries become 0 instead of NaN.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-6.m" }, { "id": "readmatrix:7", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Import A Specific Range Of Cells", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "M = readmatrix(\"data/quarterly.csv\", 'Range', 'B2:D5')", "output": "% Returns only the rows and columns covered by the specified range.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-7.m" }, { "id": "readmatrix:8", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Convert The Result To A Logical Matrix", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "flags = readmatrix(\"data/thresholds.csv\", 'OutputType', 'logical')", "output": "% Non-zero entries (including NaN) become logical true, zero stays false.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-8.m" }, { "id": "readmatrix:9", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Keep The Result On The GPU By Matching A Prototype", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "proto = gpuArray.zeros(1); % simple prototype to establish residency\nG = readmatrix(\"data/heavy.csv\", 'Like', proto)", "output": "% The parsed matrix is uploaded to the same GPU device as the prototype.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-9.m" }, { "id": "readmatrix:10", "builtinKey": "readmatrix", "builtinTitle": "readmatrix", "builtinSlug": "readmatrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Provide Options Using A Struct From detectImportOptions", "summary": "Import numeric data from delimited text files into a RunMat matrix.", "code": "opts = struct('Delimiter', ',', 'NumHeaderLines', 1);\nM = readmatrix(\"data/measurements.csv\", opts)", "output": "% Reads the file using the supplied options struct.", "keywords": ["readmatrix", "csv", "delimited text", "numeric import", "table", "range", "logical"], "suggestedPath": "/readmatrix-10.m" }, { "id": "real:1", "builtinKey": "real", "builtinTitle": "real", "builtinSlug": "real", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Extract the real part of a complex scalar", "summary": "Extract the real part of scalars, vectors, matrices, or N-D tensors.", "code": "z = 3 + 4i;\nr = real(z)", "output": "r = 3", "keywords": ["real", "real part", "complex", "elementwise", "gpu"], "suggestedPath": "/real-1.m" }, { "id": "real:2", "builtinKey": "real", "builtinTitle": "real", "builtinSlug": "real", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Take the real part of a complex matrix", "summary": "Extract the real part of scalars, vectors, matrices, or N-D tensors.", "code": "Z = [1+2i, 4-3i; -5+0i, 7+8i];\nR = real(Z)", "output": "R =\n 1 4\n -5 7", "keywords": ["real", "real part", "complex", "elementwise", "gpu"], "suggestedPath": "/real-2.m" }, { "id": "real:3", "builtinKey": "real", "builtinTitle": "real", "builtinSlug": "real", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Confirm that real inputs remain unchanged", "summary": "Extract the real part of scalars, vectors, matrices, or N-D tensors.", "code": "data = [-2.5 0 9.75];\nresult = real(data)", "output": "result = [-2.5 0 9.75]", "keywords": ["real", "real part", "complex", "elementwise", "gpu"], "suggestedPath": "/real-3.m" }, { "id": "real:4", "builtinKey": "real", "builtinTitle": "real", "builtinSlug": "real", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert logical masks to doubles", "summary": "Extract the real part of scalars, vectors, matrices, or N-D tensors.", "code": "mask = logical([0 1 0; 1 1 0]);\nnumeric = real(mask)", "output": "numeric =\n 0 1 0\n 1 1 0", "keywords": ["real", "real part", "complex", "elementwise", "gpu"], "suggestedPath": "/real-4.m" }, { "id": "real:5", "builtinKey": "real", "builtinTitle": "real", "builtinSlug": "real", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert characters to numeric codes", "summary": "Extract the real part of scalars, vectors, matrices, or N-D tensors.", "code": "chars = 'RunMat';\ncodes = real(chars)", "output": "codes = [82 117 110 77 97 116]", "keywords": ["real", "real part", "complex", "elementwise", "gpu"], "suggestedPath": "/real-5.m" }, { "id": "real:6", "builtinKey": "real", "builtinTitle": "real", "builtinSlug": "real", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Keep GPU tensors device-resident when possible", "summary": "Extract the real part of scalars, vectors, matrices, or N-D tensors.", "code": "G = rand(4096, 512, \"gpuArray\");\nR = real(G)", "keywords": ["real", "real part", "complex", "elementwise", "gpu"], "suggestedPath": "/real-6.m" }, { "id": "regexp:1", "builtinKey": "regexp", "builtinTitle": "regexp", "builtinSlug": "regexp", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Find all 1-based match positions in a character vector", "summary": "Search text using regular expressions, returning match positions, substrings, tokens, or splits with MATLAB-compatible semantics.", "code": "idx = regexp('abracadabra', 'a')", "output": "idx =\n 1 4 6 8 11", "keywords": ["regexp", "regular expression", "pattern", "match", "split", "tokens"], "suggestedPath": "/regexp-1.m" }, { "id": "regexp:2", "builtinKey": "regexp", "builtinTitle": "regexp", "builtinSlug": "regexp", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Return matched substrings using `'match'`", "summary": "Search text using regular expressions, returning match positions, substrings, tokens, or splits with MATLAB-compatible semantics.", "code": "matches = regexp('abc123xyz', '\\d+', 'match')", "output": "matches =\n 1×1 cell array\n {'123'}", "keywords": ["regexp", "regular expression", "pattern", "match", "split", "tokens"], "suggestedPath": "/regexp-2.m" }, { "id": "regexp:3", "builtinKey": "regexp", "builtinTitle": "regexp", "builtinSlug": "regexp", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Extract capture tokens", "summary": "Search text using regular expressions, returning match positions, substrings, tokens, or splits with MATLAB-compatible semantics.", "code": "tokens = regexp('2024-03-14', '(\\d{4})-(\\d{2})-(\\d{2})', 'tokens');\nyear = tokens{1}{1};\nmonth = tokens{1}{2};\nday = tokens{1}{3}", "output": "year =\n '2024'\nmonth =\n '03'\nday =\n '14'", "keywords": ["regexp", "regular expression", "pattern", "match", "split", "tokens"], "suggestedPath": "/regexp-3.m" }, { "id": "regexp:4", "builtinKey": "regexp", "builtinTitle": "regexp", "builtinSlug": "regexp", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Split a string array around commas", "summary": "Search text using regular expressions, returning match positions, substrings, tokens, or splits with MATLAB-compatible semantics.", "code": "parts = regexp([\"a,b,c\"; \"1,2,3\"], ',', 'split')", "output": "parts =\n 2×1 cell array\n {1×3 cell}\n {1×3 cell}", "keywords": ["regexp", "regular expression", "pattern", "match", "split", "tokens"], "suggestedPath": "/regexp-4.m" }, { "id": "regexp:5", "builtinKey": "regexp", "builtinTitle": "regexp", "builtinSlug": "regexp", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Return only the first match with `'once'`", "summary": "Search text using regular expressions, returning match positions, substrings, tokens, or splits with MATLAB-compatible semantics.", "code": "first_idx = regexp('abababa', 'ba', 'once')", "output": "first_idx =\n 2", "keywords": ["regexp", "regular expression", "pattern", "match", "split", "tokens"], "suggestedPath": "/regexp-5.m" }, { "id": "regexp:6", "builtinKey": "regexp", "builtinTitle": "regexp", "builtinSlug": "regexp", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Work with named tokens", "summary": "Search text using regular expressions, returning match positions, substrings, tokens, or splits with MATLAB-compatible semantics.", "code": "matches = regexp('X=42; Y=7;', '(?<name>[A-Z])=(?<value>\\d+)', 'names');\nvalues = cellfun(@(s) str2double(s.value), matches)", "output": "values =\n 42 7", "keywords": ["regexp", "regular expression", "pattern", "match", "split", "tokens"], "suggestedPath": "/regexp-6.m" }, { "id": "regexp:7", "builtinKey": "regexp", "builtinTitle": "regexp", "builtinSlug": "regexp", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Keep zero-length matches with `'emptymatch','allow'`", "summary": "Search text using regular expressions, returning match positions, substrings, tokens, or splits with MATLAB-compatible semantics.", "code": "idx = regexp('aba', 'b*', 'emptymatch', 'allow')", "output": "idx =\n 1 2 3 4", "keywords": ["regexp", "regular expression", "pattern", "match", "split", "tokens"], "suggestedPath": "/regexp-7.m" }, { "id": "regexpi:1", "builtinKey": "regexpi", "builtinTitle": "regexpi", "builtinSlug": "regexpi", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Finding indices regardless of case", "summary": "Perform case-insensitive regular expression matching with MATLAB-compatible outputs.", "code": "idx = regexpi('Abracadabra', 'a')", "output": "idx =\n 1 4 6 8 11", "keywords": ["regexpi", "regular expression", "ignore case", "pattern", "match"], "suggestedPath": "/regexpi-1.m" }, { "id": "regexpi:2", "builtinKey": "regexpi", "builtinTitle": "regexpi", "builtinSlug": "regexpi", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Returning matched substrings ignoring case", "summary": "Perform case-insensitive regular expression matching with MATLAB-compatible outputs.", "code": "matches = regexpi('abcXYZ123', '[a-z]{3}', 'match')", "output": "matches =\n 1×2 cell array\n {'abc'} {'XYZ'}", "keywords": ["regexpi", "regular expression", "ignore case", "pattern", "match"], "suggestedPath": "/regexpi-2.m" }, { "id": "regexpi:3", "builtinKey": "regexpi", "builtinTitle": "regexpi", "builtinSlug": "regexpi", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Extracting capture tokens case-insensitively", "summary": "Perform case-insensitive regular expression matching with MATLAB-compatible outputs.", "code": "tokens = regexpi('ID:AB12', '(?<prefix>[a-z]+)(?<digits>\\d+)', 'tokens');\nfirst = tokens{1}{1};\nsecond = tokens{1}{2}", "output": "first =\n 'AB'\nsecond =\n '12'", "keywords": ["regexpi", "regular expression", "ignore case", "pattern", "match"], "suggestedPath": "/regexpi-3.m" }, { "id": "regexpi:4", "builtinKey": "regexpi", "builtinTitle": "regexpi", "builtinSlug": "regexpi", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Limiting `regexpi` to the first match", "summary": "Perform case-insensitive regular expression matching with MATLAB-compatible outputs.", "code": "firstMatch = regexpi('aXaXaX', 'ax', 'match', 'once')", "output": "firstMatch =\n 'aX'", "keywords": ["regexpi", "regular expression", "ignore case", "pattern", "match"], "suggestedPath": "/regexpi-4.m" }, { "id": "regexpi:5", "builtinKey": "regexpi", "builtinTitle": "regexpi", "builtinSlug": "regexpi", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Splitting a string array without worrying about letter case", "summary": "Perform case-insensitive regular expression matching with MATLAB-compatible outputs.", "code": "parts = regexpi([\"Color:Red\"; \"COLOR:Blue\"], 'color:', 'split')", "output": "parts =\n 2×1 cell array\n {1×2 cell}\n {1×2 cell}\n\nparts{2}{2}\nans =\n 'Blue'", "keywords": ["regexpi", "regular expression", "ignore case", "pattern", "match"], "suggestedPath": "/regexpi-5.m" }, { "id": "regexpi:6", "builtinKey": "regexpi", "builtinTitle": "regexpi", "builtinSlug": "regexpi", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Enforcing case-sensitive matches with `'matchcase'`", "summary": "Perform case-insensitive regular expression matching with MATLAB-compatible outputs.", "code": "idx = regexpi('CaseTest', 'case', 'matchcase')", "output": "idx =\n []", "keywords": ["regexpi", "regular expression", "ignore case", "pattern", "match"], "suggestedPath": "/regexpi-6.m" }, { "id": "regexprep:1", "builtinKey": "regexprep", "builtinTitle": "regexprep", "builtinSlug": "regexprep", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Replacing vowels in a character vector", "summary": "Perform MATLAB-compatible regular expression replacements on character vectors, string arrays, or cell arrays.", "code": "clean = regexprep('abracadabra', '[aeiou]', 'X')", "output": "clean =\n 'XbrXcXdXbrX'", "keywords": ["regexprep", "regular expression", "replace", "substitute", "regex"], "suggestedPath": "/regexprep-1.m" }, { "id": "regexprep:2", "builtinKey": "regexprep", "builtinTitle": "regexprep", "builtinSlug": "regexprep", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Applying multiple pattern/replacement pairs sequentially", "summary": "Perform MATLAB-compatible regular expression replacements on character vectors, string arrays, or cell arrays.", "code": "result = regexprep(\"Color: red\", {'Color', 'red'}, {'Shade', 'blue'})", "output": "result = \"Shade: blue\"", "keywords": ["regexprep", "regular expression", "replace", "substitute", "regex"], "suggestedPath": "/regexprep-2.m" }, { "id": "regexprep:3", "builtinKey": "regexprep", "builtinTitle": "regexprep", "builtinSlug": "regexprep", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Performing case-insensitive replacements", "summary": "Perform MATLAB-compatible regular expression replacements on character vectors, string arrays, or cell arrays.", "code": "names = regexprep([\"Alpha\"; \"beta\"; \"GaMmA\"], 'a', '_', 'ignorecase')", "output": "names =\n 3×1 string array\n \"_lph_\"\n \"bet_\"\n \"G__mM_\"", "keywords": ["regexprep", "regular expression", "replace", "substitute", "regex"], "suggestedPath": "/regexprep-3.m" }, { "id": "regexprep:4", "builtinKey": "regexprep", "builtinTitle": "regexprep", "builtinSlug": "regexprep", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Preserving case of the original match", "summary": "Perform MATLAB-compatible regular expression replacements on character vectors, string arrays, or cell arrays.", "code": "words = regexprep('MATLAB and matlab', 'matlab', 'runmat', 'preservecase')", "output": "words =\n 'RUNMAT and runmat'", "keywords": ["regexprep", "regular expression", "replace", "substitute", "regex"], "suggestedPath": "/regexprep-4.m" }, { "id": "regexprep:5", "builtinKey": "regexprep", "builtinTitle": "regexprep", "builtinSlug": "regexprep", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Limiting replacements to the first match with `'once'`", "summary": "Perform MATLAB-compatible regular expression replacements on character vectors, string arrays, or cell arrays.", "code": "out = regexprep(\"abababa\", 'ba', 'XY', 'once')", "output": "out = \"aXYbaba\"", "keywords": ["regexprep", "regular expression", "replace", "substitute", "regex"], "suggestedPath": "/regexprep-5.m" }, { "id": "regexprep:6", "builtinKey": "regexprep", "builtinTitle": "regexprep", "builtinSlug": "regexprep", "category": "strings/regex", "categoryPath": ["strings", "regex"], "exampleTitle": "Using element-wise patterns for a string array", "summary": "Perform MATLAB-compatible regular expression replacements on character vectors, string arrays, or cell arrays.", "code": "expr = [\"foo\", \"bar\"];\npat = [\"f\", \"ar\"];\nrep = [\"F\", \"AR\"];\nexact = regexprep(expr, pat, rep)", "output": "exact = 1×2 string\n \"Foo\" \"bAR\"", "keywords": ["regexprep", "regular expression", "replace", "substitute", "regex"], "suggestedPath": "/regexprep-6.m" }, { "id": "rem:1", "builtinKey": "rem", "builtinTitle": "rem", "builtinSlug": "rem", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Remainder of positive integers", "summary": "Compute the MATLAB remainder a - b .* fix(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "r = rem(17, 5)", "output": "r = 2", "keywords": ["rem", "remainder", "truncate", "rounding", "gpu"], "suggestedPath": "/rem-1.m" }, { "id": "rem:2", "builtinKey": "rem", "builtinTitle": "rem", "builtinSlug": "rem", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Remainder keeps dividend sign for negatives", "summary": "Compute the MATLAB remainder a - b .* fix(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "values = [-7 -3 4 9];\nremainders = rem(values, 4)", "output": "remainders = [-3 -3 0 1]", "keywords": ["rem", "remainder", "truncate", "rounding", "gpu"], "suggestedPath": "/rem-2.m" }, { "id": "rem:3", "builtinKey": "rem", "builtinTitle": "rem", "builtinSlug": "rem", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Remainder with a negative divisor", "summary": "Compute the MATLAB remainder a - b .* fix(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "r = rem(7, -4)", "output": "r = 3", "keywords": ["rem", "remainder", "truncate", "rounding", "gpu"], "suggestedPath": "/rem-3.m" }, { "id": "rem:4", "builtinKey": "rem", "builtinTitle": "rem", "builtinSlug": "rem", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Applying remainder across arrays with broadcasting", "summary": "Compute the MATLAB remainder a - b .* fix(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "A = [4.5 7.1; -2.3 0.4];\nB = rem(A, 2)", "output": "B = [0.5 1.1;\n -0.3 0.4]", "keywords": ["rem", "remainder", "truncate", "rounding", "gpu"], "suggestedPath": "/rem-4.m" }, { "id": "rem:5", "builtinKey": "rem", "builtinTitle": "rem", "builtinSlug": "rem", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Complex remainders follow fix-based quotient", "summary": "Compute the MATLAB remainder a - b .* fix(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "z = [3 + 4i, -2 + 5i];\nw = 2 + 1i;\nres = rem(z, w)", "output": "res = [0.0 + 0.0i 0.0 + 1.0i]", "keywords": ["rem", "remainder", "truncate", "rounding", "gpu"], "suggestedPath": "/rem-5.m" }, { "id": "rem:6", "builtinKey": "rem", "builtinTitle": "rem", "builtinSlug": "rem", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Keeping `rem` on the GPU when kernels are available", "summary": "Compute the MATLAB remainder a - b .* fix(./b) for scalars, matrices, N-D tensors, and complex values.", "code": "G = gpuArray(-5:5);\nH = rem(G, 4);\nhostCopy = gather(H)", "output": "hostCopy = [-1 0 -3 -2 -1 0 1 2 3 0 1]", "keywords": ["rem", "remainder", "truncate", "rounding", "gpu"], "suggestedPath": "/rem-6.m" }, { "id": "replace:1", "builtinKey": "replace", "builtinTitle": "replace", "builtinSlug": "replace", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Replace all instances of a word in a string", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays.", "code": "txt = \"RunMat accelerates MATLAB code\";\nresult = replace(txt, \"RunMat\", \"RunMat Accelerate\")", "output": "result = \"RunMat Accelerate accelerates MATLAB code\"", "keywords": ["replace", "substring replace", "string replace", "strrep", "text replace", "character array replace"], "suggestedPath": "/replace-1.m" }, { "id": "replace:2", "builtinKey": "replace", "builtinTitle": "replace", "builtinSlug": "replace", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Replace multiple terms in a string array", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays.", "code": "labels = [\"GPU pipeline\"; \"CPU pipeline\"];\nresult = replace(labels, [\"GPU\", \"CPU\"], [\"Device\", \"Host\"])", "output": "result = 2×1 string\n \"Device pipeline\"\n \"Host pipeline\"", "keywords": ["replace", "substring replace", "string replace", "strrep", "text replace", "character array replace"], "suggestedPath": "/replace-2.m" }, { "id": "replace:3", "builtinKey": "replace", "builtinTitle": "replace", "builtinSlug": "replace", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Replace substrings in a character array while preserving padding", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays.", "code": "chars = char(\"alpha\", \"beta \");\nout = replace(chars, \"a\", \"A\")", "output": "out =\n\n 2×5 char array\n\n 'AlphA'\n 'betA '", "keywords": ["replace", "substring replace", "string replace", "strrep", "text replace", "character array replace"], "suggestedPath": "/replace-3.m" }, { "id": "replace:4", "builtinKey": "replace", "builtinTitle": "replace", "builtinSlug": "replace", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Replace text within a cell array of character vectors", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays.", "code": "C = {'Kernel Fusion', 'GPU Planner'};\nupdated = replace(C, {'Kernel', 'GPU'}, {'Shader', 'Device'})", "output": "updated = 1×2 cell array\n {'Shader Fusion'} {'Device Planner'}", "keywords": ["replace", "substring replace", "string replace", "strrep", "text replace", "character array replace"], "suggestedPath": "/replace-4.m" }, { "id": "replace:5", "builtinKey": "replace", "builtinTitle": "replace", "builtinSlug": "replace", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Remove substrings by replacing with empty text", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays.", "code": "paths = [\"runmat/bin\", \"runmat/lib\"];\nclean = replace(paths, \"runmat/\", \"\")", "output": "clean = 1×2 string\n \"bin\" \"lib\"", "keywords": ["replace", "substring replace", "string replace", "strrep", "text replace", "character array replace"], "suggestedPath": "/replace-5.m" }, { "id": "replace:6", "builtinKey": "replace", "builtinTitle": "replace", "builtinSlug": "replace", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Replace using scalar replacement for multiple search terms", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays.", "code": "message = \"OpenCL or CUDA or Vulkan\";\nunified = replace(message, [\"OpenCL\", \"CUDA\", \"Vulkan\"], \"GPU backend\")", "output": "unified = \"GPU backend or GPU backend or GPU backend\"", "keywords": ["replace", "substring replace", "string replace", "strrep", "text replace", "character array replace"], "suggestedPath": "/replace-6.m" }, { "id": "replace:7", "builtinKey": "replace", "builtinTitle": "replace", "builtinSlug": "replace", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Replace text stored inside a cell array of strings", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays.", "code": "cells = { \"Snapshot\", \"Ignition Interpreter\" };\nrenamed = replace(cells, \" \", \"_\")", "output": "renamed = 1×2 cell array\n {\"Snapshot\"} {\"Ignition_Interpreter\"}", "keywords": ["replace", "substring replace", "string replace", "strrep", "text replace", "character array replace"], "suggestedPath": "/replace-7.m" }, { "id": "replace:8", "builtinKey": "replace", "builtinTitle": "replace", "builtinSlug": "replace", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Preserve missing strings during replacement", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays.", "code": "vals = [\"runmat\", \"<missing>\", \"accelerate\"];\nout = replace(vals, \"runmat\", \"RunMat\")", "output": "out = 1×3 string\n \"RunMat\" <missing> \"accelerate\"", "keywords": ["replace", "substring replace", "string replace", "strrep", "text replace", "character array replace"], "suggestedPath": "/replace-8.m" }, { "id": "repmat:1", "builtinKey": "repmat", "builtinTitle": "repmat", "builtinSlug": "repmat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Tiling a matrix across rows and columns", "summary": "Replicate arrays by tiling an input across one or more dimensions.", "code": "A = [1 2; 3 4];\nB = repmat(A, 2, 3)", "output": "B =\n 1 2 1 2 1 2\n 3 4 3 4 3 4\n 1 2 1 2 1 2\n 3 4 3 4 3 4", "keywords": ["repmat", "tile", "replicate", "array", "gpu"], "suggestedPath": "/repmat-1.m" }, { "id": "repmat:2", "builtinKey": "repmat", "builtinTitle": "repmat", "builtinSlug": "repmat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Using a scalar replication factor", "summary": "Replicate arrays by tiling an input across one or more dimensions.", "code": "row = 1:4;\nTiled = repmat(row, 3);\nsize(Tiled)", "output": "ans =\n 3 12", "keywords": ["repmat", "tile", "replicate", "array", "gpu"], "suggestedPath": "/repmat-2.m" }, { "id": "repmat:3", "builtinKey": "repmat", "builtinTitle": "repmat", "builtinSlug": "repmat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Replicating into three dimensions", "summary": "Replicate arrays by tiling an input across one or more dimensions.", "code": "A = reshape(1:6, [1 3 2]);\nT = repmat(A, [2 1 4]);\nsize(T)", "output": "ans =\n 2 3 8", "keywords": ["repmat", "tile", "replicate", "array", "gpu"], "suggestedPath": "/repmat-3.m" }, { "id": "repmat:4", "builtinKey": "repmat", "builtinTitle": "repmat", "builtinSlug": "repmat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Repeating logical masks with zero dimensions", "summary": "Replicate arrays by tiling an input across one or more dimensions.", "code": "mask = logical([1 0 1]);\nemptyMask = repmat(mask, 0, 3);\nsize(emptyMask)", "output": "ans =\n 0 3", "keywords": ["repmat", "tile", "replicate", "array", "gpu"], "suggestedPath": "/repmat-4.m" }, { "id": "repmat:5", "builtinKey": "repmat", "builtinTitle": "repmat", "builtinSlug": "repmat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Replicating string scalars into string arrays", "summary": "Replicate arrays by tiling an input across one or more dimensions.", "code": "name = \"runmat\";\nnames = repmat(name, 2, 2)", "output": "names =\n 2x2 string array\n \"runmat\" \"runmat\"\n \"runmat\" \"runmat\"", "keywords": ["repmat", "tile", "replicate", "array", "gpu"], "suggestedPath": "/repmat-5.m" }, { "id": "repmat:6", "builtinKey": "repmat", "builtinTitle": "repmat", "builtinSlug": "repmat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Replicating data that lives on the GPU", "summary": "Replicate arrays by tiling an input across one or more dimensions.", "code": "G = gpuArray(magic(3));\nT = repmat(G, [2 1]);\nresult = gather(T)", "keywords": ["repmat", "tile", "replicate", "array", "gpu"], "suggestedPath": "/repmat-6.m" }, { "id": "reshape:1", "builtinKey": "reshape", "builtinTitle": "reshape", "builtinSlug": "reshape", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reshaping a row vector into a matrix", "summary": "Rearrange the dimensions of an array without changing its data.", "code": "A = 1:12;\nB = reshape(A, [3, 4])", "output": "B =\n 1 4 7 10\n 2 5 8 11\n 3 6 9 12", "keywords": ["reshape", "resize", "dimensions", "gpu", "auto dimension"], "suggestedPath": "/reshape-1.m" }, { "id": "reshape:2", "builtinKey": "reshape", "builtinTitle": "reshape", "builtinSlug": "reshape", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Using an automatically inferred dimension", "summary": "Rearrange the dimensions of an array without changing its data.", "code": "A = 1:18;\nB = reshape(A, 3, [])", "output": "size(B) % => [3 6]", "keywords": ["reshape", "resize", "dimensions", "gpu", "auto dimension"], "suggestedPath": "/reshape-2.m" }, { "id": "reshape:3", "builtinKey": "reshape", "builtinTitle": "reshape", "builtinSlug": "reshape", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reshaping into three dimensions", "summary": "Rearrange the dimensions of an array without changing its data.", "code": "A = 1:24;\nC = reshape(A, [2, 3, 4])", "output": "size(C) % => [2 3 4]", "keywords": ["reshape", "resize", "dimensions", "gpu", "auto dimension"], "suggestedPath": "/reshape-3.m" }, { "id": "reshape:4", "builtinKey": "reshape", "builtinTitle": "reshape", "builtinSlug": "reshape", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reshaping logical arrays preserves type", "summary": "Rearrange the dimensions of an array without changing its data.", "code": "mask = logical([1 0 1 0 1 0]);\ngrid = reshape(mask, 2, 3)", "output": "grid =\n 1 1 1\n 0 0 0", "keywords": ["reshape", "resize", "dimensions", "gpu", "auto dimension"], "suggestedPath": "/reshape-4.m" }, { "id": "reshape:5", "builtinKey": "reshape", "builtinTitle": "reshape", "builtinSlug": "reshape", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Reshaping GPU data without gathering", "summary": "Rearrange the dimensions of an array without changing its data.", "code": "G = gpuArray(1:1000);\nH = reshape(G, 10, 100)", "keywords": ["reshape", "resize", "dimensions", "gpu", "auto dimension"], "suggestedPath": "/reshape-5.m" }, { "id": "reshape:6", "builtinKey": "reshape", "builtinTitle": "reshape", "builtinSlug": "reshape", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Handling zero-sized dimensions", "summary": "Rearrange the dimensions of an array without changing its data.", "code": "E = reshape([], 0, 3)", "output": "size(E) % => [0 3]", "keywords": ["reshape", "resize", "dimensions", "gpu", "auto dimension"], "suggestedPath": "/reshape-6.m" }, { "id": "rmdir:1", "builtinKey": "rmdir", "builtinTitle": "rmdir", "builtinSlug": "rmdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Remove An Empty Folder", "summary": "Remove folders with MATLAB-compatible status, message, and message ID outputs.", "code": "mkdir(\"scratch\");\nstatus = rmdir(\"scratch\")", "output": "status =\n 1", "keywords": ["rmdir", "remove directory", "delete folder", "filesystem", "status", "message", "messageid", "recursive"], "suggestedPath": "/rmdir-1.m" }, { "id": "rmdir:2", "builtinKey": "rmdir", "builtinTitle": "rmdir", "builtinSlug": "rmdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Remove A Folder And Its Contents", "summary": "Remove folders with MATLAB-compatible status, message, and message ID outputs.", "code": "mkdir(\"data/project\");\nfid = fopen(fullfile(\"data/project\", \"notes.txt\"), \"w\");\nfprintf(fid, \"Draft notes\");\nfclose(fid);\nstatus = rmdir(\"data\", \"s\")", "output": "status =\n 1", "keywords": ["rmdir", "remove directory", "delete folder", "filesystem", "status", "message", "messageid", "recursive"], "suggestedPath": "/rmdir-2.m" }, { "id": "rmdir:3", "builtinKey": "rmdir", "builtinTitle": "rmdir", "builtinSlug": "rmdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handle A Missing Folder Gracefully", "summary": "Remove folders with MATLAB-compatible status, message, and message ID outputs.", "code": "[status, message, messageID] = rmdir(\"not-here\")", "output": "status =\n 0\nmessage =\nFolder \"not-here\" does not exist.\nmessageID =\nRunMat:RMDIR:DirectoryNotFound", "keywords": ["rmdir", "remove directory", "delete folder", "filesystem", "status", "message", "messageid", "recursive"], "suggestedPath": "/rmdir-3.m" }, { "id": "rmdir:4", "builtinKey": "rmdir", "builtinTitle": "rmdir", "builtinSlug": "rmdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Detect That A Folder Is Not Empty Without The 's' Flag", "summary": "Remove folders with MATLAB-compatible status, message, and message ID outputs.", "code": "mkdir(\"logs\");\nfid = fopen(fullfile(\"logs\", \"today.log\"), \"w\");\nfprintf(fid, \"Log entry\");\nfclose(fid);\n[status, message, messageID] = rmdir(\"logs\")", "output": "status =\n 0\nmessage =\nCannot remove folder \"logs\": directory is not empty.\nmessageID =\nRunMat:RMDIR:DirectoryNotEmpty", "keywords": ["rmdir", "remove directory", "delete folder", "filesystem", "status", "message", "messageid", "recursive"], "suggestedPath": "/rmdir-4.m" }, { "id": "rmdir:5", "builtinKey": "rmdir", "builtinTitle": "rmdir", "builtinSlug": "rmdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Remove A Directory Specified As A String Scalar On The GPU", "summary": "Remove folders with MATLAB-compatible status, message, and message ID outputs.", "code": "mkdir(\"gpu-folder\");\nstatus = rmdir(gpuArray(\"gpu-folder\"))", "output": "status =\n 1", "keywords": ["rmdir", "remove directory", "delete folder", "filesystem", "status", "message", "messageid", "recursive"], "suggestedPath": "/rmdir-5.m" }, { "id": "rmdir:6", "builtinKey": "rmdir", "builtinTitle": "rmdir", "builtinSlug": "rmdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Capture Status And Message Outputs", "summary": "Remove folders with MATLAB-compatible status, message, and message ID outputs.", "code": "mkdir(\"reports\");\n[status, message, messageID] = rmdir(\"reports\")", "output": "status =\n 1\nmessage =\n\nmessageID =", "keywords": ["rmdir", "remove directory", "delete folder", "filesystem", "status", "message", "messageid", "recursive"], "suggestedPath": "/rmdir-6.m" }, { "id": "rmfield:1", "builtinKey": "rmfield", "builtinTitle": "rmfield", "builtinSlug": "rmfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Removing a single field from a scalar struct", "summary": "Remove one or more fields from scalar structs or struct arrays.", "code": "s = struct(\"name\", \"Ada\", \"score\", 42);\nt = rmfield(s, \"score\");\nisfield(t, \"score\")", "output": "ans =\n logical\n 0", "keywords": ["rmfield", "remove field", "struct", "struct array", "metadata"], "suggestedPath": "/rmfield-1.m" }, { "id": "rmfield:2", "builtinKey": "rmfield", "builtinTitle": "rmfield", "builtinSlug": "rmfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Removing several fields with a cell array of names", "summary": "Remove one or more fields from scalar structs or struct arrays.", "code": "cfg = struct(\"mode\", \"fast\", \"rate\", 60, \"debug\", true);\ncfg = rmfield(cfg, {\"rate\", \"debug\"});\nfieldnames(cfg)", "output": "ans =\n 1×1 cell array\n {'mode'}", "keywords": ["rmfield", "remove field", "struct", "struct array", "metadata"], "suggestedPath": "/rmfield-2.m" }, { "id": "rmfield:3", "builtinKey": "rmfield", "builtinTitle": "rmfield", "builtinSlug": "rmfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Removing a field from every element of a struct array", "summary": "Remove one or more fields from scalar structs or struct arrays.", "code": "people = struct(\"name\", {\"Ada\", \"Grace\"}, \"id\", {101, 102}, \"email\", {\"ada@example.com\", \"grace@example.com\"});\ntrimmed = rmfield(people, \"email\");\nfieldnames(trimmed)", "output": "ans =\n 2×1 cell array\n {'id'}\n {'name'}", "keywords": ["rmfield", "remove field", "struct", "struct array", "metadata"], "suggestedPath": "/rmfield-3.m" }, { "id": "rmfield:4", "builtinKey": "rmfield", "builtinTitle": "rmfield", "builtinSlug": "rmfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Supplying a string array of field names to delete", "summary": "Remove one or more fields from scalar structs or struct arrays.", "code": "stats = struct(\"mean\", 10, \"median\", 9, \"stdev\", 2);\nnames = [\"mean\", \"median\"];\nreduced = rmfield(stats, names);\nfieldnames(reduced)", "output": "ans =\n 1×1 cell array\n {'stdev'}", "keywords": ["rmfield", "remove field", "struct", "struct array", "metadata"], "suggestedPath": "/rmfield-4.m" }, { "id": "rmfield:5", "builtinKey": "rmfield", "builtinTitle": "rmfield", "builtinSlug": "rmfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Conditionally removing optional fields", "summary": "Remove one or more fields from scalar structs or struct arrays.", "code": "record = struct(\"id\", 7, \"notes\", \"draft\");\nif isfield(record, \"notes\")\n record = rmfield(record, \"notes\");\nend\nfieldnames(record)", "output": "ans =\n 1×1 cell array\n {'id'}", "keywords": ["rmfield", "remove field", "struct", "struct array", "metadata"], "suggestedPath": "/rmfield-5.m" }, { "id": "rmpath:1", "builtinKey": "rmpath", "builtinTitle": "rmpath", "builtinSlug": "rmpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Removing a single folder from the MATLAB search path", "summary": "Remove folders from the MATLAB search path used by RunMat.", "code": "old = rmpath(\"util/toolbox\");\ndisp(old);\npath()", "output": "old =\n '/Users/you/runmat/toolbox:util/toolbox'\n% The folder util/toolbox no longer appears in the active search path.", "keywords": ["rmpath", "search path", "matlab path", "remove folder", "toolbox cleanup"], "suggestedPath": "/rmpath-1.m" }, { "id": "rmpath:2", "builtinKey": "rmpath", "builtinTitle": "rmpath", "builtinSlug": "rmpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Removing multiple folders at once", "summary": "Remove folders from the MATLAB search path used by RunMat.", "code": "rmpath(\"shared/filters\", \"shared/signal\");\npath()", "output": "% shared/filters and shared/signal are both removed from the MATLAB path.", "keywords": ["rmpath", "search path", "matlab path", "remove folder", "toolbox cleanup"], "suggestedPath": "/rmpath-2.m" }, { "id": "rmpath:3", "builtinKey": "rmpath", "builtinTitle": "rmpath", "builtinSlug": "rmpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Removing folders produced by `genpath`", "summary": "Remove folders from the MATLAB search path used by RunMat.", "code": "tree = genpath(\"third_party/toolchain\");\nrmpath(tree)", "output": "% Every directory returned by genpath is pruned from the search path.", "keywords": ["rmpath", "search path", "matlab path", "remove folder", "toolbox cleanup"], "suggestedPath": "/rmpath-3.m" }, { "id": "rmpath:4", "builtinKey": "rmpath", "builtinTitle": "rmpath", "builtinSlug": "rmpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Removing folders specified in a cell array", "summary": "Remove folders from the MATLAB search path used by RunMat.", "code": "folders = {'src/algorithms', 'src/visualization'};\nrmpath(folders{:});\npath()", "output": "% Both folders are removed from the MATLAB search path.", "keywords": ["rmpath", "search path", "matlab path", "remove folder", "toolbox cleanup"], "suggestedPath": "/rmpath-4.m" }, { "id": "rmpath:5", "builtinKey": "rmpath", "builtinTitle": "rmpath", "builtinSlug": "rmpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Capturing and restoring the previous path after removal", "summary": "Remove folders from the MATLAB search path used by RunMat.", "code": "old = rmpath(\"analysis/utilities\");\n% ... run experiments ...\npath(old); % Restore the previous path\npath()", "output": "% The original search path is restored when you call path(old).", "keywords": ["rmpath", "search path", "matlab path", "remove folder", "toolbox cleanup"], "suggestedPath": "/rmpath-5.m" }, { "id": "rmpath:6", "builtinKey": "rmpath", "builtinTitle": "rmpath", "builtinSlug": "rmpath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Handling attempts to remove folders that are not on the path", "summary": "Remove folders from the MATLAB search path used by RunMat.", "code": "rmpath(\"nonexistent/toolbox\")", "keywords": ["rmpath", "search path", "matlab path", "remove folder", "toolbox cleanup"], "suggestedPath": "/rmpath-6.m" }, { "id": "rng:1", "builtinKey": "rng", "builtinTitle": "rng", "builtinSlug": "rng", "category": "stats/random", "categoryPath": ["stats", "random"], "exampleTitle": "Resetting the generator for reproducible simulation runs", "summary": "Seed, shuffle, and query the global random number generator.", "code": "rng(0);\nrand(1, 4)", "output": " 0.3969 0.8408 0.4221 0.6260", "keywords": ["rng", "seed", "twister", "shuffle", "random state"], "suggestedPath": "/rng-1.m" }, { "id": "rng:2", "builtinKey": "rng", "builtinTitle": "rng", "builtinSlug": "rng", "category": "stats/random", "categoryPath": ["stats", "random"], "exampleTitle": "Saving and restoring RNG state around a computation", "summary": "Seed, shuffle, and query the global random number generator.", "code": "s = rng;\nrng(1337);\nA = randn(2, 2);\nrng(s); % restore original stream\nB = randn(2, 2); % continues from the saved state", "output": "A =\n 0.6406 -0.8022\n 0.2222 -0.7161\n\nB =\n 0.3969 0.8408\n 0.4221 0.6260", "keywords": ["rng", "seed", "twister", "shuffle", "random state"], "suggestedPath": "/rng-2.m" }, { "id": "rng:3", "builtinKey": "rng", "builtinTitle": "rng", "builtinSlug": "rng", "category": "stats/random", "categoryPath": ["stats", "random"], "exampleTitle": "Scrambling the generator with the system clock", "summary": "Seed, shuffle, and query the global random number generator.", "code": "rng('shuffle');\nu = rand(1, 3)", "output": "u =\n 0.1378 0.7086 0.8463", "keywords": ["rng", "seed", "twister", "shuffle", "random state"], "suggestedPath": "/rng-3.m" }, { "id": "rng:4", "builtinKey": "rng", "builtinTitle": "rng", "builtinSlug": "rng", "category": "stats/random", "categoryPath": ["stats", "random"], "exampleTitle": "Keeping CPU and GPU random draws in sync", "summary": "Seed, shuffle, and query the global random number generator.", "code": "rng(2024);\nG = gpuArray(rand(1, 3));\nC = gather(G);\nH = rand(1, 3); % same values as C", "output": "C =\n 0.6554 0.7501 0.6046\n\nH =\n 0.6554 0.7501 0.6046", "keywords": ["rng", "seed", "twister", "shuffle", "random state"], "suggestedPath": "/rng-4.m" }, { "id": "rng:5", "builtinKey": "rng", "builtinTitle": "rng", "builtinSlug": "rng", "category": "stats/random", "categoryPath": ["stats", "random"], "exampleTitle": "Creating deterministic permutations with `rng` and `randperm`", "summary": "Seed, shuffle, and query the global random number generator.", "code": "rng(42);\np = randperm(6);\nrng(42);\nq = randperm(6)", "output": "p =\n 6 2 1 4 3 5\n\nq =\n 6 2 1 4 3 5", "keywords": ["rng", "seed", "twister", "shuffle", "random state"], "suggestedPath": "/rng-5.m" }, { "id": "roots:1", "builtinKey": "roots", "builtinTitle": "roots", "builtinSlug": "roots", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Finding roots of a quadratic polynomial", "summary": "Compute the roots of a polynomial specified by its coefficients, matching MATLAB semantics including complex output.", "code": "p = [1 -3 2];\nr = roots(p)", "output": "r =\n 2\n 1", "keywords": ["roots", "polynomial roots", "companion matrix", "eigenvalues", "gpu"], "suggestedPath": "/roots-1.m" }, { "id": "roots:2", "builtinKey": "roots", "builtinTitle": "roots", "builtinSlug": "roots", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Computing roots that include repeated factors", "summary": "Compute the roots of a polynomial specified by its coefficients, matching MATLAB semantics including complex output.", "code": "p = [1 -2 1 0]; % (x - 1)^2 * x\nr = roots(p)", "output": "r =\n 1\n 1\n 0", "keywords": ["roots", "polynomial roots", "companion matrix", "eigenvalues", "gpu"], "suggestedPath": "/roots-2.m" }, { "id": "roots:3", "builtinKey": "roots", "builtinTitle": "roots", "builtinSlug": "roots", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Handling leading zeros in the coefficient vector", "summary": "Compute the roots of a polynomial specified by its coefficients, matching MATLAB semantics including complex output.", "code": "p = [0 0 1 -4];\nr = roots(p)", "output": "r =\n 4", "keywords": ["roots", "polynomial roots", "companion matrix", "eigenvalues", "gpu"], "suggestedPath": "/roots-3.m" }, { "id": "roots:4", "builtinKey": "roots", "builtinTitle": "roots", "builtinSlug": "roots", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Calculating complex roots from real coefficients", "summary": "Compute the roots of a polynomial specified by its coefficients, matching MATLAB semantics including complex output.", "code": "p = [1 0 1];\nr = roots(p)", "output": "r =\n 0.0000 + 1.0000i\n 0.0000 - 1.0000i", "keywords": ["roots", "polynomial roots", "companion matrix", "eigenvalues", "gpu"], "suggestedPath": "/roots-4.m" }, { "id": "roots:5", "builtinKey": "roots", "builtinTitle": "roots", "builtinSlug": "roots", "category": "math/poly", "categoryPath": ["math", "poly"], "exampleTitle": "Solving roots of a polynomial stored on the GPU", "summary": "Compute the roots of a polynomial specified by its coefficients, matching MATLAB semantics including complex output.", "code": "p = gpuArray([1 0 -9 0]);\nr = roots(p)", "output": "r =\n 3.0000\n -3.0000\n 0", "keywords": ["roots", "polynomial roots", "companion matrix", "eigenvalues", "gpu"], "suggestedPath": "/roots-5.m" }, { "id": "rot90:1", "builtinKey": "rot90", "builtinTitle": "rot90", "builtinSlug": "rot90", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Rotating a matrix 90 degrees counterclockwise", "summary": "Rotate matrices and N-D arrays by multiples of 90 degrees.", "code": "A = [1 2 3; 4 5 6];\nB = rot90(A)", "output": "B =\n 3 6\n 2 5\n 1 4", "keywords": ["rot90", "rotate", "90 degrees", "matrix", "gpu", "clockwise", "counterclockwise"], "suggestedPath": "/rot90-1.m" }, { "id": "rot90:2", "builtinKey": "rot90", "builtinTitle": "rot90", "builtinSlug": "rot90", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Rotating a matrix clockwise using a direction keyword", "summary": "Rotate matrices and N-D arrays by multiples of 90 degrees.", "code": "A = magic(3);\nC = rot90(A, 'clockwise')", "output": "C =\n 6 1 8\n 7 5 3\n 2 9 4", "keywords": ["rot90", "rotate", "90 degrees", "matrix", "gpu", "clockwise", "counterclockwise"], "suggestedPath": "/rot90-2.m" }, { "id": "rot90:3", "builtinKey": "rot90", "builtinTitle": "rot90", "builtinSlug": "rot90", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Applying multiple 90-degree turns with a numeric count", "summary": "Rotate matrices and N-D arrays by multiples of 90 degrees.", "code": "A = reshape(1:9, [3 3]);\nB = rot90(A, 2); % 180-degree rotation", "output": "B =\n 9 8 7\n 6 5 4\n 3 2 1", "keywords": ["rot90", "rotate", "90 degrees", "matrix", "gpu", "clockwise", "counterclockwise"], "suggestedPath": "/rot90-3.m" }, { "id": "rot90:4", "builtinKey": "rot90", "builtinTitle": "rot90", "builtinSlug": "rot90", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Rotating 3-D data while preserving trailing dimensions", "summary": "Rotate matrices and N-D arrays by multiples of 90 degrees.", "code": "T = reshape(1:12, [2 3 2]);\nR = rot90(T);\nsize(R)", "output": "ans =\n 3 2 2", "keywords": ["rot90", "rotate", "90 degrees", "matrix", "gpu", "clockwise", "counterclockwise"], "suggestedPath": "/rot90-4.m" }, { "id": "rot90:5", "builtinKey": "rot90", "builtinTitle": "rot90", "builtinSlug": "rot90", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Rotating character data to reorganise text", "summary": "Rotate matrices and N-D arrays by multiples of 90 degrees.", "code": "C = ['r','u','n'; 'm','a','t'; ' ','A','I'];\nR = rot90(C)", "output": "R =\n 'ntI'\n 'uaA'\n 'rm '", "keywords": ["rot90", "rotate", "90 degrees", "matrix", "gpu", "clockwise", "counterclockwise"], "suggestedPath": "/rot90-5.m" }, { "id": "rot90:6", "builtinKey": "rot90", "builtinTitle": "rot90", "builtinSlug": "rot90", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Rotating gpuArray data and keeping it on the device", "summary": "Rotate matrices and N-D arrays by multiples of 90 degrees.", "code": "G = gpuArray(reshape(1:9, [3 3]));\nH = rot90(G, -1); % rotate clockwise\nisgpuarray(H)", "output": "ans = logical 1", "keywords": ["rot90", "rotate", "90 degrees", "matrix", "gpu", "clockwise", "counterclockwise"], "suggestedPath": "/rot90-6.m" }, { "id": "round:1", "builtinKey": "round", "builtinTitle": "round", "builtinSlug": "round", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding values to the nearest integers", "summary": "Round scalars, vectors, matrices, or N-D tensors to the nearest integers, decimal digits, or significant digits.", "code": "X = [-3.5 -2.2 -0.5 0 0.5 1.7];\nY = round(X)", "output": "Y = [-4 -2 -1 0 1 2]", "keywords": ["round", "rounding", "significant digits", "decimals", "gpu"], "suggestedPath": "/round-1.m" }, { "id": "round:2", "builtinKey": "round", "builtinTitle": "round", "builtinSlug": "round", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding to a fixed number of decimal places", "summary": "Round scalars, vectors, matrices, or N-D tensors to the nearest integers, decimal digits, or significant digits.", "code": "temps = [21.456 19.995 22.501];\nrounded = round(temps, 2)", "output": "rounded = [21.46 20.00 22.50]", "keywords": ["round", "rounding", "significant digits", "decimals", "gpu"], "suggestedPath": "/round-2.m" }, { "id": "round:3", "builtinKey": "round", "builtinTitle": "round", "builtinSlug": "round", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding to negative powers of ten", "summary": "Round scalars, vectors, matrices, or N-D tensors to the nearest integers, decimal digits, or significant digits.", "code": "counts = [1234 5678 91011];\nrounded = round(counts, -2)", "output": "rounded = [1200 5700 91000]", "keywords": ["round", "rounding", "significant digits", "decimals", "gpu"], "suggestedPath": "/round-3.m" }, { "id": "round:4", "builtinKey": "round", "builtinTitle": "round", "builtinSlug": "round", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding to significant digits", "summary": "Round scalars, vectors, matrices, or N-D tensors to the nearest integers, decimal digits, or significant digits.", "code": "measurements = [0.001234 12.3456 98765];\nsig3 = round(measurements, 3, 'significant')", "output": "sig3 = [0.00123 12.3 98800]", "keywords": ["round", "rounding", "significant digits", "decimals", "gpu"], "suggestedPath": "/round-4.m" }, { "id": "round:5", "builtinKey": "round", "builtinTitle": "round", "builtinSlug": "round", "category": "math/rounding", "categoryPath": ["math", "rounding"], "exampleTitle": "Rounding GPU tensors and gathering the results", "summary": "Round scalars, vectors, matrices, or N-D tensors to the nearest integers, decimal digits, or significant digits.", "code": "G = gpuArray(linspace(-2.5, 2.5, 6));\nrounded = round(G);\nhostValues = gather(rounded)", "output": "hostValues = [-3 -2 -1 1 2 3]", "keywords": ["round", "rounding", "significant digits", "decimals", "gpu"], "suggestedPath": "/round-5.m" }, { "id": "save:1", "builtinKey": "save", "builtinTitle": "save", "builtinSlug": "save", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Save the entire workspace", "summary": "Persist variables from the current workspace to a MATLAB-compatible MAT-file.", "code": "x = 42;\ny = magic(3);\nsave('session.mat')", "keywords": ["save", "mat", "workspace", "io", "matlab save"], "suggestedPath": "/save-1.m" }, { "id": "save:2", "builtinKey": "save", "builtinTitle": "save", "builtinSlug": "save", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Save selected variables only", "summary": "Persist variables from the current workspace to a MATLAB-compatible MAT-file.", "code": "a = rand(1, 3);\nb = eye(2);\nc = \"ignore me\";\nsave('selection.mat', 'a', 'b')", "keywords": ["save", "mat", "workspace", "io", "matlab save"], "suggestedPath": "/save-2.m" }, { "id": "save:3", "builtinKey": "save", "builtinTitle": "save", "builtinSlug": "save", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Save struct fields as individual variables", "summary": "Persist variables from the current workspace to a MATLAB-compatible MAT-file.", "code": "x = 1:5;\ny = rand(1, 5);\nopts = struct('output', y, 'answer', x);\nsave('opts.mat', '-struct', 'opts')", "keywords": ["save", "mat", "workspace", "io", "matlab save"], "suggestedPath": "/save-3.m" }, { "id": "save:4", "builtinKey": "save", "builtinTitle": "save", "builtinSlug": "save", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Select variables by regular expression", "summary": "Persist variables from the current workspace to a MATLAB-compatible MAT-file.", "code": "result_acc = 1:3;\nresult_tmp = 4:6;\nscratch = pi;\nsave('filtered.mat', '-regexp', '^result_', 'tmp$')", "keywords": ["save", "mat", "workspace", "io", "matlab save"], "suggestedPath": "/save-4.m" }, { "id": "save:5", "builtinKey": "save", "builtinTitle": "save", "builtinSlug": "save", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Save multiple names using a string array", "summary": "Persist variables from the current workspace to a MATLAB-compatible MAT-file.", "code": "names = [\"result_acc\", \"scratch\"];\nsave('mixed.mat', names)", "keywords": ["save", "mat", "workspace", "io", "matlab save"], "suggestedPath": "/save-5.m" }, { "id": "save:6", "builtinKey": "save", "builtinTitle": "save", "builtinSlug": "save", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Save GPU arrays without manual gather", "summary": "Persist variables from the current workspace to a MATLAB-compatible MAT-file.", "code": "G = gpuArray(magic(3));\nsave('gpu.mat', 'G')", "keywords": ["save", "mat", "workspace", "io", "matlab save"], "suggestedPath": "/save-6.m" }, { "id": "save:7", "builtinKey": "save", "builtinTitle": "save", "builtinSlug": "save", "category": "io/mat", "categoryPath": ["io", "mat"], "exampleTitle": "Error when a variable is missing", "summary": "Persist variables from the current workspace to a MATLAB-compatible MAT-file.", "code": "save('bad.mat', 'missing')", "keywords": ["save", "mat", "workspace", "io", "matlab save"], "suggestedPath": "/save-7.m" }, { "id": "savepath:1", "builtinKey": "savepath", "builtinTitle": "savepath", "builtinSlug": "savepath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Save The Current Search Path To The Default Location", "summary": "Persist the current MATLAB search path to pathdef.m with status and diagnostic outputs.", "code": "status = savepath()", "output": "status =\n 0", "keywords": ["savepath", "pathdef", "search path", "runmat path", "persist path"], "suggestedPath": "/savepath-1.m" }, { "id": "savepath:2", "builtinKey": "savepath", "builtinTitle": "savepath", "builtinSlug": "savepath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Persist A Project-Specific Pathdef File", "summary": "Persist the current MATLAB search path to pathdef.m with status and diagnostic outputs.", "code": "status = savepath(\"config/project_pathdef.m\")", "output": "status =\n 0", "keywords": ["savepath", "pathdef", "search path", "runmat path", "persist path"], "suggestedPath": "/savepath-2.m" }, { "id": "savepath:3", "builtinKey": "savepath", "builtinTitle": "savepath", "builtinSlug": "savepath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Capture Status, Message, And Message ID", "summary": "Persist the current MATLAB search path to pathdef.m with status and diagnostic outputs.", "code": "[status, message, messageID] = savepath(\"config/pathdef.m\");\nif status ~= 0\n warning(\"Failed to save the path: %s (%s)\", message, messageID);\nend", "keywords": ["savepath", "pathdef", "search path", "runmat path", "persist path"], "suggestedPath": "/savepath-3.m" }, { "id": "savepath:4", "builtinKey": "savepath", "builtinTitle": "savepath", "builtinSlug": "savepath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Append Genpath Output And Persist The Result", "summary": "Persist the current MATLAB search path to pathdef.m with status and diagnostic outputs.", "code": "tooling = genpath(\"third_party/toolchain\");\naddpath(tooling, \"-end\");\nsavepath()", "keywords": ["savepath", "pathdef", "search path", "runmat path", "persist path"], "suggestedPath": "/savepath-4.m" }, { "id": "savepath:5", "builtinKey": "savepath", "builtinTitle": "savepath", "builtinSlug": "savepath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Save A Pathdef Using A Directory Argument", "summary": "Persist the current MATLAB search path to pathdef.m with status and diagnostic outputs.", "code": "mkdir(\"~/.runmat/projectA\");\nsavepath(\"~/.runmat/projectA/\")", "output": "% Creates ~/.runmat/projectA/pathdef.m with the current search path.", "keywords": ["savepath", "pathdef", "search path", "runmat path", "persist path"], "suggestedPath": "/savepath-5.m" }, { "id": "savepath:6", "builtinKey": "savepath", "builtinTitle": "savepath", "builtinSlug": "savepath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Override The Target File With RUNMAT_PATHDEF", "summary": "Persist the current MATLAB search path to pathdef.m with status and diagnostic outputs.", "code": "setenv(\"RUNMAT_PATHDEF\", fullfile(tempdir, \"pathdef-dev.m\"));\nsavepath()", "output": "% The file tempdir/pathdef-dev.m now contains the MATLAB path definition.", "keywords": ["savepath", "pathdef", "search path", "runmat path", "persist path"], "suggestedPath": "/savepath-6.m" }, { "id": "savepath:7", "builtinKey": "savepath", "builtinTitle": "savepath", "builtinSlug": "savepath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use gpuArray Inputs Transparently", "summary": "Persist the current MATLAB search path to pathdef.m with status and diagnostic outputs.", "code": "status = savepath(gpuArray(\"pathdefs/pathdef_gpu.m\"))", "output": "status =\n 0", "keywords": ["savepath", "pathdef", "search path", "runmat path", "persist path"], "suggestedPath": "/savepath-7.m" }, { "id": "savepath:8", "builtinKey": "savepath", "builtinTitle": "savepath", "builtinSlug": "savepath", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Inspect The Generated pathdef.m File", "summary": "Persist the current MATLAB search path to pathdef.m with status and diagnostic outputs.", "code": "savepath(\"toolbox/pathdef.m\");\ntype toolbox/pathdef.m", "output": "% Displays the MATLAB function that reproduces the saved search path.", "keywords": ["savepath", "pathdef", "search path", "runmat path", "persist path"], "suggestedPath": "/savepath-8.m" }, { "id": "scatter:1", "builtinKey": "scatter", "builtinTitle": "scatter", "builtinSlug": "scatter", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a basic 2-D scatter plot", "summary": "Create 2-D scatter plots for point clouds, size/color encoding, and MATLAB `scatter` workflows.", "code": "t = linspace(0, 2*pi, 100);\nscatter(cos(t), sin(t));", "keywords": ["scatter", "scatter plot", "2-D scatter", "marker plot", "matlab scatter", "point cloud visualization"], "suggestedPath": "/scatter-1.m" }, { "id": "scatter:2", "builtinKey": "scatter", "builtinTitle": "scatter", "builtinSlug": "scatter", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use marker sizing and color-style workflows", "summary": "Create 2-D scatter plots for point clouds, size/color encoding, and MATLAB `scatter` workflows.", "code": "x = linspace(0, 1, 25);\ny = x.^2;\nh = scatter(x, y);\nset(h, 'SizeData', 12, 'MarkerFaceColor', 'r', 'Marker', 'o');", "keywords": ["scatter", "scatter plot", "2-D scatter", "marker plot", "matlab scatter", "point cloud visualization"], "suggestedPath": "/scatter-2.m" }, { "id": "scatter:3", "builtinKey": "scatter", "builtinTitle": "scatter", "builtinSlug": "scatter", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Drive the legend from scatter object display names", "summary": "Create 2-D scatter plots for point clouds, size/color encoding, and MATLAB `scatter` workflows.", "code": "x = 1:10;\nh1 = scatter(x, x);\nset(h1, 'DisplayName', 'linear');\nhold on;\nh2 = scatter(x, x.^2);\nset(h2, 'DisplayName', 'quadratic');\nlegend;", "keywords": ["scatter", "scatter plot", "2-D scatter", "marker plot", "matlab scatter", "point cloud visualization"], "suggestedPath": "/scatter-3.m" }, { "id": "scatter3:1", "builtinKey": "scatter3", "builtinTitle": "scatter3", "builtinSlug": "scatter3", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Plot a 3-D helix as a point cloud", "summary": "Create 3-D scatter plots for spatial point clouds, encoded markers, and MATLAB `scatter3` workflows.", "code": "t = linspace(0, 6*pi, 300);\nscatter3(cos(t), sin(t), t);", "keywords": ["scatter3", "3-D scatter plot", "point cloud", "matlab scatter3", "spatial data visualization", "gpu plotting"], "suggestedPath": "/scatter3-1.m" }, { "id": "scatter3:2", "builtinKey": "scatter3", "builtinTitle": "scatter3", "builtinSlug": "scatter3", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Style a 3-D scatter plot and change the camera view", "summary": "Create 3-D scatter plots for spatial point clouds, encoded markers, and MATLAB `scatter3` workflows.", "code": "t = linspace(0, 4*pi, 200);\nh = scatter3(cos(t), sin(t), t);\nset(h, 'DisplayName', 'helix', 'SizeData', 10);\nview(45, 25);", "keywords": ["scatter3", "3-D scatter plot", "point cloud", "matlab scatter3", "spatial data visualization", "gpu plotting"], "suggestedPath": "/scatter3-2.m" }, { "id": "scatter3:3", "builtinKey": "scatter3", "builtinTitle": "scatter3", "builtinSlug": "scatter3", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use subplot-local camera state with multiple 3-D plots", "summary": "Create 3-D scatter plots for spatial point clouds, encoded markers, and MATLAB `scatter3` workflows.", "code": "subplot(1, 2, 1);\nscatter3(1:10, rand(1,10), rand(1,10));\nview(3);\nsubplot(1, 2, 2);\nscatter3(rand(1,10), rand(1,10), rand(1,10));\nview(2);", "output": "% The two subplots keep independent 3-D view state", "keywords": ["scatter3", "3-D scatter plot", "point cloud", "matlab scatter3", "spatial data visualization", "gpu plotting"], "suggestedPath": "/scatter3-3.m" }, { "id": "semilogx:1", "builtinKey": "semilogx", "builtinTitle": "semilogx", "builtinSlug": "semilogx", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Plot a frequency response with a logarithmic x-axis", "summary": "Plot data with a logarithmic x-axis for response curves, scaling analysis, and MATLAB `semilogx` workflows.", "code": "f = logspace(0, 4, 200);\nmag = 1 ./ sqrt(1 + (f / 200).^2);\nsemilogx(f, mag);", "keywords": ["semilogx", "logarithmic x-axis", "semilog plot", "matlab semilogx", "response curve"], "suggestedPath": "/semilogx-1.m" }, { "id": "semilogx:2", "builtinKey": "semilogx", "builtinTitle": "semilogx", "builtinSlug": "semilogx", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Compare two responses on the same semilog x-axis", "summary": "Plot data with a logarithmic x-axis for response curves, scaling analysis, and MATLAB `semilogx` workflows.", "code": "f = logspace(0, 4, 200);\nh1 = semilogx(f, 1 ./ sqrt(1 + (f / 200).^2));\nset(h1, 'DisplayName', 'low-pass');\nhold on;\nh2 = semilogx(f, (f / 200) ./ sqrt(1 + (f / 200).^2));\nset(h2, 'DisplayName', 'high-pass');\nlegend;", "keywords": ["semilogx", "logarithmic x-axis", "semilog plot", "matlab semilogx", "response curve"], "suggestedPath": "/semilogx-2.m" }, { "id": "semilogx:3", "builtinKey": "semilogx", "builtinTitle": "semilogx", "builtinSlug": "semilogx", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Verify the x-axis scale through handle/property workflows", "summary": "Plot data with a logarithmic x-axis for response curves, scaling analysis, and MATLAB `semilogx` workflows.", "code": "f = logspace(1, 3, 50);\nsemilogx(f, log10(f));\nax = gca;\nget(ax, 'XScale')", "output": "ans =\n 'log'", "keywords": ["semilogx", "logarithmic x-axis", "semilog plot", "matlab semilogx", "response curve"], "suggestedPath": "/semilogx-3.m" }, { "id": "semilogy:1", "builtinKey": "semilogy", "builtinTitle": "semilogy", "builtinSlug": "semilogy", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Plot an exponential decay on a logarithmic y-axis", "summary": "Plot data with a logarithmic y-axis for exponential trends, decay curves, and MATLAB `semilogy` workflows.", "code": "t = linspace(0, 10, 200);\nsemilogy(t, exp(-t));", "keywords": ["semilogy", "logarithmic y-axis", "semilog plot", "matlab semilogy", "exponential plot"], "suggestedPath": "/semilogy-1.m" }, { "id": "semilogy:2", "builtinKey": "semilogy", "builtinTitle": "semilogy", "builtinSlug": "semilogy", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Compare multiple decays on the same axes", "summary": "Plot data with a logarithmic y-axis for exponential trends, decay curves, and MATLAB `semilogy` workflows.", "code": "t = linspace(0, 10, 200);\nh1 = semilogy(t, exp(-t));\nset(h1, 'DisplayName', 'exp(-t)');\nhold on;\nh2 = semilogy(t, exp(-0.3*t));\nset(h2, 'DisplayName', 'exp(-0.3t)');\nlegend;", "keywords": ["semilogy", "logarithmic y-axis", "semilog plot", "matlab semilogy", "exponential plot"], "suggestedPath": "/semilogy-2.m" }, { "id": "semilogy:3", "builtinKey": "semilogy", "builtinTitle": "semilogy", "builtinSlug": "semilogy", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect the y-axis scale after plotting", "summary": "Plot data with a logarithmic y-axis for exponential trends, decay curves, and MATLAB `semilogy` workflows.", "code": "t = 0:0.1:4;\nsemilogy(t, exp(t));\nax = gca;\nget(ax, 'YScale')", "output": "ans =\n 'log'", "keywords": ["semilogy", "logarithmic y-axis", "semilog plot", "matlab semilogy", "exponential plot"], "suggestedPath": "/semilogy-3.m" }, { "id": "set:1", "builtinKey": "set", "builtinTitle": "set", "builtinSlug": "set", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Style a line after plotting", "summary": "Update figure, axes, and plot-object properties through RunMat’s graphics handles and MATLAB-style `set` workflows.", "code": "h = plot(0:0.1:1, (0:0.1:1).^2);\nset(h, 'Color', 'r', 'LineWidth', 2, 'DisplayName', 'quadratic');", "keywords": ["set", "graphics handle", "plot properties", "matlab set", "update plotting state"], "suggestedPath": "/set-1.m" }, { "id": "set:2", "builtinKey": "set", "builtinTitle": "set", "builtinSlug": "set", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Update axes-local state through an axes handle", "summary": "Update figure, axes, and plot-object properties through RunMat’s graphics handles and MATLAB-style `set` workflows.", "code": "ax = subplot(1, 2, 2);\nplot(1:5, [2 3 5 4 1]);\nset(ax, 'XScale', 'log', 'Grid', false);", "keywords": ["set", "graphics handle", "plot properties", "matlab set", "update plotting state"], "suggestedPath": "/set-2.m" }, { "id": "set:3", "builtinKey": "set", "builtinTitle": "set", "builtinSlug": "set", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Change a legend after it has been created", "summary": "Update figure, axes, and plot-object properties through RunMat’s graphics handles and MATLAB-style `set` workflows.", "code": "plot(1:5, 1:5);\nlg = legend('series');\nset(lg, 'Location', 'southwest', 'Orientation', 'horizontal');", "keywords": ["set", "graphics handle", "plot properties", "matlab set", "update plotting state"], "suggestedPath": "/set-3.m" }, { "id": "setdiff:1", "builtinKey": "setdiff", "builtinTitle": "setdiff", "builtinSlug": "setdiff", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Finding values exclusive to the first numeric vector", "summary": "Return values that appear in the first input but not the second, matching MATLAB ordering rules.", "code": "A = [5 7 5 1];\nB = [7 1 3];\n[C, IA] = setdiff(A, B)", "output": "C =\n 5\nIA =\n 1", "keywords": ["setdiff", "difference", "stable", "rows", "indices", "gpu"], "suggestedPath": "/setdiff-1.m" }, { "id": "setdiff:2", "builtinKey": "setdiff", "builtinTitle": "setdiff", "builtinSlug": "setdiff", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Preserving input order with `'stable'`", "summary": "Return values that appear in the first input but not the second, matching MATLAB ordering rules.", "code": "A = [4 2 4 1 3];\nB = [3 4 5 1];\n[C, IA] = setdiff(A, B, 'stable')", "output": "C =\n 2\nIA =\n 2", "keywords": ["setdiff", "difference", "stable", "rows", "indices", "gpu"], "suggestedPath": "/setdiff-2.m" }, { "id": "setdiff:3", "builtinKey": "setdiff", "builtinTitle": "setdiff", "builtinSlug": "setdiff", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Working with rows of numeric matrices", "summary": "Return values that appear in the first input but not the second, matching MATLAB ordering rules.", "code": "A = [1 2; 3 4; 1 2];\nB = [3 4; 5 6];\n[C, IA] = setdiff(A, B, 'rows')", "output": "C =\n 1 2\nIA =\n 1", "keywords": ["setdiff", "difference", "stable", "rows", "indices", "gpu"], "suggestedPath": "/setdiff-3.m" }, { "id": "setdiff:4", "builtinKey": "setdiff", "builtinTitle": "setdiff", "builtinSlug": "setdiff", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Computing set difference for character data", "summary": "Return values that appear in the first input but not the second, matching MATLAB ordering rules.", "code": "A = ['m','z'; 'm','a'];\nB = ['a','x'; 'm','a'];\n[C, IA] = setdiff(A, B)", "output": "C =\n m\nIA =\n 1", "keywords": ["setdiff", "difference", "stable", "rows", "indices", "gpu"], "suggestedPath": "/setdiff-4.m" }, { "id": "setdiff:5", "builtinKey": "setdiff", "builtinTitle": "setdiff", "builtinSlug": "setdiff", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Subtracting string arrays by row", "summary": "Return values that appear in the first input but not the second, matching MATLAB ordering rules.", "code": "A = [\"alpha\" \"beta\"; \"gamma\" \"beta\"];\nB = [\"gamma\" \"beta\"; \"delta\" \"beta\"];\n[C, IA] = setdiff(A, B, 'rows', 'stable')", "output": "C =\n 1x2 string array\n \"alpha\" \"beta\"\nIA =\n 1", "keywords": ["setdiff", "difference", "stable", "rows", "indices", "gpu"], "suggestedPath": "/setdiff-5.m" }, { "id": "setdiff:6", "builtinKey": "setdiff", "builtinTitle": "setdiff", "builtinSlug": "setdiff", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Using `setdiff` with GPU arrays", "summary": "Return values that appear in the first input but not the second, matching MATLAB ordering rules.", "code": "G = gpuArray([10 4 6 4]);\nH = gpuArray([6 4 2]);\nC = setdiff(G, H)", "output": "C =\n 10", "keywords": ["setdiff", "difference", "stable", "rows", "indices", "gpu"], "suggestedPath": "/setdiff-6.m" }, { "id": "setenv:1", "builtinKey": "setenv", "builtinTitle": "setenv", "builtinSlug": "setenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Set a new environment variable for the current session", "summary": "Set or clear environment variables with MATLAB-compatible status outputs.", "code": "status = setenv(\"RUNMAT_MODE\", \"development\")", "output": "status =\n 0", "keywords": ["setenv", "environment variable", "status", "message", "unset"], "suggestedPath": "/setenv-1.m" }, { "id": "setenv:2", "builtinKey": "setenv", "builtinTitle": "setenv", "builtinSlug": "setenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Update an existing environment variable", "summary": "Set or clear environment variables with MATLAB-compatible status outputs.", "code": "status = setenv(\"PATH\", string(getenv(\"PATH\")) + \":~/runmat/bin\")", "output": "status =\n 0", "keywords": ["setenv", "environment variable", "status", "message", "unset"], "suggestedPath": "/setenv-2.m" }, { "id": "setenv:3", "builtinKey": "setenv", "builtinTitle": "setenv", "builtinSlug": "setenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Remove an environment variable with an empty value", "summary": "Set or clear environment variables with MATLAB-compatible status outputs.", "code": "[status, message] = setenv(\"OLD_SETTING\", \"\")", "output": "status =\n 0\n\nmessage =", "keywords": ["setenv", "environment variable", "status", "message", "unset"], "suggestedPath": "/setenv-3.m" }, { "id": "setenv:4", "builtinKey": "setenv", "builtinTitle": "setenv", "builtinSlug": "setenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Capture diagnostic messages when a name is invalid", "summary": "Set or clear environment variables with MATLAB-compatible status outputs.", "code": "[status, message] = setenv(\"INVALID=NAME\", \"value\")", "output": "status =\n 1\n\nmessage =\nEnvironment variable names must not contain '='.", "keywords": ["setenv", "environment variable", "status", "message", "unset"], "suggestedPath": "/setenv-4.m" }, { "id": "setenv:5", "builtinKey": "setenv", "builtinTitle": "setenv", "builtinSlug": "setenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use character vectors from legacy code", "summary": "Set or clear environment variables with MATLAB-compatible status outputs.", "code": "status = setenv('RUNMAT_LEGACY', 'enabled')", "output": "status =\n 0", "keywords": ["setenv", "environment variable", "status", "message", "unset"], "suggestedPath": "/setenv-5.m" }, { "id": "setenv:6", "builtinKey": "setenv", "builtinTitle": "setenv", "builtinSlug": "setenv", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Combine `setenv` with child process launches", "summary": "Set or clear environment variables with MATLAB-compatible status outputs.", "code": "setenv(\"RUNMAT_DATASET\", \"demo\");\nstatus = system(\"runmat-cli process-data\")", "output": "status =\n 0", "keywords": ["setenv", "environment variable", "status", "message", "unset"], "suggestedPath": "/setenv-6.m" }, { "id": "setfield:1", "builtinKey": "setfield", "builtinTitle": "setfield", "builtinSlug": "setfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Assigning a new field in a scalar struct", "summary": "Assign into struct fields, struct arrays, or MATLAB-style object properties.", "code": "s = struct();\ns = setfield(s, \"answer\", 42);\ndisp(s.answer)", "output": " 42", "keywords": ["setfield", "struct", "assignment", "struct array", "object property"], "suggestedPath": "/setfield-1.m" }, { "id": "setfield:2", "builtinKey": "setfield", "builtinTitle": "setfield", "builtinSlug": "setfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Creating nested structs automatically", "summary": "Assign into struct fields, struct arrays, or MATLAB-style object properties.", "code": "cfg = struct();\ncfg = setfield(cfg, \"solver\", \"name\", \"cg\");\ncfg = setfield(cfg, \"solver\", \"tolerance\", 1e-6);\ndisp(cfg.solver.tolerance)", "output": " 1.0000e-06", "keywords": ["setfield", "struct", "assignment", "struct array", "object property"], "suggestedPath": "/setfield-2.m" }, { "id": "setfield:3", "builtinKey": "setfield", "builtinTitle": "setfield", "builtinSlug": "setfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Updating an element of a struct array", "summary": "Assign into struct fields, struct arrays, or MATLAB-style object properties.", "code": "people = struct(\"name\", {\"Ada\", \"Grace\"}, \"id\", {101, 102});\npeople = setfield(people, {2}, \"id\", 999);\ndisp(people(2).id)", "output": " 999", "keywords": ["setfield", "struct", "assignment", "struct array", "object property"], "suggestedPath": "/setfield-3.m" }, { "id": "setfield:4", "builtinKey": "setfield", "builtinTitle": "setfield", "builtinSlug": "setfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Assigning through a field that contains a cell array", "summary": "Assign into struct fields, struct arrays, or MATLAB-style object properties.", "code": "data = struct(\"samples\", {{struct(\"value\", 1), struct(\"value\", 2)}} );\ndata = setfield(data, \"samples\", {2}, \"value\", 10);\ndisp(data.samples{2}.value)", "output": " 10", "keywords": ["setfield", "struct", "assignment", "struct array", "object property"], "suggestedPath": "/setfield-4.m" }, { "id": "setfield:5", "builtinKey": "setfield", "builtinTitle": "setfield", "builtinSlug": "setfield", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Setting an object property that honours access attributes", "summary": "Assign into struct fields, struct arrays, or MATLAB-style object properties.", "code": "classdef Point\n properties\n x double = 0;\n end\nend", "output": " 3", "keywords": ["setfield", "struct", "assignment", "struct array", "object property"], "suggestedPath": "/setfield-5.m" }, { "id": "shading:1", "builtinKey": "shading", "builtinTitle": "shading", "builtinSlug": "shading", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Apply interpolated shading to a surface", "summary": "Control flat, interpolated, or faceted surface shading with MATLAB `shading` workflows.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 50), linspace(-3, 3, 50));\nZ = sin(X) .* cos(Y);\nsurf(X, Y, Z);\nshading interp;", "keywords": ["shading", "surface shading", "shading interp", "shading flat", "matlab shading"], "suggestedPath": "/shading-1.m" }, { "id": "shading:2", "builtinKey": "shading", "builtinTitle": "shading", "builtinSlug": "shading", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Compare flat and faceted shading across subplots", "summary": "Control flat, interpolated, or faceted surface shading with MATLAB `shading` workflows.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 40), linspace(-3, 3, 40));\nZ = sin(X) .* cos(Y);\nsubplot(1, 2, 1);\nsurf(X, Y, Z);\nshading flat;\nsubplot(1, 2, 2);\nsurf(X, Y, Z);\nshading faceted;", "keywords": ["shading", "surface shading", "shading interp", "shading flat", "matlab shading"], "suggestedPath": "/shading-2.m" }, { "id": "sign:1", "builtinKey": "sign", "builtinTitle": "sign", "builtinSlug": "sign", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Determining the sign of a scalar", "summary": "Sign of scalars, vectors, matrices, or N-D tensors with real or complex values.", "code": "result = sign(-42)", "output": "result = -1", "keywords": ["sign", "signum", "elementwise", "complex", "gpu"], "suggestedPath": "/sign-1.m" }, { "id": "sign:2", "builtinKey": "sign", "builtinTitle": "sign", "builtinSlug": "sign", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Applying `sign` to a vector of mixed values", "summary": "Sign of scalars, vectors, matrices, or N-D tensors with real or complex values.", "code": "v = [-3 -0.0 0 2 5];\ns = sign(v)", "output": "s = [-1 0 0 1 1]", "keywords": ["sign", "signum", "elementwise", "complex", "gpu"], "suggestedPath": "/sign-2.m" }, { "id": "sign:3", "builtinKey": "sign", "builtinTitle": "sign", "builtinSlug": "sign", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Normalising complex numbers to unit magnitude", "summary": "Sign of scalars, vectors, matrices, or N-D tensors with real or complex values.", "code": "z = [3+4i, -1+1i, 0+0i];\nu = sign(z)", "output": "u = [0.6+0.8i, -0.7071+0.7071i, 0]", "keywords": ["sign", "signum", "elementwise", "complex", "gpu"], "suggestedPath": "/sign-3.m" }, { "id": "sign:4", "builtinKey": "sign", "builtinTitle": "sign", "builtinSlug": "sign", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Using `sign` with character data", "summary": "Sign of scalars, vectors, matrices, or N-D tensors with real or complex values.", "code": "codes = sign('RunMat')", "output": "codes = [1 1 1 1 1 1]", "keywords": ["sign", "signum", "elementwise", "complex", "gpu"], "suggestedPath": "/sign-4.m" }, { "id": "sign:5", "builtinKey": "sign", "builtinTitle": "sign", "builtinSlug": "sign", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Working with logical masks", "summary": "Sign of scalars, vectors, matrices, or N-D tensors with real or complex values.", "code": "mask = [false true false; true false true];\nnumeric = sign(mask)", "output": "numeric = [0 1 0; 1 0 1]", "keywords": ["sign", "signum", "elementwise", "complex", "gpu"], "suggestedPath": "/sign-5.m" }, { "id": "sign:6", "builtinKey": "sign", "builtinTitle": "sign", "builtinSlug": "sign", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Executing `sign` on a GPU-resident tensor", "summary": "Sign of scalars, vectors, matrices, or N-D tensors with real or complex values.", "code": "G = randn(4096, 4096, 'gpuArray');\nS = sign(G)", "keywords": ["sign", "signum", "elementwise", "complex", "gpu"], "suggestedPath": "/sign-6.m" }, { "id": "sign:7", "builtinKey": "sign", "builtinTitle": "sign", "builtinSlug": "sign", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Handling infinities and NaNs", "summary": "Sign of scalars, vectors, matrices, or N-D tensors with real or complex values.", "code": "values = [Inf, -Inf, NaN, 0];\nout = sign(values)", "output": "out = [1 -1 NaN 0]", "keywords": ["sign", "signum", "elementwise", "complex", "gpu"], "suggestedPath": "/sign-7.m" }, { "id": "sin:1", "builtinKey": "sin", "builtinTitle": "sin", "builtinSlug": "sin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing the sine of a scalar", "summary": "Sine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "y = sin(pi/2)", "output": "y = 1", "keywords": ["sin", "sine", "trigonometry", "gpu", "elementwise", "like"], "suggestedPath": "/sin-1.m" }, { "id": "sin:2", "builtinKey": "sin", "builtinTitle": "sin", "builtinSlug": "sin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing the sine of a vector", "summary": "Sine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "angles = [0 pi/6 pi/4 pi/3];\nvalues = sin(angles)", "output": "values = [0 0.5 0.7071 0.8660]", "keywords": ["sin", "sine", "trigonometry", "gpu", "elementwise", "like"], "suggestedPath": "/sin-2.m" }, { "id": "sin:3", "builtinKey": "sin", "builtinTitle": "sin", "builtinSlug": "sin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing the sine of a complex number", "summary": "Sine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "z = sin(1 + 2i)", "output": "z = 3.1658 + 1.9596i", "keywords": ["sin", "sine", "trigonometry", "gpu", "elementwise", "like"], "suggestedPath": "/sin-3.m" }, { "id": "sin:4", "builtinKey": "sin", "builtinTitle": "sin", "builtinSlug": "sin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing the sine of a matrix on a GPU", "summary": "Sine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "A = reshape(0:5, [3 2]);\nG = gpuArray(A);\nR = sin(G);\nresult = gather(R)", "output": "result =\n 0 0.1411\n 0.8415 -0.7568\n 0.9093 -0.9589", "keywords": ["sin", "sine", "trigonometry", "gpu", "elementwise", "like"], "suggestedPath": "/sin-4.m" }, { "id": "sin:5", "builtinKey": "sin", "builtinTitle": "sin", "builtinSlug": "sin", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Keeping results on the GPU with a `'like'` prototype", "summary": "Sine of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "proto = gpuArray.zeros(1, 1, 'single');\nangles = [0 pi/2];\ndeviceResult = sin(angles, 'like', proto);\ngathered = gather(deviceResult)", "output": "gathered =\n 1x2 single\n 0 1", "keywords": ["sin", "sine", "trigonometry", "gpu", "elementwise", "like"], "suggestedPath": "/sin-5.m" }, { "id": "single:1", "builtinKey": "single", "builtinTitle": "single", "builtinSlug": "single", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert a matrix to single precision", "summary": "Convert numeric values, character arrays, and gpuArray handles to IEEE single precision.", "code": "A = [1 2 3; 4 5 6];\nB = single(A)", "output": "B =\n 2×3 single matrix\n 1 2 3\n 4 5 6", "keywords": ["single", "float32", "cast", "convert to single", "gpuArray single"], "suggestedPath": "/single-1.m" }, { "id": "single:2", "builtinKey": "single", "builtinTitle": "single", "builtinSlug": "single", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert a scalar double to single precision", "summary": "Convert numeric values, character arrays, and gpuArray handles to IEEE single precision.", "code": "pi_single = single(pi)", "output": "pi_single =\n single\n 3.1416", "keywords": ["single", "float32", "cast", "convert to single", "gpuArray single"], "suggestedPath": "/single-2.m" }, { "id": "single:3", "builtinKey": "single", "builtinTitle": "single", "builtinSlug": "single", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert complex numbers to single precision", "summary": "Convert numeric values, character arrays, and gpuArray handles to IEEE single precision.", "code": "z = [1+2i, 3-4i];\nsingle_z = single(z)", "output": "single_z =\n 1×2 single complex row vector\n 1.0000 + 2.0000i 3.0000 - 4.0000i", "keywords": ["single", "float32", "cast", "convert to single", "gpuArray single"], "suggestedPath": "/single-3.m" }, { "id": "single:4", "builtinKey": "single", "builtinTitle": "single", "builtinSlug": "single", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert a character array to single precision codes", "summary": "Convert numeric values, character arrays, and gpuArray handles to IEEE single precision.", "code": "codes = single('ABC')", "output": "codes =\n 1×3 single row vector\n 65 66 67", "keywords": ["single", "float32", "cast", "convert to single", "gpuArray single"], "suggestedPath": "/single-4.m" }, { "id": "single:5", "builtinKey": "single", "builtinTitle": "single", "builtinSlug": "single", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Keep gpuArray inputs on the GPU", "summary": "Convert numeric values, character arrays, and gpuArray handles to IEEE single precision.", "code": "G = gpuArray(reshape(0:5, 3, 2));\nH = single(G);\ngather(H)", "output": "ans =\n 3×2 single matrix\n 0 3\n 1 4\n 2 5", "keywords": ["single", "float32", "cast", "convert to single", "gpuArray single"], "suggestedPath": "/single-5.m" }, { "id": "single:6", "builtinKey": "single", "builtinTitle": "single", "builtinSlug": "single", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Convert logical masks to single precision values", "summary": "Convert numeric values, character arrays, and gpuArray handles to IEEE single precision.", "code": "mask = logical([0 1 0 1]);\nweights = single(mask)", "output": "weights =\n 1×4 single row vector\n 0 1 0 1", "keywords": ["single", "float32", "cast", "convert to single", "gpuArray single"], "suggestedPath": "/single-6.m" }, { "id": "sinh:1", "builtinKey": "sinh", "builtinTitle": "sinh", "builtinSlug": "sinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Compute the hyperbolic sine of a scalar value", "summary": "Hyperbolic sine of scalars, vectors, matrices, or N-D tensors (element-wise).", "code": "y = sinh(1)", "output": "y = 1.1752", "keywords": ["sinh", "hyperbolic", "trigonometry", "gpu"], "suggestedPath": "/sinh-1.m" }, { "id": "sinh:2", "builtinKey": "sinh", "builtinTitle": "sinh", "builtinSlug": "sinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Apply `sinh` to each element of a vector", "summary": "Hyperbolic sine of scalars, vectors, matrices, or N-D tensors (element-wise).", "code": "x = linspace(-1, 1, 5);\ny = sinh(x)", "output": "y = [-1.1752 -0.5211 0 0.5211 1.1752]", "keywords": ["sinh", "hyperbolic", "trigonometry", "gpu"], "suggestedPath": "/sinh-2.m" }, { "id": "sinh:3", "builtinKey": "sinh", "builtinTitle": "sinh", "builtinSlug": "sinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Evaluate `sinh` on a matrix", "summary": "Hyperbolic sine of scalars, vectors, matrices, or N-D tensors (element-wise).", "code": "A = [0 1; 2 3];\nB = sinh(A)", "output": "B = [0 1.1752; 3.6269 10.0179]", "keywords": ["sinh", "hyperbolic", "trigonometry", "gpu"], "suggestedPath": "/sinh-3.m" }, { "id": "sinh:4", "builtinKey": "sinh", "builtinTitle": "sinh", "builtinSlug": "sinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Compute the hyperbolic sine on the GPU", "summary": "Hyperbolic sine of scalars, vectors, matrices, or N-D tensors (element-wise).", "code": "G = gpuArray([0.25 0.5; 0.75 1.0]);\nresult_gpu = sinh(G);\nresult = gather(result_gpu)", "output": "result = [0.2526 0.5211; 0.8223 1.1752]", "keywords": ["sinh", "hyperbolic", "trigonometry", "gpu"], "suggestedPath": "/sinh-4.m" }, { "id": "sinh:5", "builtinKey": "sinh", "builtinTitle": "sinh", "builtinSlug": "sinh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Work with complex inputs", "summary": "Hyperbolic sine of scalars, vectors, matrices, or N-D tensors (element-wise).", "code": "z = 1 + 2i;\nw = sinh(z)", "output": "w = -0.4891 + 1.4031i", "keywords": ["sinh", "hyperbolic", "trigonometry", "gpu"], "suggestedPath": "/sinh-5.m" }, { "id": "size:1", "builtinKey": "size", "builtinTitle": "size", "builtinSlug": "size", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Find the size of a matrix", "summary": "Get the dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "A = [1 2 3; 4 5 6];\nshape = size(A)", "output": "shape = [2 3]", "keywords": ["size", "dimensions", "shape", "gpu", "introspection"], "suggestedPath": "/size-1.m" }, { "id": "size:2", "builtinKey": "size", "builtinTitle": "size", "builtinSlug": "size", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Determine the number of rows in a matrix", "summary": "Get the dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "A = randn(8, 4);\nm = size(A, 1)", "output": "m = 8", "keywords": ["size", "dimensions", "shape", "gpu", "introspection"], "suggestedPath": "/size-2.m" }, { "id": "size:3", "builtinKey": "size", "builtinTitle": "size", "builtinSlug": "size", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Query multiple dimensions at once", "summary": "Get the dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "A = rand(5, 4, 3);\nselected = size(A, [1 3])", "output": "selected = [5 3]", "keywords": ["size", "dimensions", "shape", "gpu", "introspection"], "suggestedPath": "/size-3.m" }, { "id": "size:4", "builtinKey": "size", "builtinTitle": "size", "builtinSlug": "size", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Inspect a gpuArray without gathering", "summary": "Get the dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "G = gpuArray(ones(256, 512));\nshape = size(G)", "output": "shape = [256 512]", "keywords": ["size", "dimensions", "shape", "gpu", "introspection"], "suggestedPath": "/size-4.m" }, { "id": "size:5", "builtinKey": "size", "builtinTitle": "size", "builtinSlug": "size", "category": "array/introspection", "categoryPath": ["array", "introspection"], "exampleTitle": "Check the size of a cell array", "summary": "Get the dimensions of scalars, vectors, matrices, and N-D arrays.", "code": "C = {1, 2, 3; 4, 5, 6};\ngrid = size(C)", "output": "grid = [2 3]", "keywords": ["size", "dimensions", "shape", "gpu", "introspection"], "suggestedPath": "/size-5.m" }, { "id": "sort:1", "builtinKey": "sort", "builtinTitle": "sort", "builtinSlug": "sort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting a column vector in ascending order", "summary": "Sort scalars, vectors, matrices, or N-D tensors along a dimension, with optional index outputs.", "code": "A = [3; 1; 2];\nB = sort(A)", "output": "B =\n 1\n 2\n 3", "keywords": ["sort", "ascending", "descending", "indices", "comparisonmethod", "gpu"], "suggestedPath": "/sort-1.m" }, { "id": "sort:2", "builtinKey": "sort", "builtinTitle": "sort", "builtinSlug": "sort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting rows by specifying the dimension", "summary": "Sort scalars, vectors, matrices, or N-D tensors along a dimension, with optional index outputs.", "code": "A = [1 4 2; 3 2 5];\nB = sort(A, 2)", "output": "B =\n 1 2 4\n 2 3 5", "keywords": ["sort", "ascending", "descending", "indices", "comparisonmethod", "gpu"], "suggestedPath": "/sort-2.m" }, { "id": "sort:3", "builtinKey": "sort", "builtinTitle": "sort", "builtinSlug": "sort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting values in descending order", "summary": "Sort scalars, vectors, matrices, or N-D tensors along a dimension, with optional index outputs.", "code": "A = [10 4 7 9];\nB = sort(A, 'descend')", "output": "B =\n 10 9 7 4", "keywords": ["sort", "ascending", "descending", "indices", "comparisonmethod", "gpu"], "suggestedPath": "/sort-3.m" }, { "id": "sort:4", "builtinKey": "sort", "builtinTitle": "sort", "builtinSlug": "sort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Retrieving permutation indices alongside the sorted values", "summary": "Sort scalars, vectors, matrices, or N-D tensors along a dimension, with optional index outputs.", "code": "A = [4 1 9 2];\n[B, I] = sort(A)", "output": "B =\n 1 2 4 9\nI =\n 2 4 1 3", "keywords": ["sort", "ascending", "descending", "indices", "comparisonmethod", "gpu"], "suggestedPath": "/sort-4.m" }, { "id": "sort:5", "builtinKey": "sort", "builtinTitle": "sort", "builtinSlug": "sort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting by absolute value using `ComparisonMethod`", "summary": "Sort scalars, vectors, matrices, or N-D tensors along a dimension, with optional index outputs.", "code": "A = [-8 -1 3 -2];\nB = sort(A, 'ComparisonMethod', 'abs')", "output": "B =\n -1 -2 3 -8", "keywords": ["sort", "ascending", "descending", "indices", "comparisonmethod", "gpu"], "suggestedPath": "/sort-5.m" }, { "id": "sort:6", "builtinKey": "sort", "builtinTitle": "sort", "builtinSlug": "sort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting tensors containing NaN values", "summary": "Sort scalars, vectors, matrices, or N-D tensors along a dimension, with optional index outputs.", "code": "A = [NaN 4 1 2];\n[B, I] = sort(A)", "output": "B =\n 1 2 4 NaN\nI =\n 3 4 2 1", "keywords": ["sort", "ascending", "descending", "indices", "comparisonmethod", "gpu"], "suggestedPath": "/sort-6.m" }, { "id": "sort:7", "builtinKey": "sort", "builtinTitle": "sort", "builtinSlug": "sort", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting GPU tensors with automatic host fallback", "summary": "Sort scalars, vectors, matrices, or N-D tensors along a dimension, with optional index outputs.", "code": "G = gpuArray(randn(5, 1));\n[B, I] = sort(G, 'descend')", "keywords": ["sort", "ascending", "descending", "indices", "comparisonmethod", "gpu"], "suggestedPath": "/sort-7.m" }, { "id": "sortrows:1", "builtinKey": "sortrows", "builtinTitle": "sortrows", "builtinSlug": "sortrows", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting rows of a matrix in ascending order", "summary": "Sort matrix rows lexicographically with optional column and direction control.", "code": "A = [3 2; 1 4; 2 1];\nB = sortrows(A)", "output": "B =\n 1 4\n 2 1\n 3 2", "keywords": ["sortrows", "row sort", "lexicographic", "gpu"], "suggestedPath": "/sortrows-1.m" }, { "id": "sortrows:2", "builtinKey": "sortrows", "builtinTitle": "sortrows", "builtinSlug": "sortrows", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting by a custom column order", "summary": "Sort matrix rows lexicographically with optional column and direction control.", "code": "A = [1 4 2; 3 2 5; 3 2 1];\nB = sortrows(A, [2 3 1])", "output": "B =\n 3 2 1\n 3 2 5\n 1 4 2", "keywords": ["sortrows", "row sort", "lexicographic", "gpu"], "suggestedPath": "/sortrows-2.m" }, { "id": "sortrows:3", "builtinKey": "sortrows", "builtinTitle": "sortrows", "builtinSlug": "sortrows", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting rows in descending order", "summary": "Sort matrix rows lexicographically with optional column and direction control.", "code": "A = [2 8; 4 1; 3 5];\nB = sortrows(A, 'descend')", "output": "B =\n 4 1\n 3 5\n 2 8", "keywords": ["sortrows", "row sort", "lexicographic", "gpu"], "suggestedPath": "/sortrows-3.m" }, { "id": "sortrows:4", "builtinKey": "sortrows", "builtinTitle": "sortrows", "builtinSlug": "sortrows", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Mixing ascending and descending directions", "summary": "Sort matrix rows lexicographically with optional column and direction control.", "code": "A = [1 7 3; 1 2 9; 1 2 3];\nB = sortrows(A, [1 -2 3])", "output": "B =\n 1 7 3\n 1 2 3\n 1 2 9", "keywords": ["sortrows", "row sort", "lexicographic", "gpu"], "suggestedPath": "/sortrows-4.m" }, { "id": "sortrows:5", "builtinKey": "sortrows", "builtinTitle": "sortrows", "builtinSlug": "sortrows", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting rows of a character array", "summary": "Sort matrix rows lexicographically with optional column and direction control.", "code": "names = ['bob '; 'al '; 'ally'];\nsorted = sortrows(names)", "output": "sorted =\nal\nally\nbob", "keywords": ["sortrows", "row sort", "lexicographic", "gpu"], "suggestedPath": "/sortrows-5.m" }, { "id": "sortrows:6", "builtinKey": "sortrows", "builtinTitle": "sortrows", "builtinSlug": "sortrows", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting rows of complex data by magnitude", "summary": "Sort matrix rows lexicographically with optional column and direction control.", "code": "Z = [3+4i, 3; 1+2i, 4];\nB = sortrows(Z, 'ComparisonMethod', 'abs')", "output": "B =\n 1.0000 + 2.0000i 4.0000\n 3.0000 + 4.0000i 3.0000", "keywords": ["sortrows", "row sort", "lexicographic", "gpu"], "suggestedPath": "/sortrows-6.m" }, { "id": "sortrows:7", "builtinKey": "sortrows", "builtinTitle": "sortrows", "builtinSlug": "sortrows", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Forcing NaN rows to the top", "summary": "Sort matrix rows lexicographically with optional column and direction control.", "code": "A = [1 NaN; NaN 2];\nB = sortrows(A, 'MissingPlacement', 'first')", "output": "B =\n NaN 2\n 1 NaN", "keywords": ["sortrows", "row sort", "lexicographic", "gpu"], "suggestedPath": "/sortrows-7.m" }, { "id": "sortrows:8", "builtinKey": "sortrows", "builtinTitle": "sortrows", "builtinSlug": "sortrows", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Sorting GPU-resident data with automatic host fallback", "summary": "Sort matrix rows lexicographically with optional column and direction control.", "code": "G = gpuArray([3 1; 2 4; 1 2]);\n[B, I] = sortrows(G)", "keywords": ["sortrows", "row sort", "lexicographic", "gpu"], "suggestedPath": "/sortrows-8.m" }, { "id": "split:1", "builtinKey": "split", "builtinTitle": "split", "builtinSlug": "split", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Split A String On Whitespace", "summary": "Split strings, character arrays, and cell arrays into substrings using delimiters.", "code": "txt = \"RunMat Accelerate Planner\";\npieces = split(txt)", "output": "pieces = 1×3 string\n \"RunMat\" \"Accelerate\" \"Planner\"", "keywords": ["split", "string split", "text split", "delimiters", "collapse delimiters", "include delimiters"], "suggestedPath": "/split-1.m" }, { "id": "split:2", "builtinKey": "split", "builtinTitle": "split", "builtinSlug": "split", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Split A String Using A Custom Delimiter", "summary": "Split strings, character arrays, and cell arrays into substrings using delimiters.", "code": "csv = \"alpha,beta,gamma\";\ntokens = split(csv, \",\")", "output": "tokens = 1×3 string\n \"alpha\" \"beta\" \"gamma\"", "keywords": ["split", "string split", "text split", "delimiters", "collapse delimiters", "include delimiters"], "suggestedPath": "/split-2.m" }, { "id": "split:3", "builtinKey": "split", "builtinTitle": "split", "builtinSlug": "split", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Include Delimiters In The Output", "summary": "Split strings, character arrays, and cell arrays into substrings using delimiters.", "code": "expr = \"A+B-C\";\nsegments = split(expr, [\"+\", \"-\"], \"IncludeDelimiters\", true)", "output": "segments = 1×5 string\n \"A\" \"+\" \"B\" \"-\" \"C\"", "keywords": ["split", "string split", "text split", "delimiters", "collapse delimiters", "include delimiters"], "suggestedPath": "/split-3.m" }, { "id": "split:4", "builtinKey": "split", "builtinTitle": "split", "builtinSlug": "split", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Preserve Empty Segments When CollapseDelimiters Is False", "summary": "Split strings, character arrays, and cell arrays into substrings using delimiters.", "code": "values = \"one,,three,\";\nparts = split(values, \",\", \"CollapseDelimiters\", false)", "output": "parts = 1×4 string\n \"one\" \"\" \"three\" \"\"", "keywords": ["split", "string split", "text split", "delimiters", "collapse delimiters", "include delimiters"], "suggestedPath": "/split-4.m" }, { "id": "split:5", "builtinKey": "split", "builtinTitle": "split", "builtinSlug": "split", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Split Each Row Of A Character Array", "summary": "Split strings, character arrays, and cell arrays into substrings using delimiters.", "code": "rows = char(\"GPU Accelerate\", \"Ignition Interpreter\");\nresult = split(rows)", "output": "result = 2×2 string\n \"GPU\" \"Accelerate\"\n \"Ignition\" \"Interpreter\"", "keywords": ["split", "string split", "text split", "delimiters", "collapse delimiters", "include delimiters"], "suggestedPath": "/split-5.m" }, { "id": "split:6", "builtinKey": "split", "builtinTitle": "split", "builtinSlug": "split", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Split Elements Of A Cell Array", "summary": "Split strings, character arrays, and cell arrays into substrings using delimiters.", "code": "C = {'RunMat Snapshot'; \"Fusion Planner\"};\nout = split(C, \" \")", "output": "out = 2×2 string\n \"RunMat\" \"Snapshot\"\n \"Fusion\" \"Planner\"", "keywords": ["split", "string split", "text split", "delimiters", "collapse delimiters", "include delimiters"], "suggestedPath": "/split-6.m" }, { "id": "split:7", "builtinKey": "split", "builtinTitle": "split", "builtinSlug": "split", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Handle Missing String Inputs", "summary": "Split strings, character arrays, and cell arrays into substrings using delimiters.", "code": "names = [\"RunMat\", \"<missing>\", \"Accelerate Engine\"];\nsplit_names = split(names)", "output": "split_names = 3×2 string\n \"RunMat\" \"<missing>\"\n \"<missing>\" \"<missing>\"\n \"Accelerate\" \"Engine\"", "keywords": ["split", "string split", "text split", "delimiters", "collapse delimiters", "include delimiters"], "suggestedPath": "/split-7.m" }, { "id": "sprintf:1", "builtinKey": "sprintf", "builtinTitle": "sprintf", "builtinSlug": "sprintf", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting A Scalar Value", "summary": "Format data into a MATLAB-compatible character vector using printf-style placeholders.", "code": "txt = sprintf('Value: %d', 42)", "output": "txt =\n 'Value: 42'", "keywords": ["sprintf", "format", "printf", "text", "gpu"], "suggestedPath": "/sprintf-1.m" }, { "id": "sprintf:2", "builtinKey": "sprintf", "builtinTitle": "sprintf", "builtinSlug": "sprintf", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting With Precision And Width", "summary": "Format data into a MATLAB-compatible character vector using printf-style placeholders.", "code": "txt = sprintf('pi ~= %8.4f', pi)", "output": "txt =\n 'pi ~= 3.1416'", "keywords": ["sprintf", "format", "printf", "text", "gpu"], "suggestedPath": "/sprintf-2.m" }, { "id": "sprintf:3", "builtinKey": "sprintf", "builtinTitle": "sprintf", "builtinSlug": "sprintf", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Combining Strings And Numbers", "summary": "Format data into a MATLAB-compatible character vector using printf-style placeholders.", "code": "label = sprintf('Trial %02d: %.1f%% complete', 7, 84.95)", "output": "label =\n 'Trial 07: 85.0% complete'", "keywords": ["sprintf", "format", "printf", "text", "gpu"], "suggestedPath": "/sprintf-3.m" }, { "id": "sprintf:4", "builtinKey": "sprintf", "builtinTitle": "sprintf", "builtinSlug": "sprintf", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting Vector Inputs", "summary": "Format data into a MATLAB-compatible character vector using printf-style placeholders.", "code": "data = [10 20 30];\ntxt = sprintf('%d ', data)", "output": "txt =\n '10 20 30 '", "keywords": ["sprintf", "format", "printf", "text", "gpu"], "suggestedPath": "/sprintf-4.m" }, { "id": "sprintf:5", "builtinKey": "sprintf", "builtinTitle": "sprintf", "builtinSlug": "sprintf", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Using Star Width/Precision Arguments", "summary": "Format data into a MATLAB-compatible character vector using printf-style placeholders.", "code": "txt = sprintf('%*.*f %*.*f', 4, 2, 15.2, 6, 4, 0.001)", "output": "txt =\n '15.20 0.0010'", "keywords": ["sprintf", "format", "printf", "text", "gpu"], "suggestedPath": "/sprintf-5.m" }, { "id": "sprintf:6", "builtinKey": "sprintf", "builtinTitle": "sprintf", "builtinSlug": "sprintf", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Quoting Text With `%s`", "summary": "Format data into a MATLAB-compatible character vector using printf-style placeholders.", "code": "names = [\"Ada\", \"Grace\"];\ntxt = sprintf('Hello, %s! ', names)", "output": "txt =\n 'Hello, Ada! Hello, Grace! '", "keywords": ["sprintf", "format", "printf", "text", "gpu"], "suggestedPath": "/sprintf-6.m" }, { "id": "sprintf:7", "builtinKey": "sprintf", "builtinTitle": "sprintf", "builtinSlug": "sprintf", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting GPU-Resident Data", "summary": "Format data into a MATLAB-compatible character vector using printf-style placeholders.", "code": "G = gpuArray([1.5 2.5 3.5]);\ntxt = sprintf('%.1f;', G)", "output": "txt =\n '1.5;2.5;3.5;'", "keywords": ["sprintf", "format", "printf", "text", "gpu"], "suggestedPath": "/sprintf-7.m" }, { "id": "sprintf:8", "builtinKey": "sprintf", "builtinTitle": "sprintf", "builtinSlug": "sprintf", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Creating Multi-line Text", "summary": "Format data into a MATLAB-compatible character vector using printf-style placeholders.", "code": "message = sprintf('First line\\\\nSecond line\\\\t(indented)')", "output": "message =\n 'First line\nSecond line\t(indented)'", "keywords": ["sprintf", "format", "printf", "text", "gpu"], "suggestedPath": "/sprintf-8.m" }, { "id": "sqrt:1", "builtinKey": "sqrt", "builtinTitle": "sqrt", "builtinSlug": "sqrt", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Taking the square root of a positive scalar", "summary": "Element-wise square root of scalars, vectors, matrices, or N-D tensors.", "code": "y = sqrt(9)", "output": "y = 3", "keywords": ["sqrt", "square root", "elementwise", "gpu", "complex"], "suggestedPath": "/sqrt-1.m" }, { "id": "sqrt:2", "builtinKey": "sqrt", "builtinTitle": "sqrt", "builtinSlug": "sqrt", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Square roots of a matrix", "summary": "Element-wise square root of scalars, vectors, matrices, or N-D tensors.", "code": "A = [1 4 9; 16 25 36];\nR = sqrt(A)", "output": "R = [1 2 3; 4 5 6]", "keywords": ["sqrt", "square root", "elementwise", "gpu", "complex"], "suggestedPath": "/sqrt-2.m" }, { "id": "sqrt:3", "builtinKey": "sqrt", "builtinTitle": "sqrt", "builtinSlug": "sqrt", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Square roots of negative inputs produce complex results", "summary": "Element-wise square root of scalars, vectors, matrices, or N-D tensors.", "code": "values = [-1 -4 9];\nroots = sqrt(values)", "output": "roots = [0.0000 + 1.0000i, 0.0000 + 2.0000i, 3.0000 + 0.0000i]", "keywords": ["sqrt", "square root", "elementwise", "gpu", "complex"], "suggestedPath": "/sqrt-3.m" }, { "id": "sqrt:4", "builtinKey": "sqrt", "builtinTitle": "sqrt", "builtinSlug": "sqrt", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Element-wise square root on GPU data", "summary": "Element-wise square root of scalars, vectors, matrices, or N-D tensors.", "code": "G = gpuArray([0 1; 4 9]);\nout = sqrt(G);\nresult = gather(out)", "output": "result = [0 1; 2 3]", "keywords": ["sqrt", "square root", "elementwise", "gpu", "complex"], "suggestedPath": "/sqrt-4.m" }, { "id": "sqrt:5", "builtinKey": "sqrt", "builtinTitle": "sqrt", "builtinSlug": "sqrt", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Square root of complex numbers", "summary": "Element-wise square root of scalars, vectors, matrices, or N-D tensors.", "code": "z = [3 + 4i, -1 + 2i];\nw = sqrt(z)", "output": "w = [2 + 1i, 0.7862 + 1.2720i]", "keywords": ["sqrt", "square root", "elementwise", "gpu", "complex"], "suggestedPath": "/sqrt-5.m" }, { "id": "sqrt:6", "builtinKey": "sqrt", "builtinTitle": "sqrt", "builtinSlug": "sqrt", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Square root of character codes", "summary": "Element-wise square root of scalars, vectors, matrices, or N-D tensors.", "code": "C = 'AB';\nnumericRoots = sqrt(C)", "output": "numericRoots = [8.0623 8.2462]", "keywords": ["sqrt", "square root", "elementwise", "gpu", "complex"], "suggestedPath": "/sqrt-6.m" }, { "id": "squeeze:1", "builtinKey": "squeeze", "builtinTitle": "squeeze", "builtinSlug": "squeeze", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Removing Singleton Dimensions from a 3-D Matrix", "summary": "Remove singleton (size-one) dimensions while preserving MATLAB vector semantics.", "code": "A = reshape(1:12, [1, 3, 4]);\nB = squeeze(A);\nsize(B)", "output": "ans = [3 4]", "keywords": ["squeeze", "singleton dimensions", "array reshape", "gpu"], "suggestedPath": "/squeeze-1.m" }, { "id": "squeeze:2", "builtinKey": "squeeze", "builtinTitle": "squeeze", "builtinSlug": "squeeze", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Turning 1x1xN Slices into Column Vectors", "summary": "Remove singleton (size-one) dimensions while preserving MATLAB vector semantics.", "code": "T = zeros(1, 1, 5);\nT(:, :, 3) = 7;\nvec = squeeze(T);\nsize(vec)", "output": "ans = [5 1]", "keywords": ["squeeze", "singleton dimensions", "array reshape", "gpu"], "suggestedPath": "/squeeze-2.m" }, { "id": "squeeze:3", "builtinKey": "squeeze", "builtinTitle": "squeeze", "builtinSlug": "squeeze", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Keeping Row Vectors Unchanged After Squeeze", "summary": "Remove singleton (size-one) dimensions while preserving MATLAB vector semantics.", "code": "row = rand(1, 8);\nout = squeeze(row);\nsize(out)", "output": "ans = [1 8]", "keywords": ["squeeze", "singleton dimensions", "array reshape", "gpu"], "suggestedPath": "/squeeze-3.m" }, { "id": "squeeze:4", "builtinKey": "squeeze", "builtinTitle": "squeeze", "builtinSlug": "squeeze", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Squeezing Logical Masks from Simulations", "summary": "Remove singleton (size-one) dimensions while preserving MATLAB vector semantics.", "code": "mask = false(1, 10, 1, 1);\nmask(1, 4, 1, 1) = true;\nflat = squeeze(mask)", "output": "flat = [0 0 0 1 0 0 0 0 0 0]'", "keywords": ["squeeze", "singleton dimensions", "array reshape", "gpu"], "suggestedPath": "/squeeze-4.m" }, { "id": "squeeze:5", "builtinKey": "squeeze", "builtinTitle": "squeeze", "builtinSlug": "squeeze", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Using Squeeze on GPU-Resident Data", "summary": "Remove singleton (size-one) dimensions while preserving MATLAB vector semantics.", "code": "G = gpuArray(rand(1, 64, 1));\nH = squeeze(G);\nisgpuarray(H)", "output": "ans = logical 1", "keywords": ["squeeze", "singleton dimensions", "array reshape", "gpu"], "suggestedPath": "/squeeze-5.m" }, { "id": "squeeze:6", "builtinKey": "squeeze", "builtinTitle": "squeeze", "builtinSlug": "squeeze", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Squeezing String Arrays While Preserving Layout", "summary": "Remove singleton (size-one) dimensions while preserving MATLAB vector semantics.", "code": "S = strings(1, 1, 3);\nS(1, 1, 1) = \"run\";\nS(1, 1, 2) = \"mat\";\nS(1, 1, 3) = \"gpu\";\nT = squeeze(S);\nsize(T)", "output": "ans = [3 1]", "keywords": ["squeeze", "singleton dimensions", "array reshape", "gpu"], "suggestedPath": "/squeeze-6.m" }, { "id": "stairs:1", "builtinKey": "stairs", "builtinTitle": "stairs", "builtinSlug": "stairs", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Plot a sampled staircase signal", "summary": "Create step plots for sampled signals, piecewise-constant data, and MATLAB `stairs` workflows.", "code": "t = 0:5;\nstairs(t, cumsum([1 -1 2 -2 1 0]));", "keywords": ["stairs", "step plot", "stair plot", "sampled signal", "matlab stairs"], "suggestedPath": "/stairs-1.m" }, { "id": "stairs:2", "builtinKey": "stairs", "builtinTitle": "stairs", "builtinSlug": "stairs", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use MATLAB-style y-only shorthand", "summary": "Create step plots for sampled signals, piecewise-constant data, and MATLAB `stairs` workflows.", "code": "stairs([3 1 4 1 5 9]);", "keywords": ["stairs", "step plot", "stair plot", "sampled signal", "matlab stairs"], "suggestedPath": "/stairs-2.m" }, { "id": "stairs:3", "builtinKey": "stairs", "builtinTitle": "stairs", "builtinSlug": "stairs", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Style a stairs object and label it for the legend", "summary": "Create step plots for sampled signals, piecewise-constant data, and MATLAB `stairs` workflows.", "code": "h = stairs(0:4, [1 2 2 3 5]);\nset(h, 'Color', 'm', 'LineWidth', 2, 'DisplayName', 'sampled signal');\nlegend;", "keywords": ["stairs", "step plot", "stair plot", "sampled signal", "matlab stairs"], "suggestedPath": "/stairs-3.m" }, { "id": "startswith:1", "builtinKey": "startswith", "builtinTitle": "startsWith", "builtinSlug": "startswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Determine whether a string starts with a prefix", "summary": "Check whether text inputs start with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "tf = startsWith(\"RunMat Accelerate\", \"RunMat\")", "output": "tf = logical\n 1", "keywords": ["startswith", "prefix", "string array", "ignorecase", "text search"], "suggestedPath": "/startswith-1.m" }, { "id": "startswith:2", "builtinKey": "startswith", "builtinTitle": "startsWith", "builtinSlug": "startswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Perform a case-insensitive prefix check", "summary": "Check whether text inputs start with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "tf = startsWith(\"RunMat\", \"run\", 'IgnoreCase', true)", "output": "tf = logical\n 1", "keywords": ["startswith", "prefix", "string array", "ignorecase", "text search"], "suggestedPath": "/startswith-2.m" }, { "id": "startswith:3", "builtinKey": "startswith", "builtinTitle": "startsWith", "builtinSlug": "startswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Ignore case using the legacy logical flag", "summary": "Check whether text inputs start with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "tf = startsWith(\"RUNMAT\", \"run\", true)", "output": "tf = logical\n 1", "keywords": ["startswith", "prefix", "string array", "ignorecase", "text search"], "suggestedPath": "/startswith-3.m" }, { "id": "startswith:4", "builtinKey": "startswith", "builtinTitle": "startsWith", "builtinSlug": "startswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Apply a scalar prefix to every element of a string array", "summary": "Check whether text inputs start with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "labels = [\"alpha\" \"beta\" \"gamma\"];\ntf = startsWith(labels, \"a\")", "output": "tf = 1×3 logical array\n 1 0 0", "keywords": ["startswith", "prefix", "string array", "ignorecase", "text search"], "suggestedPath": "/startswith-4.m" }, { "id": "startswith:5", "builtinKey": "startswith", "builtinTitle": "startsWith", "builtinSlug": "startswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Match element-wise prefixes with implicit expansion", "summary": "Check whether text inputs start with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "names = [\"hydrogen\"; \"helium\"; \"lithium\"];\nprefixes = [\"hyd\"; \"hel\"; \"lit\"];\ntf = startsWith(names, prefixes)", "output": "tf = 3×1 logical array\n 1\n 1\n 1", "keywords": ["startswith", "prefix", "string array", "ignorecase", "text search"], "suggestedPath": "/startswith-5.m" }, { "id": "startswith:6", "builtinKey": "startswith", "builtinTitle": "startsWith", "builtinSlug": "startswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Test prefixes for a cell array of character vectors", "summary": "Check whether text inputs start with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "C = {'Mercury', 'Venus', 'Mars'};\ntf = startsWith(C, 'M')", "output": "tf = 1×3 logical array\n 1 0 1", "keywords": ["startswith", "prefix", "string array", "ignorecase", "text search"], "suggestedPath": "/startswith-6.m" }, { "id": "startswith:7", "builtinKey": "startswith", "builtinTitle": "startsWith", "builtinSlug": "startswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Provide multiple prefixes as a column vector", "summary": "Check whether text inputs start with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "tf = startsWith(\"saturn\", ['s'; 'n'; 'x'])", "output": "tf = 3×1 logical array\n 1\n 0\n 0", "keywords": ["startswith", "prefix", "string array", "ignorecase", "text search"], "suggestedPath": "/startswith-7.m" }, { "id": "startswith:8", "builtinKey": "startswith", "builtinTitle": "startsWith", "builtinSlug": "startswith", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Handle empty and missing values", "summary": "Check whether text inputs start with specific patterns using MATLAB-compatible broadcasting and case handling.", "code": "texts = [\"\", \"<missing>\"];\ntf = startsWith(texts, \"\")", "output": "tf = 1×2 logical array\n 1 0", "keywords": ["startswith", "prefix", "string array", "ignorecase", "text search"], "suggestedPath": "/startswith-8.m" }, { "id": "std:1", "builtinKey": "std", "builtinTitle": "std", "builtinSlug": "std", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Sample standard deviation of a vector", "summary": "Standard deviation of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "x = [1 2 3 4 5];\ns = std(x); % uses flag = 0 (sample) by default", "output": "s = 1.5811", "keywords": ["std", "standard deviation", "statistics", "gpu", "omitnan", "all", "like", "native"], "suggestedPath": "/std-1.m" }, { "id": "std:2", "builtinKey": "std", "builtinTitle": "std", "builtinSlug": "std", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Population standard deviation of each column", "summary": "Standard deviation of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [1 3 5; 2 4 6];\nspop = std(A, 1); % divide by n instead of n-1", "output": "spop = [0.5 0.5 0.5]", "keywords": ["std", "standard deviation", "statistics", "gpu", "omitnan", "all", "like", "native"], "suggestedPath": "/std-2.m" }, { "id": "std:3", "builtinKey": "std", "builtinTitle": "std", "builtinSlug": "std", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Collapsing every dimension at once", "summary": "Standard deviation of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "B = reshape(1:12, [3 4]);\noverall = std(B, 0, 'all')", "output": "overall = 3.6056", "keywords": ["std", "standard deviation", "statistics", "gpu", "omitnan", "all", "like", "native"], "suggestedPath": "/std-3.m" }, { "id": "std:4", "builtinKey": "std", "builtinTitle": "std", "builtinSlug": "std", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Reducing across multiple dimensions", "summary": "Standard deviation of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "C = cat(3, [1 2; 3 4], [5 6; 7 8]);\nsliceStd = std(C, [], [1 3]); % keep columns, reduce rows & pages", "output": "sliceStd = [2.5820 2.5820]", "keywords": ["std", "standard deviation", "statistics", "gpu", "omitnan", "all", "like", "native"], "suggestedPath": "/std-4.m" }, { "id": "std:5", "builtinKey": "std", "builtinTitle": "std", "builtinSlug": "std", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring NaN values", "summary": "Standard deviation of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "D = [1 NaN 3; 2 4 NaN];\nrowStd = std(D, 0, 2, 'omitnan')", "output": "rowStd = [1.4142; 1.4142]", "keywords": ["std", "standard deviation", "statistics", "gpu", "omitnan", "all", "like", "native"], "suggestedPath": "/std-5.m" }, { "id": "std:6", "builtinKey": "std", "builtinTitle": "std", "builtinSlug": "std", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Matching a prototype using `'like'`", "summary": "Standard deviation of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "proto = gpuArray(single(42));\nG = gpuArray(rand(1024, 512));\nspread = std(G, 1, 'all', 'like', proto);\nanswer = gather(spread)", "keywords": ["std", "standard deviation", "statistics", "gpu", "omitnan", "all", "like", "native"], "suggestedPath": "/std-6.m" }, { "id": "std:7", "builtinKey": "std", "builtinTitle": "std", "builtinSlug": "std", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Preserving default behaviour with an empty normalisation flag", "summary": "Standard deviation of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "C = [1 2; 3 4];\nrowStd = std(C, [], 2)", "output": "rowStd = [0.7071; 0.7071]", "keywords": ["std", "standard deviation", "statistics", "gpu", "omitnan", "all", "like", "native"], "suggestedPath": "/std-7.m" }, { "id": "stem:1", "builtinKey": "stem", "builtinTitle": "stem", "builtinSlug": "stem", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a stem plot from y-values only", "summary": "Create stem plots for discrete signals, sequence visualization, and MATLAB `stem` workflows.", "code": "stem([1 4 2 5 3]);", "keywords": ["stem", "stem plot", "discrete signal plot", "sequence visualization", "matlab stem"], "suggestedPath": "/stem-1.m" }, { "id": "stem:2", "builtinKey": "stem", "builtinTitle": "stem", "builtinSlug": "stem", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use explicit x-values and filled markers", "summary": "Create stem plots for discrete signals, sequence visualization, and MATLAB `stem` workflows.", "code": "x = 0:5;\nh = stem(x, [0 1 0 2 0 3]);\nset(h, 'Filled', true, 'DisplayName', 'samples');\nlegend;", "keywords": ["stem", "stem plot", "discrete signal plot", "sequence visualization", "matlab stem"], "suggestedPath": "/stem-2.m" }, { "id": "stem:3", "builtinKey": "stem", "builtinTitle": "stem", "builtinSlug": "stem", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect a stem handle after plotting", "summary": "Create stem plots for discrete signals, sequence visualization, and MATLAB `stem` workflows.", "code": "h = stem(1:5, [2 1 3 2 4]);\nget(h, 'Type')", "output": "ans =\n 'stem'", "keywords": ["stem", "stem plot", "discrete signal plot", "sequence visualization", "matlab stem"], "suggestedPath": "/stem-3.m" }, { "id": "str2double:1", "builtinKey": "str2double", "builtinTitle": "str2double", "builtinSlug": "str2double", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Convert a string scalar into a double", "summary": "Convert strings, character arrays, or cell arrays of text into double-precision numbers with MATLAB-compatible rules.", "code": "value = str2double(\"3.14159\")", "output": "value = 3.14159", "keywords": ["str2double", "string to double", "text conversion", "numeric parsing", "gpu"], "suggestedPath": "/str2double-1.m" }, { "id": "str2double:2", "builtinKey": "str2double", "builtinTitle": "str2double", "builtinSlug": "str2double", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Convert every element of a string array", "summary": "Convert strings, character arrays, or cell arrays of text into double-precision numbers with MATLAB-compatible rules.", "code": "temps = [\"12.5\" \"19.8\" \"not-a-number\"];\ndata = str2double(temps)", "output": "data = 1×3\n 12.5000 19.8000 NaN", "keywords": ["str2double", "string to double", "text conversion", "numeric parsing", "gpu"], "suggestedPath": "/str2double-2.m" }, { "id": "str2double:3", "builtinKey": "str2double", "builtinTitle": "str2double", "builtinSlug": "str2double", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Parse scientific notation text", "summary": "Convert strings, character arrays, or cell arrays of text into double-precision numbers with MATLAB-compatible rules.", "code": "result = str2double(\"6.022e23\")", "output": "result = 6.0220e+23", "keywords": ["str2double", "string to double", "text conversion", "numeric parsing", "gpu"], "suggestedPath": "/str2double-3.m" }, { "id": "str2double:4", "builtinKey": "str2double", "builtinTitle": "str2double", "builtinSlug": "str2double", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Handle engineering exponents written with `D`", "summary": "Convert strings, character arrays, or cell arrays of text into double-precision numbers with MATLAB-compatible rules.", "code": "cap = str2double(\"4.7D-9\")", "output": "cap = 4.7000e-09", "keywords": ["str2double", "string to double", "text conversion", "numeric parsing", "gpu"], "suggestedPath": "/str2double-4.m" }, { "id": "str2double:5", "builtinKey": "str2double", "builtinTitle": "str2double", "builtinSlug": "str2double", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Convert a character array one row at a time", "summary": "Convert strings, character arrays, or cell arrays of text into double-precision numbers with MATLAB-compatible rules.", "code": "chars = ['42 '; ' 100'];\nnumbers = str2double(chars)", "output": "numbers = 2×1\n 42\n 100", "keywords": ["str2double", "string to double", "text conversion", "numeric parsing", "gpu"], "suggestedPath": "/str2double-5.m" }, { "id": "str2double:6", "builtinKey": "str2double", "builtinTitle": "str2double", "builtinSlug": "str2double", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Work with cell arrays of character vectors", "summary": "Convert strings, character arrays, or cell arrays of text into double-precision numbers with MATLAB-compatible rules.", "code": "C = {'3.14', 'NaN', '-Inf'};\nvalues = str2double(C)", "output": "values = 1×3\n 3.1400 NaN -Inf", "keywords": ["str2double", "string to double", "text conversion", "numeric parsing", "gpu"], "suggestedPath": "/str2double-6.m" }, { "id": "str2double:7", "builtinKey": "str2double", "builtinTitle": "str2double", "builtinSlug": "str2double", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Detect invalid numeric text", "summary": "Convert strings, character arrays, or cell arrays of text into double-precision numbers with MATLAB-compatible rules.", "code": "status = str2double(\"error42\")", "output": "status = NaN", "keywords": ["str2double", "string to double", "text conversion", "numeric parsing", "gpu"], "suggestedPath": "/str2double-7.m" }, { "id": "str2double:8", "builtinKey": "str2double", "builtinTitle": "str2double", "builtinSlug": "str2double", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Recognise special values `Inf` and `NaN`", "summary": "Convert strings, character arrays, or cell arrays of text into double-precision numbers with MATLAB-compatible rules.", "code": "special = str2double([\"Inf\"; \"-Infinity\"; \"NaN\"])", "output": "special = 3×1\n Inf\n -Inf\n NaN", "keywords": ["str2double", "string to double", "text conversion", "numeric parsing", "gpu"], "suggestedPath": "/str2double-8.m" }, { "id": "strcat:1", "builtinKey": "strcat", "builtinTitle": "strcat", "builtinSlug": "strcat", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Concatenate string scalars element-wise", "summary": "Concatenate text inputs element-wise with MATLAB-compatible trimming and implicit expansion.", "code": "greeting = strcat(\"Run\", \"Mat\")", "output": "greeting = \"RunMat\"", "keywords": ["strcat", "string concatenation", "character arrays", "cell arrays", "trailing spaces"], "suggestedPath": "/strcat-1.m" }, { "id": "strcat:2", "builtinKey": "strcat", "builtinTitle": "strcat", "builtinSlug": "strcat", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Concatenate a string scalar with a string array", "summary": "Concatenate text inputs element-wise with MATLAB-compatible trimming and implicit expansion.", "code": "names = [\"Ignition\", \"Turbine\", \"Accelerate\"];\ntagged = strcat(\"runmat-\", names)", "output": "tagged = 1×3 string\n \"runmat-Ignition\" \"runmat-Turbine\" \"runmat-Accelerate\"", "keywords": ["strcat", "string concatenation", "character arrays", "cell arrays", "trailing spaces"], "suggestedPath": "/strcat-2.m" }, { "id": "strcat:3", "builtinKey": "strcat", "builtinTitle": "strcat", "builtinSlug": "strcat", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Concatenate character arrays while trimming trailing spaces", "summary": "Concatenate text inputs element-wise with MATLAB-compatible trimming and implicit expansion.", "code": "A = char(\"GPU \", \"Planner\");\nB = char(\"Accel\", \" Stage \");\nresult = strcat(A, B)", "output": "result =\n\n 2×11 char array\n\n 'GPUAccel'\n 'PlannerStage'", "keywords": ["strcat", "string concatenation", "character arrays", "cell arrays", "trailing spaces"], "suggestedPath": "/strcat-3.m" }, { "id": "strcat:4", "builtinKey": "strcat", "builtinTitle": "strcat", "builtinSlug": "strcat", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Concatenate cell arrays of character vectors", "summary": "Concatenate text inputs element-wise with MATLAB-compatible trimming and implicit expansion.", "code": "C = {'Run ', 'Plan '; 'Fuse ', 'Cache '};\nsuffix = {'Mat', 'Ops'; 'Kernels', 'Stats'};\ncombined = strcat(C, suffix)", "output": "combined = 2×2 cell\n {'RunMat'} {'PlanOps'}\n {'FuseKernels'} {'CacheStats'}", "keywords": ["strcat", "string concatenation", "character arrays", "cell arrays", "trailing spaces"], "suggestedPath": "/strcat-4.m" }, { "id": "strcat:5", "builtinKey": "strcat", "builtinTitle": "strcat", "builtinSlug": "strcat", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Propagate missing strings during concatenation", "summary": "Concatenate text inputs element-wise with MATLAB-compatible trimming and implicit expansion.", "code": "values = [string(missing) \"ready\"];\nout = strcat(\"job-\", values)", "output": "out = 1×2 string\n <missing> \"job-ready\"", "keywords": ["strcat", "string concatenation", "character arrays", "cell arrays", "trailing spaces"], "suggestedPath": "/strcat-5.m" }, { "id": "strcat:6", "builtinKey": "strcat", "builtinTitle": "strcat", "builtinSlug": "strcat", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Broadcast a scalar character vector across a character array", "summary": "Concatenate text inputs element-wise with MATLAB-compatible trimming and implicit expansion.", "code": "labels = char(\"core\", \"runtime\", \"planner\");\nprefixed = strcat(\"runmat-\", labels)", "output": "prefixed =\n\n 3×11 char array\n\n 'runmat-core'\n 'runmat-runtime'\n 'runmat-planner'", "keywords": ["strcat", "string concatenation", "character arrays", "cell arrays", "trailing spaces"], "suggestedPath": "/strcat-6.m" }, { "id": "strcmp:1", "builtinKey": "strcmp", "builtinTitle": "strcmp", "builtinSlug": "strcmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Compare Two Equal Strings", "summary": "Compare text inputs for exact equality with MATLAB-compatible implicit expansion across text types.", "code": "tf = strcmp(\"RunMat\", \"RunMat\")", "output": "tf = logical\n 1", "keywords": ["strcmp", "string compare", "text equality", "cell array", "character vector"], "suggestedPath": "/strcmp-1.m" }, { "id": "strcmp:2", "builtinKey": "strcmp", "builtinTitle": "strcmp", "builtinSlug": "strcmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Compare String Array With Scalar Text", "summary": "Compare text inputs for exact equality with MATLAB-compatible implicit expansion across text types.", "code": "names = [\"red\" \"green\" \"blue\"];\ntf = strcmp(names, \"green\")", "output": "tf = 1×3 logical array\n 0 1 0", "keywords": ["strcmp", "string compare", "text equality", "cell array", "character vector"], "suggestedPath": "/strcmp-2.m" }, { "id": "strcmp:3", "builtinKey": "strcmp", "builtinTitle": "strcmp", "builtinSlug": "strcmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Compare Character Array Rows", "summary": "Compare text inputs for exact equality with MATLAB-compatible implicit expansion across text types.", "code": "labels = char(\"cat\", \"dog\", \"cat\");\ntf = strcmp(labels, \"cat\")", "output": "tf = 3×1 logical array\n 1\n 0\n 1", "keywords": ["strcmp", "string compare", "text equality", "cell array", "character vector"], "suggestedPath": "/strcmp-3.m" }, { "id": "strcmp:4", "builtinKey": "strcmp", "builtinTitle": "strcmp", "builtinSlug": "strcmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Compare Two Cell Arrays Of Character Vectors", "summary": "Compare text inputs for exact equality with MATLAB-compatible implicit expansion across text types.", "code": "C1 = {'apple', 'pear', 'grape'};\nC2 = {'apple', 'peach', 'grape'};\ntf = strcmp(C1, C2)", "output": "tf = 1×3 logical array\n 1 0 1", "keywords": ["strcmp", "string compare", "text equality", "cell array", "character vector"], "suggestedPath": "/strcmp-4.m" }, { "id": "strcmp:5", "builtinKey": "strcmp", "builtinTitle": "strcmp", "builtinSlug": "strcmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Handle Missing Strings", "summary": "Compare text inputs for exact equality with MATLAB-compatible implicit expansion across text types.", "code": "vals = [\"alpha\" missing];\ntf = strcmp(vals, \"alpha\")", "output": "tf = 1×2 logical array\n 1 0", "keywords": ["strcmp", "string compare", "text equality", "cell array", "character vector"], "suggestedPath": "/strcmp-5.m" }, { "id": "strcmp:6", "builtinKey": "strcmp", "builtinTitle": "strcmp", "builtinSlug": "strcmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Implicit Expansion With Column Vector Text", "summary": "Compare text inputs for exact equality with MATLAB-compatible implicit expansion across text types.", "code": "patterns = char(\"north\", \"south\");\ntf = strcmp(patterns, [\"north\" \"east\"])", "output": "tf = 2×2 logical array\n 1 0\n 0 0", "keywords": ["strcmp", "string compare", "text equality", "cell array", "character vector"], "suggestedPath": "/strcmp-6.m" }, { "id": "strcmpi:1", "builtinKey": "strcmpi", "builtinTitle": "strcmpi", "builtinSlug": "strcmpi", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Compare Two Strings Ignoring Case", "summary": "Compare text inputs for equality without considering letter case, matching MATLAB's `strcmpi` semantics.", "code": "tf = strcmpi(\"RunMat\", \"runmat\")", "output": "tf = logical\n 1", "keywords": ["strcmpi", "case insensitive compare", "string compare", "text equality", "cell array"], "suggestedPath": "/strcmpi-1.m" }, { "id": "strcmpi:2", "builtinKey": "strcmpi", "builtinTitle": "strcmpi", "builtinSlug": "strcmpi", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Find Case-Insensitive Matches Inside a String Array", "summary": "Compare text inputs for equality without considering letter case, matching MATLAB's `strcmpi` semantics.", "code": "colors = [\"Red\" \"GREEN\" \"blue\"];\nmask = strcmpi(colors, \"green\")", "output": "mask = 1×3 logical array\n 0 1 0", "keywords": ["strcmpi", "case insensitive compare", "string compare", "text equality", "cell array"], "suggestedPath": "/strcmpi-2.m" }, { "id": "strcmpi:3", "builtinKey": "strcmpi", "builtinTitle": "strcmpi", "builtinSlug": "strcmpi", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Compare Character Array Rows Without Case Sensitivity", "summary": "Compare text inputs for equality without considering letter case, matching MATLAB's `strcmpi` semantics.", "code": "animals = char(\"Cat\", \"DOG\", \"cat\");\ntf = strcmpi(animals, \"cAt\")", "output": "tf = 3×1 logical array\n 1\n 0\n 1", "keywords": ["strcmpi", "case insensitive compare", "string compare", "text equality", "cell array"], "suggestedPath": "/strcmpi-3.m" }, { "id": "strcmpi:4", "builtinKey": "strcmpi", "builtinTitle": "strcmpi", "builtinSlug": "strcmpi", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Compare Cell Arrays Of Character Vectors Case-Insensitively", "summary": "Compare text inputs for equality without considering letter case, matching MATLAB's `strcmpi` semantics.", "code": "C1 = {'north', 'East', 'SOUTH'};\nC2 = {'NORTH', 'east', 'west'};\ntf = strcmpi(C1, C2)", "output": "tf = 1×3 logical array\n 1 1 0", "keywords": ["strcmpi", "case insensitive compare", "string compare", "text equality", "cell array"], "suggestedPath": "/strcmpi-4.m" }, { "id": "strcmpi:5", "builtinKey": "strcmpi", "builtinTitle": "strcmpi", "builtinSlug": "strcmpi", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Broadcast A String Scalar Against A Character Matrix", "summary": "Compare text inputs for equality without considering letter case, matching MATLAB's `strcmpi` semantics.", "code": "patterns = char(\"alpha\", \"BETA\");\ntf = strcmpi(patterns, [\"ALPHA\" \"beta\"])", "output": "tf = 2×2 logical array\n 1 0\n 0 1", "keywords": ["strcmpi", "case insensitive compare", "string compare", "text equality", "cell array"], "suggestedPath": "/strcmpi-5.m" }, { "id": "strcmpi:6", "builtinKey": "strcmpi", "builtinTitle": "strcmpi", "builtinSlug": "strcmpi", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Handle Missing Strings In Case-Insensitive Comparisons", "summary": "Compare text inputs for equality without considering letter case, matching MATLAB's `strcmpi` semantics.", "code": "values = [\"Active\" missing];\nmask = strcmpi(values, \"active\")", "output": "mask = 1×2 logical array\n 1 0", "keywords": ["strcmpi", "case insensitive compare", "string compare", "text equality", "cell array"], "suggestedPath": "/strcmpi-6.m" }, { "id": "strfind:1", "builtinKey": "strfind", "builtinTitle": "strfind", "builtinSlug": "strfind", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Find substring positions in a character vector", "summary": "Locate the starting indices of pattern matches in text inputs, returning doubles or cell arrays like MATLAB.", "code": "idx = strfind('abracadabra', 'abra')", "output": "idx = [1 8]", "keywords": ["strfind", "substring", "index", "positions", "forcecelloutput"], "suggestedPath": "/strfind-1.m" }, { "id": "strfind:2", "builtinKey": "strfind", "builtinTitle": "strfind", "builtinSlug": "strfind", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Locate overlapping matches", "summary": "Locate the starting indices of pattern matches in text inputs, returning doubles or cell arrays like MATLAB.", "code": "idx = strfind(\"aaaa\", \"aa\")", "output": "idx = [1 2 3]", "keywords": ["strfind", "substring", "index", "positions", "forcecelloutput"], "suggestedPath": "/strfind-2.m" }, { "id": "strfind:3", "builtinKey": "strfind", "builtinTitle": "strfind", "builtinSlug": "strfind", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Return matches for each element of a string array", "summary": "Locate the starting indices of pattern matches in text inputs, returning doubles or cell arrays like MATLAB.", "code": "words = [\"hydrogen\"; \"helium\"; \"lithium\"];\nidx = strfind(words, \"i\")", "output": "idx = 3×1 cell array\n {[]}\n {[4]}\n {[2 5]}", "keywords": ["strfind", "substring", "index", "positions", "forcecelloutput"], "suggestedPath": "/strfind-3.m" }, { "id": "strfind:4", "builtinKey": "strfind", "builtinTitle": "strfind", "builtinSlug": "strfind", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Search with multiple patterns against one subject", "summary": "Locate the starting indices of pattern matches in text inputs, returning doubles or cell arrays like MATLAB.", "code": "idx = strfind(\"saturn\", [\"sat\", \"turn\", \"moon\"])", "output": "idx = 1×3 cell array\n {[1]} {[3]} {[]}", "keywords": ["strfind", "substring", "index", "positions", "forcecelloutput"], "suggestedPath": "/strfind-4.m" }, { "id": "strfind:5", "builtinKey": "strfind", "builtinTitle": "strfind", "builtinSlug": "strfind", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Force cell output for scalar inputs", "summary": "Locate the starting indices of pattern matches in text inputs, returning doubles or cell arrays like MATLAB.", "code": "idx = strfind('mission', 's', 'ForceCellOutput', true)", "output": "idx = 1×1 cell array\n {[3 4]}", "keywords": ["strfind", "substring", "index", "positions", "forcecelloutput"], "suggestedPath": "/strfind-5.m" }, { "id": "strfind:6", "builtinKey": "strfind", "builtinTitle": "strfind", "builtinSlug": "strfind", "category": "strings/search", "categoryPath": ["strings", "search"], "exampleTitle": "Handle empty patterns and missing strings", "summary": "Locate the starting indices of pattern matches in text inputs, returning doubles or cell arrays like MATLAB.", "code": "idxEmpty = strfind(\"abc\", \"\");\nidxMissing = strfind(\"<missing>\", \"abc\")", "output": "idxEmpty = [1 2 3 4];\nidxMissing = []", "keywords": ["strfind", "substring", "index", "positions", "forcecelloutput"], "suggestedPath": "/strfind-6.m" }, { "id": "string.empty:1", "builtinKey": "string.empty", "builtinTitle": "string.empty", "builtinSlug": "string.empty", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Creating a 0x0 string array", "summary": "Construct empty string arrays with MATLAB-compatible dimension semantics and 'like' prototypes.", "code": "S = string.empty", "output": "S =\n 0x0 string array", "keywords": ["string.empty", "empty string array", "preallocate text", "size vector", "0-by-N", "'like'"], "suggestedPath": "/string-empty-1.m" }, { "id": "string.empty:2", "builtinKey": "string.empty", "builtinTitle": "string.empty", "builtinSlug": "string.empty", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Building a 0xN string row vector", "summary": "Construct empty string arrays with MATLAB-compatible dimension semantics and 'like' prototypes.", "code": "row = string.empty(5)", "output": "row =\n 0x5 string array", "keywords": ["string.empty", "empty string array", "preallocate text", "size vector", "0-by-N", "'like'"], "suggestedPath": "/string-empty-2.m" }, { "id": "string.empty:3", "builtinKey": "string.empty", "builtinTitle": "string.empty", "builtinSlug": "string.empty", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Creating a 0xN string array with extra dimensions", "summary": "Construct empty string arrays with MATLAB-compatible dimension semantics and 'like' prototypes.", "code": "cube = string.empty(0, 4, 3)", "output": "cube =\n 0x4x3 string array", "keywords": ["string.empty", "empty string array", "preallocate text", "size vector", "0-by-N", "'like'"], "suggestedPath": "/string-empty-3.m" }, { "id": "string.empty:4", "builtinKey": "string.empty", "builtinTitle": "string.empty", "builtinSlug": "string.empty", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Using a size vector with string.empty", "summary": "Construct empty string arrays with MATLAB-compatible dimension semantics and 'like' prototypes.", "code": "sz = [0 2 5];\ngrid = string.empty(sz)", "output": "grid =\n 0x2x5 string array", "keywords": ["string.empty", "empty string array", "preallocate text", "size vector", "0-by-N", "'like'"], "suggestedPath": "/string-empty-4.m" }, { "id": "string.empty:5", "builtinKey": "string.empty", "builtinTitle": "string.empty", "builtinSlug": "string.empty", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Resetting a preallocated string array to empty", "summary": "Construct empty string arrays with MATLAB-compatible dimension semantics and 'like' prototypes.", "code": "A = strings(3, 2); % Some application-specific strings\nA = string.empty(size(A))", "output": "A =\n 0x2 string array", "keywords": ["string.empty", "empty string array", "preallocate text", "size vector", "0-by-N", "'like'"], "suggestedPath": "/string-empty-5.m" }, { "id": "string.empty:6", "builtinKey": "string.empty", "builtinTitle": "string.empty", "builtinSlug": "string.empty", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Preserving higher-dimensional layout while empty", "summary": "Construct empty string arrays with MATLAB-compatible dimension semantics and 'like' prototypes.", "code": "layout = string.empty([2 0 4 6])", "output": "layout =\n 0x0x4x6 string array", "keywords": ["string.empty", "empty string array", "preallocate text", "size vector", "0-by-N", "'like'"], "suggestedPath": "/string-empty-6.m" }, { "id": "string.empty:7", "builtinKey": "string.empty", "builtinTitle": "string.empty", "builtinSlug": "string.empty", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Reusing the shape of an existing array with `'like'`", "summary": "Construct empty string arrays with MATLAB-compatible dimension semantics and 'like' prototypes.", "code": "proto = strings(3, 2);\nsameCols = string.empty('like', proto)", "output": "sameCols =\n 0x2 string array", "keywords": ["string.empty", "empty string array", "preallocate text", "size vector", "0-by-N", "'like'"], "suggestedPath": "/string-empty-7.m" }, { "id": "string:1", "builtinKey": "string", "builtinTitle": "string", "builtinSlug": "string", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Converting A Numeric Scalar To A String", "summary": "Convert numeric, logical, character, and text inputs into MATLAB string arrays, with optional format-spec composition.", "code": "name = string(42)", "output": "name = \"42\"", "keywords": ["string", "convert", "text", "char", "gpu"], "suggestedPath": "/string-1.m" }, { "id": "string:2", "builtinKey": "string", "builtinTitle": "string", "builtinSlug": "string", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Turning A Numeric Row Vector Into Strings", "summary": "Convert numeric, logical, character, and text inputs into MATLAB string arrays, with optional format-spec composition.", "code": "values = string([3.14159 2.71828 1.41421])", "output": "values = 1×3 string\n \"3.1416\" \"2.7183\" \"1.4142\"", "keywords": ["string", "convert", "text", "char", "gpu"], "suggestedPath": "/string-2.m" }, { "id": "string:3", "builtinKey": "string", "builtinTitle": "string", "builtinSlug": "string", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Converting A Character Matrix Into A String Array", "summary": "Convert numeric, logical, character, and text inputs into MATLAB string arrays, with optional format-spec composition.", "code": "C = ['North '; 'South '; 'East '; 'West '];\nregions = string(C)", "output": "regions = 4×1 string\n \"North \"\n \"South \"\n \"East \"\n \"West \"", "keywords": ["string", "convert", "text", "char", "gpu"], "suggestedPath": "/string-3.m" }, { "id": "string:4", "builtinKey": "string", "builtinTitle": "string", "builtinSlug": "string", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Converting Logical Data To String Scalars", "summary": "Convert numeric, logical, character, and text inputs into MATLAB string arrays, with optional format-spec composition.", "code": "flags = string(logical([1 0 1 0]))", "output": "flags = 1×4 string\n \"true\" \"false\" \"true\" \"false\"", "keywords": ["string", "convert", "text", "char", "gpu"], "suggestedPath": "/string-4.m" }, { "id": "string:5", "builtinKey": "string", "builtinTitle": "string", "builtinSlug": "string", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Creating Strings From A Cell Array Of Mixed Scalars", "summary": "Convert numeric, logical, character, and text inputs into MATLAB string arrays, with optional format-spec composition.", "code": "C = {true, 17, \"runmat\"};\nS = string(C)", "output": "S = 1×3 string\n \"true\" \"17\" \"runmat\"", "keywords": ["string", "convert", "text", "char", "gpu"], "suggestedPath": "/string-5.m" }, { "id": "string:6", "builtinKey": "string", "builtinTitle": "string", "builtinSlug": "string", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Formatting Numbers With A Template", "summary": "Convert numeric, logical, character, and text inputs into MATLAB string arrays, with optional format-spec composition.", "code": "labels = string(\"Trial %d\", 1:4)", "output": "labels = 1×4 string\n \"Trial 1\" \"Trial 2\" \"Trial 3\" \"Trial 4\"", "keywords": ["string", "convert", "text", "char", "gpu"], "suggestedPath": "/string-6.m" }, { "id": "string:7", "builtinKey": "string", "builtinTitle": "string", "builtinSlug": "string", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Converting GPU-Resident Numeric Data To Strings", "summary": "Convert numeric, logical, character, and text inputs into MATLAB string arrays, with optional format-spec composition.", "code": "G = gpuArray([10 20 30]);\nlabels = string(G)", "output": "labels = 1×3 string\n \"10\" \"20\" \"30\"", "keywords": ["string", "convert", "text", "char", "gpu"], "suggestedPath": "/string-7.m" }, { "id": "strings:1", "builtinKey": "strings", "builtinTitle": "strings", "builtinSlug": "strings", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Creating a square array of empty strings", "summary": "Preallocate string arrays filled with empty text scalars using MATLAB-compatible size syntax.", "code": "S = strings(4)", "output": "S = 4x4 string\n \"\" \"\" \"\" \"\"\n \"\" \"\" \"\" \"\"\n \"\" \"\" \"\" \"\"\n \"\" \"\" \"\" \"\"", "keywords": ["strings", "preallocate", "string array", "empty strings", "missing", "like", "gpu"], "suggestedPath": "/strings-1.m" }, { "id": "strings:2", "builtinKey": "strings", "builtinTitle": "strings", "builtinSlug": "strings", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Preallocating with separate dimension arguments", "summary": "Preallocate string arrays filled with empty text scalars using MATLAB-compatible size syntax.", "code": "grid = strings(2, 3, 4)", "output": "grid = 2x3x4 string\ngrid(:,:,1) =\n \"\" \"\" \"\"\n \"\" \"\" \"\"", "keywords": ["strings", "preallocate", "string array", "empty strings", "missing", "like", "gpu"], "suggestedPath": "/strings-2.m" }, { "id": "strings:3", "builtinKey": "strings", "builtinTitle": "strings", "builtinSlug": "strings", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Cloning the size of another array", "summary": "Preallocate string arrays filled with empty text scalars using MATLAB-compatible size syntax.", "code": "A = magic(3);\nplaceholders = strings(size(A))", "output": "placeholders = 3x3 string\n \"\" \"\" \"\"\n \"\" \"\" \"\"\n \"\" \"\" \"\"", "keywords": ["strings", "preallocate", "string array", "empty strings", "missing", "like", "gpu"], "suggestedPath": "/strings-3.m" }, { "id": "strings:4", "builtinKey": "strings", "builtinTitle": "strings", "builtinSlug": "strings", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Handling zero dimensions", "summary": "Preallocate string arrays filled with empty text scalars using MATLAB-compatible size syntax.", "code": "emptyRow = strings(0, 5)", "output": "emptyRow = 0x5 string", "keywords": ["strings", "preallocate", "string array", "empty strings", "missing", "like", "gpu"], "suggestedPath": "/strings-4.m" }, { "id": "strings:5", "builtinKey": "strings", "builtinTitle": "strings", "builtinSlug": "strings", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Preserving trailing singleton dimensions", "summary": "Preallocate string arrays filled with empty text scalars using MATLAB-compatible size syntax.", "code": "column = strings(3, 1, 1, 1);\nsz = size(column)", "output": "sz =\n 3 1 1 1", "keywords": ["strings", "preallocate", "string array", "empty strings", "missing", "like", "gpu"], "suggestedPath": "/strings-5.m" }, { "id": "strings:6", "builtinKey": "strings", "builtinTitle": "strings", "builtinSlug": "strings", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Filling arrays with missing string scalars", "summary": "Preallocate string arrays filled with empty text scalars using MATLAB-compatible size syntax.", "code": "placeholders = strings(2, 3, \"missing\")", "output": "placeholders = 2x3 string\n <missing> <missing> <missing>\n <missing> <missing> <missing>", "keywords": ["strings", "preallocate", "string array", "empty strings", "missing", "like", "gpu"], "suggestedPath": "/strings-6.m" }, { "id": "strings:7", "builtinKey": "strings", "builtinTitle": "strings", "builtinSlug": "strings", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Matching an existing array with `'like'`", "summary": "Preallocate string arrays filled with empty text scalars using MATLAB-compatible size syntax.", "code": "proto = zeros(3, 2);\nlabels = strings(\"like\", proto)", "output": "labels = 3x2 string\n \"\" \"\"\n \"\" \"\"\n \"\" \"\"", "keywords": ["strings", "preallocate", "string array", "empty strings", "missing", "like", "gpu"], "suggestedPath": "/strings-7.m" }, { "id": "strings:8", "builtinKey": "strings", "builtinTitle": "strings", "builtinSlug": "strings", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Validating size inputs", "summary": "Preallocate string arrays filled with empty text scalars using MATLAB-compatible size syntax.", "code": "try\n strings(-3);\ncatch ME\n disp(ME.message)\nend", "output": "Error using strings\nSize inputs must be nonnegative integers.", "keywords": ["strings", "preallocate", "string array", "empty strings", "missing", "like", "gpu"], "suggestedPath": "/strings-8.m" }, { "id": "strip:1", "builtinKey": "strip", "builtinTitle": "strip", "builtinSlug": "strip", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Remove Leading And Trailing Spaces From A String Scalar", "summary": "Remove leading and trailing characters from strings, character arrays, and cell arrays.", "code": "name = \" RunMat \";\nclean = strip(name)", "output": "clean = \"RunMat\"", "keywords": ["strip", "trim", "whitespace", "leading characters", "trailing characters", "character arrays"], "suggestedPath": "/strip-1.m" }, { "id": "strip:2", "builtinKey": "strip", "builtinTitle": "strip", "builtinSlug": "strip", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Trim Only The Right Side Of Each String", "summary": "Remove leading and trailing characters from strings, character arrays, and cell arrays.", "code": "labels = [\" Alpha \"; \" Beta \"; \" Gamma \"];\nright_stripped = strip(labels, 'right')", "output": "right_stripped = 3×1 string\n \" Alpha\"\n \" Beta\"\n \" Gamma\"", "keywords": ["strip", "trim", "whitespace", "leading characters", "trailing characters", "character arrays"], "suggestedPath": "/strip-2.m" }, { "id": "strip:3", "builtinKey": "strip", "builtinTitle": "strip", "builtinSlug": "strip", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Remove Leading Zeros While Preserving Trailing Digits", "summary": "Remove leading and trailing characters from strings, character arrays, and cell arrays.", "code": "codes = [\"00095\"; \"00137\"; \"00420\"];\nnumeric = strip(codes, 'left', '0')", "output": "numeric = 3×1 string\n \"95\"\n \"137\"\n \"420\"", "keywords": ["strip", "trim", "whitespace", "leading characters", "trailing characters", "character arrays"], "suggestedPath": "/strip-3.m" }, { "id": "strip:4", "builtinKey": "strip", "builtinTitle": "strip", "builtinSlug": "strip", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Strip Character Arrays And Preserve Rectangular Shape", "summary": "Remove leading and trailing characters from strings, character arrays, and cell arrays.", "code": "animals = char(\" cat \", \" dog\", \"cow \");\ntrimmed = strip(animals)", "output": "trimmed =\n\n 3×4 char array\n\n 'cat '\n 'dog '\n 'cow '", "keywords": ["strip", "trim", "whitespace", "leading characters", "trailing characters", "character arrays"], "suggestedPath": "/strip-4.m" }, { "id": "strip:5", "builtinKey": "strip", "builtinTitle": "strip", "builtinSlug": "strip", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Supply Per-Element Characters To Remove", "summary": "Remove leading and trailing characters from strings, character arrays, and cell arrays.", "code": "metrics = [\"##pass##\", \"--warn--\", \"**fail**\"];\nper_char = [\"#\"; \"-\"; \"*\"];\nnormalized = strip(metrics, 'both', per_char)", "output": "normalized = 3×1 string\n \"pass\"\n \"warn\"\n \"fail\"", "keywords": ["strip", "trim", "whitespace", "leading characters", "trailing characters", "character arrays"], "suggestedPath": "/strip-5.m" }, { "id": "strip:6", "builtinKey": "strip", "builtinTitle": "strip", "builtinSlug": "strip", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Trim Cell Array Elements With Mixed Types", "summary": "Remove leading and trailing characters from strings, character arrays, and cell arrays.", "code": "pieces = {' GPU ', \" Accelerate\", 'RunMat '};\nout = strip(pieces)", "output": "out = 1×3 cell array\n {'GPU'} {\"Accelerate\"} {'RunMat'}", "keywords": ["strip", "trim", "whitespace", "leading characters", "trailing characters", "character arrays"], "suggestedPath": "/strip-6.m" }, { "id": "strlength:1", "builtinKey": "strlength", "builtinTitle": "strlength", "builtinSlug": "strlength", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Measure Characters In A String Scalar", "summary": "Return the number of characters in each element of a string array, character array, or cell array of character vectors.", "code": "len = strlength(\"RunMat\")", "output": "len = 6", "keywords": ["strlength", "string length", "character count", "text analytics", "cell array"], "suggestedPath": "/strlength-1.m" }, { "id": "strlength:2", "builtinKey": "strlength", "builtinTitle": "strlength", "builtinSlug": "strlength", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Count Characters Across A String Array", "summary": "Return the number of characters in each element of a string array, character array, or cell array of character vectors.", "code": "labels = [\"North\" \"South\" \"East\" \"West\"];\ncounts = strlength(labels)", "output": "counts = 1×4\n 5 5 4 4", "keywords": ["strlength", "string length", "character count", "text analytics", "cell array"], "suggestedPath": "/strlength-2.m" }, { "id": "strlength:3", "builtinKey": "strlength", "builtinTitle": "strlength", "builtinSlug": "strlength", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Compute Lengths For Each Row Of A Character Array", "summary": "Return the number of characters in each element of a string array, character array, or cell array of character vectors.", "code": "names = char(\"cat\", \"giraffe\");\nrow_counts = strlength(names)", "output": "row_counts = 2×1\n 3\n 7", "keywords": ["strlength", "string length", "character count", "text analytics", "cell array"], "suggestedPath": "/strlength-3.m" }, { "id": "strlength:4", "builtinKey": "strlength", "builtinTitle": "strlength", "builtinSlug": "strlength", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Handle Empty And Blank Strings", "summary": "Return the number of characters in each element of a string array, character array, or cell array of character vectors.", "code": "mixed = [\"\", \" \"];\nlen = strlength(mixed)", "output": "len = 1×2\n 0 3", "keywords": ["strlength", "string length", "character count", "text analytics", "cell array"], "suggestedPath": "/strlength-4.m" }, { "id": "strlength:5", "builtinKey": "strlength", "builtinTitle": "strlength", "builtinSlug": "strlength", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Get Lengths From A Cell Array Of Character Vectors", "summary": "Return the number of characters in each element of a string array, character array, or cell array of character vectors.", "code": "C = {'red', 'green', 'blue'};\nL = strlength(C)", "output": "L = 1×3\n 3 5 4", "keywords": ["strlength", "string length", "character count", "text analytics", "cell array"], "suggestedPath": "/strlength-5.m" }, { "id": "strlength:6", "builtinKey": "strlength", "builtinTitle": "strlength", "builtinSlug": "strlength", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Treat Missing Strings As NaN", "summary": "Return the number of characters in each element of a string array, character array, or cell array of character vectors.", "code": "values = string([\"alpha\" \"beta\" \"gamma\"]);\nvalues(2) = string(missing); % Displays as <missing> when printed\nlengths = strlength(values)", "output": "lengths = 1×3\n 5 NaN 5", "keywords": ["strlength", "string length", "character count", "text analytics", "cell array"], "suggestedPath": "/strlength-6.m" }, { "id": "strncmp:1", "builtinKey": "strncmp", "builtinTitle": "strncmp", "builtinSlug": "strncmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Checking whether two strings share a prefix", "summary": "Compare text inputs for equality up to N leading characters with MATLAB-compatible broadcasting.", "code": "tf = strncmp(\"RunMat\", \"Runway\", 3)", "output": "tf = logical\n 1", "keywords": ["strncmp", "string compare", "prefix", "text equality", "case-sensitive"], "suggestedPath": "/strncmp-1.m" }, { "id": "strncmp:2", "builtinKey": "strncmp", "builtinTitle": "strncmp", "builtinSlug": "strncmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Comparing string arrays with implicit expansion", "summary": "Compare text inputs for equality up to N leading characters with MATLAB-compatible broadcasting.", "code": "names = [\"north\" \"south\" \"east\"];\ntf = strncmp(names, \"no\", 2)", "output": "tf = 1×3 logical array\n 1 0 0", "keywords": ["strncmp", "string compare", "prefix", "text equality", "case-sensitive"], "suggestedPath": "/strncmp-2.m" }, { "id": "strncmp:3", "builtinKey": "strncmp", "builtinTitle": "strncmp", "builtinSlug": "strncmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Comparing rows of a character array", "summary": "Compare text inputs for equality up to N leading characters with MATLAB-compatible broadcasting.", "code": "animals = char(\"cat\", \"camel\", \"cow\");\ntf = strncmp(animals, \"ca\", 2)", "output": "tf = 3×1 logical array\n 1\n 1\n 0", "keywords": ["strncmp", "string compare", "prefix", "text equality", "case-sensitive"], "suggestedPath": "/strncmp-3.m" }, { "id": "strncmp:4", "builtinKey": "strncmp", "builtinTitle": "strncmp", "builtinSlug": "strncmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Comparing cell arrays element-wise", "summary": "Compare text inputs for equality up to N leading characters with MATLAB-compatible broadcasting.", "code": "C1 = {'red', 'green', 'blue'};\nC2 = {'rose', 'grey', 'black'};\ntf = strncmp(C1, C2, 2)", "output": "tf = 1×3 logical array\n 1 0 0", "keywords": ["strncmp", "string compare", "prefix", "text equality", "case-sensitive"], "suggestedPath": "/strncmp-4.m" }, { "id": "strncmp:5", "builtinKey": "strncmp", "builtinTitle": "strncmp", "builtinSlug": "strncmp", "category": "strings/core", "categoryPath": ["strings", "core"], "exampleTitle": "Handling zero-length comparisons", "summary": "Compare text inputs for equality up to N leading characters with MATLAB-compatible broadcasting.", "code": "tf = strncmp(\"alpha\", \"omega\", 0)", "output": "tf = logical\n 1", "keywords": ["strncmp", "string compare", "prefix", "text equality", "case-sensitive"], "suggestedPath": "/strncmp-5.m" }, { "id": "strrep:1", "builtinKey": "strrep", "builtinTitle": "strrep", "builtinSlug": "strrep", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Replacing a word inside a string scalar", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays while mirroring MATLAB semantics.", "code": "txt = \"RunMat turbo mode\";\nresult = strrep(txt, \"turbo\", \"accelerate\")", "output": "result = \"RunMat accelerate mode\"", "keywords": ["strrep", "string replace", "character array replace", "text replacement", "substring replace"], "suggestedPath": "/strrep-1.m" }, { "id": "strrep:2", "builtinKey": "strrep", "builtinTitle": "strrep", "builtinSlug": "strrep", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Updating every element of a string array", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays while mirroring MATLAB semantics.", "code": "labels = [\"GPU planner\", \"CPU planner\"];\nupdated = strrep(labels, \"planner\", \"pipeline\")", "output": "updated = 2×1 string\n \"GPU pipeline\"\n \"CPU pipeline\"", "keywords": ["strrep", "string replace", "character array replace", "text replacement", "substring replace"], "suggestedPath": "/strrep-2.m" }, { "id": "strrep:3", "builtinKey": "strrep", "builtinTitle": "strrep", "builtinSlug": "strrep", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Preserving rectangular shape in character arrays", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays while mirroring MATLAB semantics.", "code": "chars = char(\"alpha\", \"beta \");\nout = strrep(chars, \"a\", \"A\")", "output": "out =\n\n 2×5 char array\n\n 'AlphA'\n 'betA '", "keywords": ["strrep", "string replace", "character array replace", "text replacement", "substring replace"], "suggestedPath": "/strrep-3.m" }, { "id": "strrep:4", "builtinKey": "strrep", "builtinTitle": "strrep", "builtinSlug": "strrep", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Applying replacements inside a cell array of character vectors", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays while mirroring MATLAB semantics.", "code": "C = {'Kernel Fusion', 'GPU Planner'};\nrenamed = strrep(C, ' ', '_')", "output": "renamed = 1×2 cell array\n {'Kernel_Fusion'} {'GPU_Planner'}", "keywords": ["strrep", "string replace", "character array replace", "text replacement", "substring replace"], "suggestedPath": "/strrep-4.m" }, { "id": "strrep:5", "builtinKey": "strrep", "builtinTitle": "strrep", "builtinSlug": "strrep", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Inserting text with an empty search pattern", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays while mirroring MATLAB semantics.", "code": "stub = \"abc\";\nexpanded = strrep(stub, \"\", \"-\")", "output": "expanded = \"-a-b-c-\"", "keywords": ["strrep", "string replace", "character array replace", "text replacement", "substring replace"], "suggestedPath": "/strrep-5.m" }, { "id": "strrep:6", "builtinKey": "strrep", "builtinTitle": "strrep", "builtinSlug": "strrep", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Leaving missing string values untouched", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays while mirroring MATLAB semantics.", "code": "vals = [\"RunMat\", \"<missing>\", \"Accelerate\"];\nout = strrep(vals, \"RunMat\", \"RUNMAT\")", "output": "out = 1×3 string\n \"RUNMAT\" <missing> \"Accelerate\"", "keywords": ["strrep", "string replace", "character array replace", "text replacement", "substring replace"], "suggestedPath": "/strrep-6.m" }, { "id": "strrep:7", "builtinKey": "strrep", "builtinTitle": "strrep", "builtinSlug": "strrep", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Replacing substrings gathered from GPU inputs", "summary": "Replace substring occurrences in strings, character arrays, and cell arrays while mirroring MATLAB semantics.", "code": "g = gpuArray(\"Turbine\");\nhost = strrep(g, \"bine\", \"bo\")", "output": "host = \"Turbo\"", "keywords": ["strrep", "string replace", "character array replace", "text replacement", "substring replace"], "suggestedPath": "/strrep-7.m" }, { "id": "strtrim:1", "builtinKey": "strtrim", "builtinTitle": "strtrim", "builtinSlug": "strtrim", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Trim Leading And Trailing Spaces From A String Scalar", "summary": "Remove leading and trailing whitespace from strings, character arrays, and cell arrays.", "code": "name = \" RunMat \";\nclean = strtrim(name)", "output": "clean = \"RunMat\"", "keywords": ["strtrim", "trim whitespace", "leading spaces", "trailing spaces", "character arrays", "string arrays"], "suggestedPath": "/strtrim-1.m" }, { "id": "strtrim:2", "builtinKey": "strtrim", "builtinTitle": "strtrim", "builtinSlug": "strtrim", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Remove Extra Whitespace From Each Element Of A String Array", "summary": "Remove leading and trailing whitespace from strings, character arrays, and cell arrays.", "code": "labels = [\" Alpha \"; \"Beta \"; \" Gamma\"];\ntrimmed = strtrim(labels)", "output": "trimmed = 3×1 string\n \"Alpha\"\n \"Beta\"\n \"Gamma\"", "keywords": ["strtrim", "trim whitespace", "leading spaces", "trailing spaces", "character arrays", "string arrays"], "suggestedPath": "/strtrim-2.m" }, { "id": "strtrim:3", "builtinKey": "strtrim", "builtinTitle": "strtrim", "builtinSlug": "strtrim", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Trim Character Array Rows While Preserving Shape", "summary": "Remove leading and trailing whitespace from strings, character arrays, and cell arrays.", "code": "animals = char(' cat ', 'dog', ' cow ');\nresult = strtrim(animals)", "output": "result =\n\n 3×3 char array\n\n 'cat'\n 'dog'\n 'cow'", "keywords": ["strtrim", "trim whitespace", "leading spaces", "trailing spaces", "character arrays", "string arrays"], "suggestedPath": "/strtrim-3.m" }, { "id": "strtrim:4", "builtinKey": "strtrim", "builtinTitle": "strtrim", "builtinSlug": "strtrim", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Trim Tabs And Newlines Alongside Spaces", "summary": "Remove leading and trailing whitespace from strings, character arrays, and cell arrays.", "code": "text = \"\\tMetrics \" + newline;\nclean = strtrim(text)", "output": "clean = \"Metrics\"", "keywords": ["strtrim", "trim whitespace", "leading spaces", "trailing spaces", "character arrays", "string arrays"], "suggestedPath": "/strtrim-4.m" }, { "id": "strtrim:5", "builtinKey": "strtrim", "builtinTitle": "strtrim", "builtinSlug": "strtrim", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Trim Each Element Of A Cell Array Of Character Vectors", "summary": "Remove leading and trailing whitespace from strings, character arrays, and cell arrays.", "code": "pieces = {' GPU ', \" Accelerate\", 'RunMat '};\nout = strtrim(pieces)", "output": "out = 1×3 cell array\n {'GPU'} {\"Accelerate\"} {'RunMat'}", "keywords": ["strtrim", "trim whitespace", "leading spaces", "trailing spaces", "character arrays", "string arrays"], "suggestedPath": "/strtrim-5.m" }, { "id": "strtrim:6", "builtinKey": "strtrim", "builtinTitle": "strtrim", "builtinSlug": "strtrim", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Preserve Missing String Scalars", "summary": "Remove leading and trailing whitespace from strings, character arrays, and cell arrays.", "code": "vals = [\" ok \"; \"<missing>\"; \" trimmed \"];\ntrimmed = strtrim(vals)", "output": "trimmed = 1×3 string\n \"ok\"\n <missing>\n \"trimmed\"", "keywords": ["strtrim", "trim whitespace", "leading spaces", "trailing spaces", "character arrays", "string arrays"], "suggestedPath": "/strtrim-6.m" }, { "id": "struct:1", "builtinKey": "struct", "builtinTitle": "struct", "builtinSlug": "struct", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Creating a simple structure for named fields", "summary": "Create scalar structs or struct arrays from name/value pairs.", "code": "s = struct(\"name\", \"Ada\", \"score\", 42);\ndisp(s.name);\ndisp(s.score)", "output": "Ada\n42", "keywords": ["struct", "structure", "name-value", "record", "struct array"], "suggestedPath": "/struct-1.m" }, { "id": "struct:2", "builtinKey": "struct", "builtinTitle": "struct", "builtinSlug": "struct", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Building a struct array from paired cell inputs", "summary": "Create scalar structs or struct arrays from name/value pairs.", "code": "names = {\"Ada\", \"Grace\"};\nages = {36, 45};\npeople = struct(\"name\", names, \"age\", ages);\n{people.name}", "output": " {'Ada'} {'Grace'}", "keywords": ["struct", "structure", "name-value", "record", "struct array"], "suggestedPath": "/struct-2.m" }, { "id": "struct:3", "builtinKey": "struct", "builtinTitle": "struct", "builtinSlug": "struct", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Broadcasting scalars across a struct array", "summary": "Create scalar structs or struct arrays from name/value pairs.", "code": "ids = struct(\"id\", {101, 102, 103}, \"department\", \"Research\");\n{ids.department}", "output": " {'Research'} {'Research'} {'Research'}", "keywords": ["struct", "structure", "name-value", "record", "struct array"], "suggestedPath": "/struct-3.m" }, { "id": "struct:4", "builtinKey": "struct", "builtinTitle": "struct", "builtinSlug": "struct", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Copying an existing structure", "summary": "Create scalar structs or struct arrays from name/value pairs.", "code": "a = struct(\"id\", 7, \"label\", \"demo\");\nb = struct(a);\nb.id = 8;\ndisp([a.id b.id])", "output": " 7 8", "keywords": ["struct", "structure", "name-value", "record", "struct array"], "suggestedPath": "/struct-4.m" }, { "id": "struct:5", "builtinKey": "struct", "builtinTitle": "struct", "builtinSlug": "struct", "category": "structs/core", "categoryPath": ["structs", "core"], "exampleTitle": "Building an empty struct array", "summary": "Create scalar structs or struct arrays from name/value pairs.", "code": "s = struct([]);\ndisp(size(s))", "output": " 0 0", "keywords": ["struct", "structure", "name-value", "record", "struct array"], "suggestedPath": "/struct-5.m" }, { "id": "sub2ind:1", "builtinKey": "sub2ind", "builtinTitle": "sub2ind", "builtinSlug": "sub2ind", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Converting a single matrix subscript to a linear index", "summary": "Convert N-D subscripts into MATLAB-style column-major linear indices.", "code": "idx = sub2ind([3 4], 2, 3)", "output": "idx = 8", "keywords": ["sub2ind", "linear index", "column major", "gpu indexing", "nd indexing"], "suggestedPath": "/sub2ind-1.m" }, { "id": "sub2ind:2", "builtinKey": "sub2ind", "builtinTitle": "sub2ind", "builtinSlug": "sub2ind", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Mapping multiple subscripts into one-dimensional indices", "summary": "Convert N-D subscripts into MATLAB-style column-major linear indices.", "code": "rows = [1; 2; 3];\ncols = [3; 3; 3];\nidx = sub2ind([3 5], rows, cols)", "output": "idx =\n 7\n 8\n 9", "keywords": ["sub2ind", "linear index", "column major", "gpu indexing", "nd indexing"], "suggestedPath": "/sub2ind-2.m" }, { "id": "sub2ind:3", "builtinKey": "sub2ind", "builtinTitle": "sub2ind", "builtinSlug": "sub2ind", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Handling higher-dimensional array subscripts", "summary": "Convert N-D subscripts into MATLAB-style column-major linear indices.", "code": "row = [1 1];\ncol = [2 3];\npage = [1 2];\nidx = sub2ind([2 3 4], row, col, page)", "output": "idx = [3 11]", "keywords": ["sub2ind", "linear index", "column major", "gpu indexing", "nd indexing"], "suggestedPath": "/sub2ind-3.m" }, { "id": "sub2ind:4", "builtinKey": "sub2ind", "builtinTitle": "sub2ind", "builtinSlug": "sub2ind", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Broadcasting scalar subscripts across array inputs", "summary": "Convert N-D subscripts into MATLAB-style column-major linear indices.", "code": "rows = [1 2 3];\nidx = sub2ind([3 4], rows, 4)", "output": "idx = [10 11 12]", "keywords": ["sub2ind", "linear index", "column major", "gpu indexing", "nd indexing"], "suggestedPath": "/sub2ind-4.m" }, { "id": "sub2ind:5", "builtinKey": "sub2ind", "builtinTitle": "sub2ind", "builtinSlug": "sub2ind", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Retaining GPU residency for batched index conversions", "summary": "Convert N-D subscripts into MATLAB-style column-major linear indices.", "code": "rows = gpuArray((1:100)');\ncols = gpuArray(ones(100, 1) * 4);\nidx = sub2ind([100 4], rows, cols)", "output": "% idx remains a gpuArray containing the column-major indices.\ndisp(gather(idx(1:5)));\n% Output:\n% 301\n% 302\n% 303\n% 304\n% 305", "keywords": ["sub2ind", "linear index", "column major", "gpu indexing", "nd indexing"], "suggestedPath": "/sub2ind-5.m" }, { "id": "sub2ind:6", "builtinKey": "sub2ind", "builtinTitle": "sub2ind", "builtinSlug": "sub2ind", "category": "array/indexing", "categoryPath": ["array", "indexing"], "exampleTitle": "Detecting invalid out-of-range subscripts", "summary": "Convert N-D subscripts into MATLAB-style column-major linear indices.", "code": "try\n idx = sub2ind([3 4], 4, 1);\ncatch ME\n disp(ME.message);\nend", "output": "Index exceeds the number of rows in dimension 1.", "keywords": ["sub2ind", "linear index", "column major", "gpu indexing", "nd indexing"], "suggestedPath": "/sub2ind-6.m" }, { "id": "subplot:1", "builtinKey": "subplot", "builtinTitle": "subplot", "builtinSlug": "subplot", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a 2x2 subplot layout", "summary": "Split a figure into subplot grids for multi-panel charts, side-by-side comparisons, and MATLAB `subplot` workflows.", "code": "subplot(2, 2, 1);\nplot(0:0.1:1, (0:0.1:1).^2);\nsubplot(2, 2, 2);\nscatter(1:5, [5 4 3 2 1]);", "keywords": ["subplot", "subplot grid", "multi-panel chart", "matlab subplot", "figure layout"], "suggestedPath": "/subplot-1.m" }, { "id": "subplot:2", "builtinKey": "subplot", "builtinTitle": "subplot", "builtinSlug": "subplot", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Capture and reuse an axes handle explicitly", "summary": "Split a figure into subplot grids for multi-panel charts, side-by-side comparisons, and MATLAB `subplot` workflows.", "code": "ax = subplot(1, 2, 2);\nplot(ax, 0:0.1:1, sin(0:0.1:1));\nget(ax, 'Type')", "output": "ans =\n 'axes'", "keywords": ["subplot", "subplot grid", "multi-panel chart", "matlab subplot", "figure layout"], "suggestedPath": "/subplot-2.m" }, { "id": "subplot:3", "builtinKey": "subplot", "builtinTitle": "subplot", "builtinSlug": "subplot", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Show that subplot-local state stays isolated", "summary": "Split a figure into subplot grids for multi-panel charts, side-by-side comparisons, and MATLAB `subplot` workflows.", "code": "subplot(1, 2, 1);\nsemilogx(logspace(0, 2, 50), logspace(0, 2, 50));\nsubplot(1, 2, 2);\nplot(1:5, 1:5);", "output": "% Only the first subplot uses a logarithmic x-axis", "keywords": ["subplot", "subplot grid", "multi-panel chart", "matlab subplot", "figure layout"], "suggestedPath": "/subplot-3.m" }, { "id": "sum:1", "builtinKey": "sum", "builtinTitle": "sum", "builtinSlug": "sum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Summing the elements of a matrix", "summary": "Sum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [1 2 3; 4 5 6];\ncolSums = sum(A);\nrowSums = sum(A, 2)", "output": "colSums = [5 7 9];\nrowSums = [6; 15]", "keywords": ["sum", "reduction", "omitnan", "gpu"], "suggestedPath": "/sum-1.m" }, { "id": "sum:2", "builtinKey": "sum", "builtinTitle": "sum", "builtinSlug": "sum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Summing across multiple dimensions", "summary": "Sum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "B = reshape(1:24, [3 4 2]);\ncollapse = sum(B, [1 3])", "output": "collapse = [48 66 84 102]", "keywords": ["sum", "reduction", "omitnan", "gpu"], "suggestedPath": "/sum-2.m" }, { "id": "sum:3", "builtinKey": "sum", "builtinTitle": "sum", "builtinSlug": "sum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Summing with NaN values ignored", "summary": "Sum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "values = [1 NaN 3];\ntotal = sum(values, 'omitnan')", "output": "total = 4", "keywords": ["sum", "reduction", "omitnan", "gpu"], "suggestedPath": "/sum-3.m" }, { "id": "sum:4", "builtinKey": "sum", "builtinTitle": "sum", "builtinSlug": "sum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Summing on the GPU and matching an existing prototype", "summary": "Sum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "proto = gpuArray.zeros(1, 1, 'single');\nresult = sum(gpuArray([1 2 3]), 'all', 'like', proto)", "output": "result =\n 1x1 gpuArray single\n 6", "keywords": ["sum", "reduction", "omitnan", "gpu"], "suggestedPath": "/sum-4.m" }, { "id": "sum:5", "builtinKey": "sum", "builtinTitle": "sum", "builtinSlug": "sum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Summing all elements of an array into a scalar", "summary": "Sum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "C = [1 2 3; 4 5 6];\ngrandTotal = sum(C, 'all')", "output": "grandTotal = 21", "keywords": ["sum", "reduction", "omitnan", "gpu"], "suggestedPath": "/sum-5.m" }, { "id": "sum:6", "builtinKey": "sum", "builtinTitle": "sum", "builtinSlug": "sum", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Summing with native output type", "summary": "Sum elements of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "ints = int32([100 200 300]);\ntotal = sum(ints, 'native')", "output": "total = int32(600)", "keywords": ["sum", "reduction", "omitnan", "gpu"], "suggestedPath": "/sum-6.m" }, { "id": "surf:1", "builtinKey": "surf", "builtinTitle": "surf", "builtinSlug": "surf", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a shaded surface from a height grid", "summary": "Create shaded 3-D surface plots from grids or mesh coordinates with GPU-backed rendering and MATLAB `surf` semantics.", "code": "[X, Y] = meshgrid(linspace(-2, 2, 80), linspace(-2, 2, 80));\nZ = sin(X.^2 + Y.^2) ./ (1 + X.^2 + Y.^2);\nsurf(X, Y, Z);", "keywords": ["surf", "surface plot", "3-D surface", "height map", "matlab surf", "gpu surface rendering"], "suggestedPath": "/surf-1.m" }, { "id": "surf:2", "builtinKey": "surf", "builtinTitle": "surf", "builtinSlug": "surf", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Pair surf with colormap, shading, and colorbar", "summary": "Create shaded 3-D surface plots from grids or mesh coordinates with GPU-backed rendering and MATLAB `surf` semantics.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 100), linspace(-3, 3, 100));\nZ = cos(X) .* sin(Y);\nsurf(X, Y, Z);\ncolormap('jet');\nshading interp;\ncolorbar;", "keywords": ["surf", "surface plot", "3-D surface", "height map", "matlab surf", "gpu surface rendering"], "suggestedPath": "/surf-2.m" }, { "id": "surf:3", "builtinKey": "surf", "builtinTitle": "surf", "builtinSlug": "surf", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Adjust camera state and z-axis labeling for a surface", "summary": "Create shaded 3-D surface plots from grids or mesh coordinates with GPU-backed rendering and MATLAB `surf` semantics.", "code": "[X, Y] = meshgrid(linspace(-2, 2, 60), linspace(-2, 2, 60));\nZ = X .* exp(-X.^2 - Y.^2);\nh = surf(X, Y, Z);\nzlabel('Height');\nview(45, 30);\nget(h, 'Type')", "output": "ans =\n 'surface'", "keywords": ["surf", "surface plot", "3-D surface", "height map", "matlab surf", "gpu surface rendering"], "suggestedPath": "/surf-3.m" }, { "id": "surfc:1", "builtinKey": "surfc", "builtinTitle": "surfc", "builtinSlug": "surfc", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a shaded surface with projected contour lines", "summary": "Create composite surface-and-contour plots for scalar fields with MATLAB `surfc` semantics and projected contour overlays.", "code": "[X, Y] = meshgrid(linspace(-2, 2, 60), linspace(-2, 2, 60));\nZ = X .* exp(-X.^2 - Y.^2);\nsurfc(X, Y, Z);", "keywords": ["surfc", "surface with contour", "composite surface plot", "projected contour overlay", "matlab surfc"], "suggestedPath": "/surfc-1.m" }, { "id": "surfc:2", "builtinKey": "surfc", "builtinTitle": "surfc", "builtinSlug": "surfc", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Style the composite with colormap and camera controls", "summary": "Create composite surface-and-contour plots for scalar fields with MATLAB `surfc` semantics and projected contour overlays.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 80), linspace(-3, 3, 80));\nZ = cos(X) .* sin(Y);\nh = surfc(X, Y, Z);\ncolormap('turbo');\ncolorbar;\nview(45, 25);", "keywords": ["surfc", "surface with contour", "composite surface plot", "projected contour overlay", "matlab surfc"], "suggestedPath": "/surfc-2.m" }, { "id": "surfc:3", "builtinKey": "surfc", "builtinTitle": "surfc", "builtinSlug": "surfc", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Inspect the returned primary surface handle", "summary": "Create composite surface-and-contour plots for scalar fields with MATLAB `surfc` semantics and projected contour overlays.", "code": "[X, Y] = meshgrid(1:20, 1:20);\nZ = X + Y;\nh = surfc(X, Y, Z);\nget(h, 'Type')", "output": "ans =\n 'surface'", "keywords": ["surfc", "surface with contour", "composite surface plot", "projected contour overlay", "matlab surfc"], "suggestedPath": "/surfc-3.m" }, { "id": "svd:1", "builtinKey": "svd", "builtinTitle": "svd", "builtinSlug": "svd", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Getting the singular values of a matrix", "summary": "Singular value decomposition with full, economy, and vectorised forms.", "code": "A = [1 2 3; 4 5 6; 7 8 9];\ns = svd(A)", "keywords": ["svd", "singular value decomposition", "linalg", "economy", "vector", "gpu"], "suggestedPath": "/svd-1.m" }, { "id": "svd:2", "builtinKey": "svd", "builtinTitle": "svd", "builtinSlug": "svd", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Full SVD and reconstruction of a square matrix", "summary": "Singular value decomposition with full, economy, and vectorised forms.", "code": "A = [3 1; 0 2];\n[U,S,V] = svd(A);\nA_recon = U * S * V'", "keywords": ["svd", "singular value decomposition", "linalg", "economy", "vector", "gpu"], "suggestedPath": "/svd-2.m" }, { "id": "svd:3", "builtinKey": "svd", "builtinTitle": "svd", "builtinSlug": "svd", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Economy-size SVD for a tall matrix", "summary": "Singular value decomposition with full, economy, and vectorised forms.", "code": "A = randn(6, 3);\n[U,S,V] = svd(A, 'econ');\nsize(U) % 6 x 3\nsize(S) % 3 x 3\nsize(V) % 3 x 3", "keywords": ["svd", "singular value decomposition", "linalg", "economy", "vector", "gpu"], "suggestedPath": "/svd-3.m" }, { "id": "svd:4", "builtinKey": "svd", "builtinTitle": "svd", "builtinSlug": "svd", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Economy-size SVD for a wide matrix", "summary": "Singular value decomposition with full, economy, and vectorised forms.", "code": "A = randn(3, 6);\n[U,S,V] = svd(A, 'econ');\nsize(U) % 3 x 3\nsize(S) % 3 x 6\nsize(V) % 6 x 6", "keywords": ["svd", "singular value decomposition", "linalg", "economy", "vector", "gpu"], "suggestedPath": "/svd-4.m" }, { "id": "svd:5", "builtinKey": "svd", "builtinTitle": "svd", "builtinSlug": "svd", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Requesting vector form of the singular values", "summary": "Singular value decomposition with full, economy, and vectorised forms.", "code": "A = [10 0; 0 1];\n[U,s,V] = svd(A, 'vector')", "keywords": ["svd", "singular value decomposition", "linalg", "economy", "vector", "gpu"], "suggestedPath": "/svd-5.m" }, { "id": "svd:6", "builtinKey": "svd", "builtinTitle": "svd", "builtinSlug": "svd", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Computing the SVD of a complex matrix", "summary": "Singular value decomposition with full, economy, and vectorised forms.", "code": "A = [1+2i, 2-1i; 0, 3i];\n[U,S,V] = svd(A)", "keywords": ["svd", "singular value decomposition", "linalg", "economy", "vector", "gpu"], "suggestedPath": "/svd-6.m" }, { "id": "svd:7", "builtinKey": "svd", "builtinTitle": "svd", "builtinSlug": "svd", "category": "math/linalg/factor", "categoryPath": ["math", "linalg", "factor"], "exampleTitle": "Running `svd` on a `gpuArray` (automatic host fallback today)", "summary": "Singular value decomposition with full, economy, and vectorised forms.", "code": "G = gpuArray(randn(128, 64));\ns = svd(G); % Values are gathered to host transparently", "keywords": ["svd", "singular value decomposition", "linalg", "economy", "vector", "gpu"], "suggestedPath": "/svd-7.m" }, { "id": "symrcm:1", "builtinKey": "symrcm", "builtinTitle": "symrcm", "builtinSlug": "symrcm", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Reducing bandwidth of a near-band matrix", "summary": "Compute the symmetric reverse Cuthill-McKee permutation that reduces matrix bandwidth.", "code": "A = [4 1 0 0 2;\n 1 4 1 0 0;\n 0 1 4 1 0;\n 0 0 1 4 1;\n 2 0 0 1 4];\nr = symrcm(A);\nB = A(r, r);\nbandwidth(A)\nbandwidth(B)", "keywords": ["symrcm", "reverse cuthill-mckee", "bandwidth reduction", "symmetric ordering", "permutation", "gpu"], "suggestedPath": "/symrcm-1.m" }, { "id": "symrcm:2", "builtinKey": "symrcm", "builtinTitle": "symrcm", "builtinSlug": "symrcm", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Handling disconnected components with `symrcm`", "summary": "Compute the symmetric reverse Cuthill-McKee permutation that reduces matrix bandwidth.", "code": "A = [1 1 0 0 0;\n 1 1 0 0 0;\n 0 0 1 0 1;\n 0 0 0 1 1;\n 0 0 1 1 1];\nr = symrcm(A);\nB = A(r, r)", "keywords": ["symrcm", "reverse cuthill-mckee", "bandwidth reduction", "symmetric ordering", "permutation", "gpu"], "suggestedPath": "/symrcm-2.m" }, { "id": "symrcm:3", "builtinKey": "symrcm", "builtinTitle": "symrcm", "builtinSlug": "symrcm", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Using `symrcm` with logical adjacency matrices", "summary": "Compute the symmetric reverse Cuthill-McKee permutation that reduces matrix bandwidth.", "code": "adj = logical([0 1 0 0;\n 1 0 1 0;\n 0 1 0 1;\n 0 0 1 0]);\nr = symrcm(adj)", "keywords": ["symrcm", "reverse cuthill-mckee", "bandwidth reduction", "symmetric ordering", "permutation", "gpu"], "suggestedPath": "/symrcm-3.m" }, { "id": "symrcm:4", "builtinKey": "symrcm", "builtinTitle": "symrcm", "builtinSlug": "symrcm", "category": "math/linalg/structure", "categoryPath": ["math", "linalg", "structure"], "exampleTitle": "Applying `symrcm` to GPU matrices", "summary": "Compute the symmetric reverse Cuthill-McKee permutation that reduces matrix bandwidth.", "code": "G = gpuArray([0 1 0 0 2;\n 1 0 1 0 0;\n 0 1 0 1 0;\n 0 0 1 0 1;\n 2 0 0 1 0]);\nr = symrcm(G);\nH = gather(G(r, r))", "keywords": ["symrcm", "reverse cuthill-mckee", "bandwidth reduction", "symmetric ordering", "permutation", "gpu"], "suggestedPath": "/symrcm-4.m" }, { "id": "tan:1", "builtinKey": "tan", "builtinTitle": "tan", "builtinSlug": "tan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Getting the tangent of 45 degrees expressed in radians", "summary": "Element-wise tangent for scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "y = tan(pi/4)", "output": "y = 1", "keywords": ["tan", "tangent", "trigonometry", "radians", "gpu", "like"], "suggestedPath": "/tan-1.m" }, { "id": "tan:2", "builtinKey": "tan", "builtinTitle": "tan", "builtinSlug": "tan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Applying tangent to a vector of sample angles", "summary": "Element-wise tangent for scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "theta = linspace(-pi/2 + 0.1, pi/2 - 0.1, 5);\nwave = tan(theta)", "output": "wave = [-9.9666 -0.9047 0 0.9047 9.9666]", "keywords": ["tan", "tangent", "trigonometry", "radians", "gpu", "like"], "suggestedPath": "/tan-2.m" }, { "id": "tan:3", "builtinKey": "tan", "builtinTitle": "tan", "builtinSlug": "tan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Evaluating the tangent of a matrix on the GPU", "summary": "Element-wise tangent for scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "G = gpuArray([0 pi/6; pi/4 pi/3]);\nT = tan(G);\nresult = gather(T)", "output": "result =\n 0 0.5774\n 1.0000 1.7321", "keywords": ["tan", "tangent", "trigonometry", "radians", "gpu", "like"], "suggestedPath": "/tan-3.m" }, { "id": "tan:4", "builtinKey": "tan", "builtinTitle": "tan", "builtinSlug": "tan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing the tangent of complex angles", "summary": "Element-wise tangent for scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "z = 1 + 0.5i;\ntz = tan(z)", "output": "tz = 0.9654 + 0.2718i", "keywords": ["tan", "tangent", "trigonometry", "radians", "gpu", "like"], "suggestedPath": "/tan-4.m" }, { "id": "tan:5", "builtinKey": "tan", "builtinTitle": "tan", "builtinSlug": "tan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Using tangent to linearise small-angle approximations", "summary": "Element-wise tangent for scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "eps = [-1e-6 0 1e-6];\napprox = tan(eps)", "output": "approx = [-1.0000e-06 0 1.0000e-06]", "keywords": ["tan", "tangent", "trigonometry", "radians", "gpu", "like"], "suggestedPath": "/tan-5.m" }, { "id": "tan:6", "builtinKey": "tan", "builtinTitle": "tan", "builtinSlug": "tan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Converting degrees to radians before using `tan`", "summary": "Element-wise tangent for scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "angles_in_deg = [0 30 60 89];\nradians = deg2rad(angles_in_deg);\nresult = tan(radians)", "output": "result = [0 0.5774 1.7321 57.2899]", "keywords": ["tan", "tangent", "trigonometry", "radians", "gpu", "like"], "suggestedPath": "/tan-6.m" }, { "id": "tan:7", "builtinKey": "tan", "builtinTitle": "tan", "builtinSlug": "tan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Keeping the result on the GPU with `'like'`", "summary": "Element-wise tangent for scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "proto = gpuArray.zeros(1, 1, 'single');\nangles = gpuArray([0 pi/6 pi/4]);\ndeviceResult = tan(angles, 'like', proto);\ngathered = gather(deviceResult)", "output": "gathered =\n 1x3 single\n 0 0.5774 1.0000", "keywords": ["tan", "tangent", "trigonometry", "radians", "gpu", "like"], "suggestedPath": "/tan-7.m" }, { "id": "tan:8", "builtinKey": "tan", "builtinTitle": "tan", "builtinSlug": "tan", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Inspecting character codes with tangent", "summary": "Element-wise tangent for scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "codes = tan('ABC')", "output": "codes =\n -1.4700 0.0266 1.6523", "keywords": ["tan", "tangent", "trigonometry", "radians", "gpu", "like"], "suggestedPath": "/tan-8.m" }, { "id": "tanh:1", "builtinKey": "tanh", "builtinTitle": "tanh", "builtinSlug": "tanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Hyperbolic tangent of a real scalar", "summary": "Hyperbolic tangent of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "y = tanh(1)", "output": "y = 0.7616", "keywords": ["tanh", "hyperbolic tangent", "trigonometry", "gpu", "elementwise"], "suggestedPath": "/tanh-1.m" }, { "id": "tanh:2", "builtinKey": "tanh", "builtinTitle": "tanh", "builtinSlug": "tanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Applying `tanh` to a symmetric vector", "summary": "Hyperbolic tangent of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "x = linspace(-2, 2, 5);\ny = tanh(x)", "output": "y = [-0.9640 -0.7616 0 0.7616 0.9640]", "keywords": ["tanh", "hyperbolic tangent", "trigonometry", "gpu", "elementwise"], "suggestedPath": "/tanh-2.m" }, { "id": "tanh:3", "builtinKey": "tanh", "builtinTitle": "tanh", "builtinSlug": "tanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Evaluating `tanh` on a matrix in GPU memory", "summary": "Hyperbolic tangent of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "G = gpuArray([0 0.5; 1.0 1.5]);\nresult_gpu = tanh(G);\nresult = gather(result_gpu)", "output": "result =\n 0 0.4621\n 0.7616 0.9051", "keywords": ["tanh", "hyperbolic tangent", "trigonometry", "gpu", "elementwise"], "suggestedPath": "/tanh-3.m" }, { "id": "tanh:4", "builtinKey": "tanh", "builtinTitle": "tanh", "builtinSlug": "tanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Computing `tanh` for complex angles", "summary": "Hyperbolic tangent of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "z = 0.5 + 1.0i;\nw = tanh(z)", "output": "w = 1.0428 + 0.8069i", "keywords": ["tanh", "hyperbolic tangent", "trigonometry", "gpu", "elementwise"], "suggestedPath": "/tanh-4.m" }, { "id": "tanh:5", "builtinKey": "tanh", "builtinTitle": "tanh", "builtinSlug": "tanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Converting character codes via `tanh`", "summary": "Hyperbolic tangent of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "c = tanh('ABC')", "output": "c = [1.0000 1.0000 1.0000]", "keywords": ["tanh", "hyperbolic tangent", "trigonometry", "gpu", "elementwise"], "suggestedPath": "/tanh-5.m" }, { "id": "tanh:6", "builtinKey": "tanh", "builtinTitle": "tanh", "builtinSlug": "tanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Preserving empty array shapes", "summary": "Hyperbolic tangent of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "E = zeros(0, 3);\nout = tanh(E)", "output": "out = zeros(0, 3)", "keywords": ["tanh", "hyperbolic tangent", "trigonometry", "gpu", "elementwise"], "suggestedPath": "/tanh-6.m" }, { "id": "tanh:7", "builtinKey": "tanh", "builtinTitle": "tanh", "builtinSlug": "tanh", "category": "math/trigonometry", "categoryPath": ["math", "trigonometry"], "exampleTitle": "Stabilising activation functions", "summary": "Hyperbolic tangent of scalars, vectors, matrices, complex numbers, or character arrays with MATLAB broadcasting and GPU acceleration.", "code": "inputs = [-3 -1 0 1 3];\nactivations = tanh(inputs / 2)", "output": "activations = [-0.9051 -0.4621 0 0.4621 0.9051]", "keywords": ["tanh", "hyperbolic tangent", "trigonometry", "gpu", "elementwise"], "suggestedPath": "/tanh-7.m" }, { "id": "tcpclient:1", "builtinKey": "tcpclient", "builtinTitle": "tcpclient", "builtinSlug": "tcpclient", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Connecting to a loopback server for local testing", "summary": "Open a TCP client socket that connects to MATLAB-compatible servers.", "code": "client = tcpclient(\"127.0.0.1\", 55000);\ndisp(client.Address)\ndisp(client.Port)", "output": "127.0.0.1\n55000", "keywords": ["tcpclient", "tcp", "socket", "networking", "client"], "suggestedPath": "/tcpclient-1.m" }, { "id": "tcpclient:2", "builtinKey": "tcpclient", "builtinTitle": "tcpclient", "builtinSlug": "tcpclient", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Customizing tcpclient timeouts and byte order", "summary": "Open a TCP client socket that connects to MATLAB-compatible servers.", "code": "client = tcpclient(\"localhost\", 60000, \"Timeout\", 5, \"ConnectTimeout\", 2, \"ByteOrder\", \"big-endian\");\ndisp(client.Timeout)\ndisp(client.ConnectTimeout)\ndisp(client.ByteOrder)", "output": "5\n2\nbig-endian", "keywords": ["tcpclient", "tcp", "socket", "networking", "client"], "suggestedPath": "/tcpclient-2.m" }, { "id": "tcpclient:3", "builtinKey": "tcpclient", "builtinTitle": "tcpclient", "builtinSlug": "tcpclient", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Storing session metadata in `UserData`", "summary": "Open a TCP client socket that connects to MATLAB-compatible servers.", "code": "meta = struct(\"session\", \"demo\", \"started\", \"2024-01-01T00:00:00Z\");\nclient = tcpclient(\"example.com\", 80, \"UserData\", meta);\ndisp(client.UserData.session)", "output": "demo", "keywords": ["tcpclient", "tcp", "socket", "networking", "client"], "suggestedPath": "/tcpclient-3.m" }, { "id": "tcpclient:4", "builtinKey": "tcpclient", "builtinTitle": "tcpclient", "builtinSlug": "tcpclient", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Detecting connection failures with a shorter connect timeout", "summary": "Open a TCP client socket that connects to MATLAB-compatible servers.", "code": "try\n client = tcpclient(\"192.0.2.20\", 65530, \"ConnectTimeout\", 0.2);\ncatch err\n disp(err.identifier)\nend", "output": "RunMat:tcpclient:ConnectionFailed", "keywords": ["tcpclient", "tcp", "socket", "networking", "client"], "suggestedPath": "/tcpclient-4.m" }, { "id": "tcpclient:5", "builtinKey": "tcpclient", "builtinTitle": "tcpclient", "builtinSlug": "tcpclient", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Keeping a streaming connection open with infinite timeouts", "summary": "Open a TCP client socket that connects to MATLAB-compatible servers.", "code": "client = tcpclient(\"data.example.com\", 50000, \"Timeout\", inf, \"ConnectTimeout\", inf);\ndisp(client.Timeout)\ndisp(client.ConnectTimeout)", "output": "Inf\nInf", "keywords": ["tcpclient", "tcp", "socket", "networking", "client"], "suggestedPath": "/tcpclient-5.m" }, { "id": "tcpserver:1", "builtinKey": "tcpserver", "builtinTitle": "tcpserver", "builtinSlug": "tcpserver", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Creating a loopback TCP server on a fixed port", "summary": "Create a TCP server that listens for MATLAB-compatible client connections.", "code": "srv = tcpserver(\"127.0.0.1\", 55000);\ndisp(srv.ServerAddress)\ndisp(srv.ServerPort)", "output": "127.0.0.1\n55000", "keywords": ["tcpserver", "tcp", "socket", "networking", "server", "loopback"], "suggestedPath": "/tcpserver-1.m" }, { "id": "tcpserver:2", "builtinKey": "tcpserver", "builtinTitle": "tcpserver", "builtinSlug": "tcpserver", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Requesting an ephemeral port and inspecting the assigned value", "summary": "Create a TCP server that listens for MATLAB-compatible client connections.", "code": "srv = tcpserver(\"0.0.0.0\", 0);\nfprintf(\"Listening on %s:%d\\n\", srv.ServerAddress, srv.ServerPort)", "output": "Listening on 0.0.0.0:54873 % actual port varies by run", "keywords": ["tcpserver", "tcp", "socket", "networking", "server", "loopback"], "suggestedPath": "/tcpserver-2.m" }, { "id": "tcpserver:3", "builtinKey": "tcpserver", "builtinTitle": "tcpserver", "builtinSlug": "tcpserver", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Configuring the timeout and storing metadata in UserData", "summary": "Create a TCP server that listens for MATLAB-compatible client connections.", "code": "srv = tcpserver(\"localhost\", 60000, \"Timeout\", 5, \"UserData\", struct(\"name\", \"demo\"));\ndisp(srv.Timeout)\ndisp(srv.UserData.name)", "output": "5\ndemo", "keywords": ["tcpserver", "tcp", "socket", "networking", "server", "loopback"], "suggestedPath": "/tcpserver-3.m" }, { "id": "tcpserver:4", "builtinKey": "tcpserver", "builtinTitle": "tcpserver", "builtinSlug": "tcpserver", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Assigning a custom server name", "summary": "Create a TCP server that listens for MATLAB-compatible client connections.", "code": "srv = tcpserver(\"::1\", 45000, \"Name\", \"LoopbackServer\");\ndisp(srv.Name)", "output": "LoopbackServer", "keywords": ["tcpserver", "tcp", "socket", "networking", "server", "loopback"], "suggestedPath": "/tcpserver-4.m" }, { "id": "tcpserver:5", "builtinKey": "tcpserver", "builtinTitle": "tcpserver", "builtinSlug": "tcpserver", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Selecting big-endian byte order for binary protocols", "summary": "Create a TCP server that listens for MATLAB-compatible client connections.", "code": "srv = tcpserver(\"127.0.0.1\", 45001, \"ByteOrder\", \"big-endian\");\ndisp(srv.ByteOrder)", "output": "big-endian", "keywords": ["tcpserver", "tcp", "socket", "networking", "server", "loopback"], "suggestedPath": "/tcpserver-5.m" }, { "id": "tcpserver:6", "builtinKey": "tcpserver", "builtinTitle": "tcpserver", "builtinSlug": "tcpserver", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Handling invalid ports with MATLAB-style diagnostics", "summary": "Create a TCP server that listens for MATLAB-compatible client connections.", "code": "try\n srv = tcpserver(\"127.0.0.1\", 99999);\ncatch err\n disp(err.identifier)\n disp(err.message)\nend", "output": "RunMat:tcpserver:InvalidPort\nRunMat:tcpserver:InvalidPort: tcpserver: port 99999 is outside the valid range 0–65535", "keywords": ["tcpserver", "tcp", "socket", "networking", "server", "loopback"], "suggestedPath": "/tcpserver-6.m" }, { "id": "tempdir:1", "builtinKey": "tempdir", "builtinTitle": "tempdir", "builtinSlug": "tempdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Get The System Temporary Folder Path", "summary": "Return the absolute path to the system temporary folder with a trailing file separator.", "code": "folder = tempdir();\ndisp(folder)", "output": "/tmp/", "keywords": ["tempdir", "temporary folder", "temp directory", "system temp", "temporary path"], "suggestedPath": "/tempdir-1.m" }, { "id": "tempdir:2", "builtinKey": "tempdir", "builtinTitle": "tempdir", "builtinSlug": "tempdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Combine `tempdir` With `tempname` To Build Unique Paths", "summary": "Return the absolute path to the system temporary folder with a trailing file separator.", "code": "uniqueFile = fullfile(tempdir(), \"runmat-session.log\");\nfid = fopen(uniqueFile, \"w\");\nfprintf(fid, \"Temporary log created at %s\\n\", datetime);\nfclose(fid)", "output": "% Creates runmat-session.log inside the system temporary folder", "keywords": ["tempdir", "temporary folder", "temp directory", "system temp", "temporary path"], "suggestedPath": "/tempdir-2.m" }, { "id": "tempdir:3", "builtinKey": "tempdir", "builtinTitle": "tempdir", "builtinSlug": "tempdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Create A Temporary Working Subfolder", "summary": "Return the absolute path to the system temporary folder with a trailing file separator.", "code": "workDir = fullfile(tempdir(), \"mytask\");\nif ~exist(workDir, \"dir\")\n mkdir(workDir);\nend\ndisp(workDir)", "output": "% Prints the path to tempdir/mytask and creates the folder if needed", "keywords": ["tempdir", "temporary folder", "temp directory", "system temp", "temporary path"], "suggestedPath": "/tempdir-3.m" }, { "id": "tempdir:4", "builtinKey": "tempdir", "builtinTitle": "tempdir", "builtinSlug": "tempdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Verify That `tempdir` Appends A File Separator", "summary": "Return the absolute path to the system temporary folder with a trailing file separator.", "code": "folder = tempdir();\nendsWithSeparator = folder(end) == filesep;\ndisp(endsWithSeparator)", "output": " 1", "keywords": ["tempdir", "temporary folder", "temp directory", "system temp", "temporary path"], "suggestedPath": "/tempdir-4.m" }, { "id": "tempdir:5", "builtinKey": "tempdir", "builtinTitle": "tempdir", "builtinSlug": "tempdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use `tempdir` When Creating Temporary Zip Archives", "summary": "Return the absolute path to the system temporary folder with a trailing file separator.", "code": "archive = fullfile(tempdir(), \"results.zip\");\nzip(archive, \"results\");\ndisp(archive)", "output": "% Displays the full path to results.zip inside the system temp folder", "keywords": ["tempdir", "temporary folder", "temp directory", "system temp", "temporary path"], "suggestedPath": "/tempdir-5.m" }, { "id": "tempdir:6", "builtinKey": "tempdir", "builtinTitle": "tempdir", "builtinSlug": "tempdir", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Log Temporary Folder Usage For Debugging", "summary": "Return the absolute path to the system temporary folder with a trailing file separator.", "code": "fprintf(\"RunMat temp folder: %s\\n\", tempdir())", "output": "% Prints something like:\n% RunMat temp folder: /tmp/", "keywords": ["tempdir", "temporary folder", "temp directory", "system temp", "temporary path"], "suggestedPath": "/tempdir-6.m" }, { "id": "tempname:1", "builtinKey": "tempname", "builtinTitle": "tempname", "builtinSlug": "tempname", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Generate A Unique Temporary File Name", "summary": "Return a unique temporary file path in the system temp folder or a user-specified directory.", "code": "fname = tempname();\nfprintf(\"Saving intermediate results to %s\\n\", fname)", "output": "% Prints the unique file name inside the system temporary folder.", "keywords": ["tempname", "temporary file", "unique name", "filesystem", "temp directory"], "suggestedPath": "/tempname-1.m" }, { "id": "tempname:2", "builtinKey": "tempname", "builtinTitle": "tempname", "builtinSlug": "tempname", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Create A Temporary File Name In A Custom Folder", "summary": "Return a unique temporary file path in the system temp folder or a user-specified directory.", "code": "logDir = fullfile(pwd(), \"logs\");\nfname = tempname(logDir)", "output": "% fname starts with the logs folder and ends with a tp******** token.", "keywords": ["tempname", "temporary file", "unique name", "filesystem", "temp directory"], "suggestedPath": "/tempname-2.m" }, { "id": "tempname:3", "builtinKey": "tempname", "builtinTitle": "tempname", "builtinSlug": "tempname", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Append A File Extension To Tempname Results", "summary": "Return a unique temporary file path in the system temp folder or a user-specified directory.", "code": "csvPath = [tempname(), \".csv\"]", "output": "% csvPath is a unique .csv file path you can pass to writematrix or fprintf.", "keywords": ["tempname", "temporary file", "unique name", "filesystem", "temp directory"], "suggestedPath": "/tempname-3.m" }, { "id": "tempname:4", "builtinKey": "tempname", "builtinTitle": "tempname", "builtinSlug": "tempname", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Reserve A Temporary Folder Path", "summary": "Return a unique temporary file path in the system temp folder or a user-specified directory.", "code": "scratch = tempname();\nmkdir(scratch);\ncleanupObj = onCleanup(@() rmdir(scratch, \"s\"))", "output": "% scratch now exists on disk and is removed automatically via onCleanup.", "keywords": ["tempname", "temporary file", "unique name", "filesystem", "temp directory"], "suggestedPath": "/tempname-4.m" }, { "id": "tempname:5", "builtinKey": "tempname", "builtinTitle": "tempname", "builtinSlug": "tempname", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Use Tempname With fopen To Write Temporary Data", "summary": "Return a unique temporary file path in the system temp folder or a user-specified directory.", "code": "tmpFile = tempname();\n[fid, message] = fopen(tmpFile, \"w\");\nif fid == -1\n error(\"Failed to open temp file: %s\", message);\nend\nfprintf(fid, \"Temporary output\\n\");\nfclose(fid)", "output": "% Creates a file, writes text, and leaves it for later processing.", "keywords": ["tempname", "temporary file", "unique name", "filesystem", "temp directory"], "suggestedPath": "/tempname-5.m" }, { "id": "tempname:6", "builtinKey": "tempname", "builtinTitle": "tempname", "builtinSlug": "tempname", "category": "io/repl_fs", "categoryPath": ["io", "repl_fs"], "exampleTitle": "Combine Tempname With gpuArray Inputs", "summary": "Return a unique temporary file path in the system temp folder or a user-specified directory.", "code": "folder = gpuArray(\"scratch\");\nfname = tempname(folder)", "output": "% RunMat gathers the string and returns a host-side character vector.", "keywords": ["tempname", "temporary file", "unique name", "filesystem", "temp directory"], "suggestedPath": "/tempname-6.m" }, { "id": "tic:1", "builtinKey": "tic", "builtinTitle": "tic", "builtinSlug": "tic", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Measuring a simple loop", "summary": "Start a high-resolution stopwatch and optionally return a handle for toc.", "code": "tic;\nfor k = 1:1e5\n sqrt(k);\nend\nelapsed = toc", "keywords": ["tic", "timer", "profile", "benchmark", "performance"], "suggestedPath": "/tic-1.m" }, { "id": "tic:2", "builtinKey": "tic", "builtinTitle": "tic", "builtinSlug": "tic", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Capturing and reusing the tic handle", "summary": "Start a high-resolution stopwatch and optionally return a handle for toc.", "code": "t = tic;\nheavyComputation();\nelapsed = toc(t)", "keywords": ["tic", "timer", "profile", "benchmark", "performance"], "suggestedPath": "/tic-2.m" }, { "id": "tic:3", "builtinKey": "tic", "builtinTitle": "tic", "builtinSlug": "tic", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Nesting timers for staged profiling", "summary": "Start a high-resolution stopwatch and optionally return a handle for toc.", "code": "tic; % Outer stopwatch\nstage1(); % Work you want to measure once\ninner = tic; % Nested stopwatch\nstage2();\ninnerT = toc(inner); % Elapsed time for stage2 only\nouterT = toc; % Elapsed time for everything since the first tic", "keywords": ["tic", "timer", "profile", "benchmark", "performance"], "suggestedPath": "/tic-3.m" }, { "id": "tic:4", "builtinKey": "tic", "builtinTitle": "tic", "builtinSlug": "tic", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Measuring asynchronous work", "summary": "Start a high-resolution stopwatch and optionally return a handle for toc.", "code": "token = tic;\nfuture = backgroundTask();\nwait(future);\nelapsed = toc(token)", "keywords": ["tic", "timer", "profile", "benchmark", "performance"], "suggestedPath": "/tic-4.m" }, { "id": "tic:5", "builtinKey": "tic", "builtinTitle": "tic", "builtinSlug": "tic", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Resetting the stopwatch after a measurement", "summary": "Start a high-resolution stopwatch and optionally return a handle for toc.", "code": "elapsed1 = toc(tic); % Equivalent to separate tic/toc calls\npause(0.1);\nelapsed2 = toc(tic); % Starts a new timer immediately", "keywords": ["tic", "timer", "profile", "benchmark", "performance"], "suggestedPath": "/tic-5.m" }, { "id": "timeit:1", "builtinKey": "timeit", "builtinTitle": "timeit", "builtinSlug": "timeit", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Timing a simple anonymous function", "summary": "Measure the execution time of a zero-argument function handle.", "code": "f = @() sin(rand(1000, 1));\nt = timeit(f)", "keywords": ["timeit", "benchmark", "timing", "performance", "gpu"], "suggestedPath": "/timeit-1.m" }, { "id": "timeit:2", "builtinKey": "timeit", "builtinTitle": "timeit", "builtinSlug": "timeit", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Comparing two implementations", "summary": "Measure the execution time of a zero-argument function handle.", "code": "A = rand(1e5, 1);\nslow = @() sum(A .* A);\nfast = @() sumsq(A);\n\nslowTime = timeit(slow);\nfastTime = timeit(fast)", "keywords": ["timeit", "benchmark", "timing", "performance", "gpu"], "suggestedPath": "/timeit-2.m" }, { "id": "timeit:3", "builtinKey": "timeit", "builtinTitle": "timeit", "builtinSlug": "timeit", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Timing a function that returns no outputs", "summary": "Measure the execution time of a zero-argument function handle.", "code": "logMessage = @() fprintf(\"Iteration complete\\n\");\nt = timeit(logMessage, 0)", "keywords": ["timeit", "benchmark", "timing", "performance", "gpu"], "suggestedPath": "/timeit-3.m" }, { "id": "timeit:4", "builtinKey": "timeit", "builtinTitle": "timeit", "builtinSlug": "timeit", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Timing a multiple-output function", "summary": "Measure the execution time of a zero-argument function handle.", "code": "svdTime = timeit(@() svd(rand(256)), 3)", "keywords": ["timeit", "benchmark", "timing", "performance", "gpu"], "suggestedPath": "/timeit-4.m" }, { "id": "timeit:5", "builtinKey": "timeit", "builtinTitle": "timeit", "builtinSlug": "timeit", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Measuring GPU-bound work", "summary": "Measure the execution time of a zero-argument function handle.", "code": "gfun = @() gather(sin(gpuArray.rand(4096, 1)));\ntgpu = timeit(gfun)", "keywords": ["timeit", "benchmark", "timing", "performance", "gpu"], "suggestedPath": "/timeit-5.m" }, { "id": "timeit:6", "builtinKey": "timeit", "builtinTitle": "timeit", "builtinSlug": "timeit", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Timing a preallocation helper", "summary": "Measure the execution time of a zero-argument function handle.", "code": "makeMatrix = @() zeros(2048, 2048);\nt = timeit(makeMatrix)", "keywords": ["timeit", "benchmark", "timing", "performance", "gpu"], "suggestedPath": "/timeit-6.m" }, { "id": "times:1", "builtinKey": "times", "builtinTitle": "times", "builtinSlug": "times", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Multiply two matrices element-wise", "summary": "Element-wise multiplication A .* B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "A = [1 2 3; 4 5 6];\nB = [7 8 9; 1 2 3];\nP = times(A, B)", "output": "P =\n 7 16 27\n 4 10 18", "keywords": ["times", "element-wise multiply", ".*", "gpu", "implicit expansion"], "suggestedPath": "/times-1.m" }, { "id": "times:2", "builtinKey": "times", "builtinTitle": "times", "builtinSlug": "times", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Scale a matrix by a scalar", "summary": "Element-wise multiplication A .* B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "A = magic(3);\nscaled = times(A, 0.5)", "output": "scaled =\n 4.5 0.5 3.5\n 1.5 5.0 9.0\n 8.0 6.5 2.0", "keywords": ["times", "element-wise multiply", ".*", "gpu", "implicit expansion"], "suggestedPath": "/times-2.m" }, { "id": "times:3", "builtinKey": "times", "builtinTitle": "times", "builtinSlug": "times", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Use implicit expansion between a column and row vector", "summary": "Element-wise multiplication A .* B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "col = (1:3)';\nrow = [10 20 30];\nm = times(col, row)", "output": "m =\n 10 20 30\n 20 40 60\n 30 60 90", "keywords": ["times", "element-wise multiply", ".*", "gpu", "implicit expansion"], "suggestedPath": "/times-3.m" }, { "id": "times:4", "builtinKey": "times", "builtinTitle": "times", "builtinSlug": "times", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Multiply complex inputs element-wise", "summary": "Element-wise multiplication A .* B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "z1 = [1+2i, 3-4i];\nz2 = [2-1i, -1+1i];\nprod = times(z1, z2)", "output": "prod =\n 4 + 3i 1 + 7i", "keywords": ["times", "element-wise multiply", ".*", "gpu", "implicit expansion"], "suggestedPath": "/times-4.m" }, { "id": "times:5", "builtinKey": "times", "builtinTitle": "times", "builtinSlug": "times", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Multiply character codes by a numeric scalar", "summary": "Element-wise multiplication A .* B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "letters = 'ABC';\ncodes = times(letters, 2)", "output": "codes = [130 132 134]", "keywords": ["times", "element-wise multiply", ".*", "gpu", "implicit expansion"], "suggestedPath": "/times-5.m" }, { "id": "times:6", "builtinKey": "times", "builtinTitle": "times", "builtinSlug": "times", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Execute `times` directly on gpuArray inputs", "summary": "Element-wise multiplication A .* B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "G1 = gpuArray([1 2 3]);\nG2 = gpuArray([4 5 6]);\ndeviceProd = times(G1, G2);\nresult = gather(deviceProd)", "output": "deviceProd =\n 1x3 gpuArray\n 4 10 18\nresult =\n 4 10 18", "keywords": ["times", "element-wise multiply", ".*", "gpu", "implicit expansion"], "suggestedPath": "/times-6.m" }, { "id": "times:7", "builtinKey": "times", "builtinTitle": "times", "builtinSlug": "times", "category": "math/elementwise", "categoryPath": ["math", "elementwise"], "exampleTitle": "Keep the result on the GPU with a `'like'` prototype", "summary": "Element-wise multiplication A .* B with MATLAB-compatible implicit expansion, complex support, and GPU fallbacks.", "code": "proto = gpuArray.zeros(1, 1);\nA = [1 2 3];\nB = [4 5 6];\nC = times(A, B, 'like', proto); % stays on the GPU for downstream work", "output": "C =\n 1x3 gpuArray\n 4 10 18", "keywords": ["times", "element-wise multiply", ".*", "gpu", "implicit expansion"], "suggestedPath": "/times-7.m" }, { "id": "toc:1", "builtinKey": "toc", "builtinTitle": "toc", "builtinSlug": "toc", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Measuring elapsed time since the last tic", "summary": "Read the elapsed time since the most recent tic or an explicit handle.", "code": "tic;\npause(0.25);\nelapsed = toc", "keywords": ["toc", "timer", "elapsed time", "profiling", "benchmark"], "suggestedPath": "/toc-1.m" }, { "id": "toc:2", "builtinKey": "toc", "builtinTitle": "toc", "builtinSlug": "toc", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Using toc with an explicit tic handle", "summary": "Read the elapsed time since the most recent tic or an explicit handle.", "code": "token = tic;\nheavyComputation();\nelapsed = toc(token)", "keywords": ["toc", "timer", "elapsed time", "profiling", "benchmark"], "suggestedPath": "/toc-2.m" }, { "id": "toc:3", "builtinKey": "toc", "builtinTitle": "toc", "builtinSlug": "toc", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Timing nested stages with toc", "summary": "Read the elapsed time since the most recent tic or an explicit handle.", "code": "tic; % Outer stopwatch\nstage1();\ninner = tic; % Nested stopwatch\nstage2();\nstage2Time = toc(inner);\ntotalTime = toc", "keywords": ["toc", "timer", "elapsed time", "profiling", "benchmark"], "suggestedPath": "/toc-3.m" }, { "id": "toc:4", "builtinKey": "toc", "builtinTitle": "toc", "builtinSlug": "toc", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Printing elapsed time without capturing output", "summary": "Read the elapsed time since the most recent tic or an explicit handle.", "code": "tic;\nlongRunningTask();\ntoc; % Displays the elapsed seconds because the result is not assigned", "keywords": ["toc", "timer", "elapsed time", "profiling", "benchmark"], "suggestedPath": "/toc-4.m" }, { "id": "toc:5", "builtinKey": "toc", "builtinTitle": "toc", "builtinSlug": "toc", "category": "timing", "categoryPath": ["timing"], "exampleTitle": "Measuring immediately with toc(tic)", "summary": "Read the elapsed time since the most recent tic or an explicit handle.", "code": "elapsed = toc(tic); % Starts a timer and reads it right away", "keywords": ["toc", "timer", "elapsed time", "profiling", "benchmark"], "suggestedPath": "/toc-5.m" }, { "id": "trace:1", "builtinKey": "trace", "builtinTitle": "trace", "builtinSlug": "trace", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Summing the diagonal of a square matrix", "summary": "Sum the diagonal elements of matrices and matrix-like tensors.", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nt = trace(A)", "output": "t = 15", "keywords": ["trace", "matrix trace", "diagonal sum", "gpu"], "suggestedPath": "/trace-1.m" }, { "id": "trace:2", "builtinKey": "trace", "builtinTitle": "trace", "builtinSlug": "trace", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Computing the trace of a rectangular matrix", "summary": "Sum the diagonal elements of matrices and matrix-like tensors.", "code": "B = [4 2; 1 3; 5 6];\nresult = trace(B)", "output": "result = 7", "keywords": ["trace", "matrix trace", "diagonal sum", "gpu"], "suggestedPath": "/trace-2.m" }, { "id": "trace:3", "builtinKey": "trace", "builtinTitle": "trace", "builtinSlug": "trace", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Getting the trace of a triangular matrix", "summary": "Sum the diagonal elements of matrices and matrix-like tensors.", "code": "U = [4 1 2; 0 5 3; 0 0 6];\ntri_trace = trace(U)", "output": "tri_trace = 15", "keywords": ["trace", "matrix trace", "diagonal sum", "gpu"], "suggestedPath": "/trace-3.m" }, { "id": "trace:4", "builtinKey": "trace", "builtinTitle": "trace", "builtinSlug": "trace", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Working with complex-valued matrices", "summary": "Sum the diagonal elements of matrices and matrix-like tensors.", "code": "Z = [1+2i 2; 3 4-5i];\nzTrace = trace(Z)", "output": "zTrace = 5.0000 - 3.0000i", "keywords": ["trace", "matrix trace", "diagonal sum", "gpu"], "suggestedPath": "/trace-4.m" }, { "id": "trace:5", "builtinKey": "trace", "builtinTitle": "trace", "builtinSlug": "trace", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Tracing a gpuArray without gathering", "summary": "Sum the diagonal elements of matrices and matrix-like tensors.", "code": "G = gpuArray(rand(1024));\ngpuResult = trace(G); % stays on the GPU\nscalarHost = gather(gpuResult)", "keywords": ["trace", "matrix trace", "diagonal sum", "gpu"], "suggestedPath": "/trace-5.m" }, { "id": "trace:6", "builtinKey": "trace", "builtinTitle": "trace", "builtinSlug": "trace", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Handling empty matrices safely", "summary": "Sum the diagonal elements of matrices and matrix-like tensors.", "code": "E = zeros(0, 5);\nvalue = trace(E)", "output": "value = 0", "keywords": ["trace", "matrix trace", "diagonal sum", "gpu"], "suggestedPath": "/trace-6.m" }, { "id": "transpose:1", "builtinKey": "transpose", "builtinTitle": "transpose", "builtinSlug": "transpose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Transposing a numeric matrix to swap rows and columns", "summary": "Swap the first two dimensions of arrays without taking the complex conjugate.", "code": "A = [1 2 3; 4 5 6];\nB = transpose(A)", "output": "B =\n 1 4\n 2 5\n 3 6", "keywords": ["transpose", "swap rows and columns", "non-conjugate transpose", "gpu"], "suggestedPath": "/transpose-1.m" }, { "id": "transpose:2", "builtinKey": "transpose", "builtinTitle": "transpose", "builtinSlug": "transpose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Turning a row vector into a column vector", "summary": "Swap the first two dimensions of arrays without taking the complex conjugate.", "code": "row = 1:4;\ncol = transpose(row);\nsize(col)", "output": "ans = [4 1]", "keywords": ["transpose", "swap rows and columns", "non-conjugate transpose", "gpu"], "suggestedPath": "/transpose-2.m" }, { "id": "transpose:3", "builtinKey": "transpose", "builtinTitle": "transpose", "builtinSlug": "transpose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Preserving imaginary parts when transposing complex matrices", "summary": "Swap the first two dimensions of arrays without taking the complex conjugate.", "code": "Z = [1+2i 3-4i];\nZT = transpose(Z)", "output": "ZT =\n 1.0000 + 2.0000i\n 3.0000 - 4.0000i", "keywords": ["transpose", "swap rows and columns", "non-conjugate transpose", "gpu"], "suggestedPath": "/transpose-3.m" }, { "id": "transpose:4", "builtinKey": "transpose", "builtinTitle": "transpose", "builtinSlug": "transpose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Transposing logical masks while keeping logical type", "summary": "Swap the first two dimensions of arrays without taking the complex conjugate.", "code": "mask = logical([1 0 1; 0 1 0]);\nmaskT = transpose(mask);\nclass(maskT)", "output": "ans = 'logical'", "keywords": ["transpose", "swap rows and columns", "non-conjugate transpose", "gpu"], "suggestedPath": "/transpose-4.m" }, { "id": "transpose:5", "builtinKey": "transpose", "builtinTitle": "transpose", "builtinSlug": "transpose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Transposing character arrays to flip rows and columns of text", "summary": "Swap the first two dimensions of arrays without taking the complex conjugate.", "code": "C = ['r' 'u' 'n'; 'm' 'a' 't'];\nCT = transpose(C)", "output": "CT =\n 'rm'\n 'ua'\n 'nt'", "keywords": ["transpose", "swap rows and columns", "non-conjugate transpose", "gpu"], "suggestedPath": "/transpose-5.m" }, { "id": "transpose:6", "builtinKey": "transpose", "builtinTitle": "transpose", "builtinSlug": "transpose", "category": "math/linalg/ops", "categoryPath": ["math", "linalg", "ops"], "exampleTitle": "Transposing gpuArray data without leaving the device", "summary": "Swap the first two dimensions of arrays without taking the complex conjugate.", "code": "G = gpuArray(rand(1024, 32));\nGT = transpose(G);\nisgpuarray(GT)", "output": "ans = logical 1", "keywords": ["transpose", "swap rows and columns", "non-conjugate transpose", "gpu"], "suggestedPath": "/transpose-6.m" }, { "id": "tril:1", "builtinKey": "tril", "builtinTitle": "tril", "builtinSlug": "tril", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Extracting the lower triangular part of a matrix", "summary": "Extract the lower triangular portion of a matrix (optionally including super-diagonals).", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nL = tril(A)", "output": "L =\n 1 0 0\n 4 5 0\n 7 8 9", "keywords": ["tril", "lower triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/tril-1.m" }, { "id": "tril:2", "builtinKey": "tril", "builtinTitle": "tril", "builtinSlug": "tril", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Keeping one super-diagonal above the main diagonal", "summary": "Extract the lower triangular portion of a matrix (optionally including super-diagonals).", "code": "A = magic(4);\nL = tril(A, 1)", "output": "L =\n 16 2 0 0\n 5 11 10 0\n 9 7 6 12\n 4 14 15 1", "keywords": ["tril", "lower triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/tril-2.m" }, { "id": "tril:3", "builtinKey": "tril", "builtinTitle": "tril", "builtinSlug": "tril", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Dropping the main diagonal with a negative offset", "summary": "Extract the lower triangular portion of a matrix (optionally including super-diagonals).", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nstrict = tril(A, -1)", "output": "strict =\n 0 0 0\n 4 0 0\n 7 8 0", "keywords": ["tril", "lower triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/tril-3.m" }, { "id": "tril:4", "builtinKey": "tril", "builtinTitle": "tril", "builtinSlug": "tril", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Applying `tril` to every page of a 3-D array", "summary": "Extract the lower triangular portion of a matrix (optionally including super-diagonals).", "code": "T = reshape(1:18, [3 3 2]);\nL = tril(T)", "output": "L(:, :, 1) =\n 1 0 0\n 4 5 0\n 7 8 9\n\nL(:, :, 2) =\n 10 0 0\n 13 14 0\n 16 17 18", "keywords": ["tril", "lower triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/tril-4.m" }, { "id": "tril:5", "builtinKey": "tril", "builtinTitle": "tril", "builtinSlug": "tril", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Preserving gpuArray residency with `tril`", "summary": "Extract the lower triangular portion of a matrix (optionally including super-diagonals).", "code": "G = gpuArray(rand(5));\nL = tril(G, -2);\nisa(L, 'gpuArray')", "output": "ans =\n logical\n 1", "keywords": ["tril", "lower triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/tril-5.m" }, { "id": "triu:1", "builtinKey": "triu", "builtinTitle": "triu", "builtinSlug": "triu", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Extracting the upper triangular part of a matrix", "summary": "Keep the upper triangular portion of a matrix (optionally including sub-diagonals).", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nU = triu(A)", "output": "U =\n 1 2 3\n 0 5 6\n 0 0 9", "keywords": ["triu", "upper triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/triu-1.m" }, { "id": "triu:2", "builtinKey": "triu", "builtinTitle": "triu", "builtinSlug": "triu", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Keeping one sub-diagonal beneath the main diagonal", "summary": "Keep the upper triangular portion of a matrix (optionally including sub-diagonals).", "code": "A = magic(4);\nU = triu(A, -1)", "output": "U =\n 16 2 3 13\n 5 11 10 8\n 0 7 6 12\n 0 0 15 1", "keywords": ["triu", "upper triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/triu-2.m" }, { "id": "triu:3", "builtinKey": "triu", "builtinTitle": "triu", "builtinSlug": "triu", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Dropping the main diagonal with a positive offset", "summary": "Keep the upper triangular portion of a matrix (optionally including sub-diagonals).", "code": "A = [1 2 3; 4 5 6; 7 8 9];\nstrict = triu(A, 1)", "output": "strict =\n 0 2 3\n 0 0 6\n 0 0 0", "keywords": ["triu", "upper triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/triu-3.m" }, { "id": "triu:4", "builtinKey": "triu", "builtinTitle": "triu", "builtinSlug": "triu", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Applying `triu` to every page of a 3-D array", "summary": "Keep the upper triangular portion of a matrix (optionally including sub-diagonals).", "code": "T = reshape(1:18, [3 3 2]);\nU = triu(T)", "output": "U(:, :, 1) =\n 1 2 3\n 0 5 6\n 0 0 9\n\nU(:, :, 2) =\n 10 11 12\n 0 14 15\n 0 0 18", "keywords": ["triu", "upper triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/triu-4.m" }, { "id": "triu:5", "builtinKey": "triu", "builtinTitle": "triu", "builtinSlug": "triu", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Preserving gpuArray residency with `triu`", "summary": "Keep the upper triangular portion of a matrix (optionally including sub-diagonals).", "code": "G = gpuArray(rand(5));\nU = triu(G, -2);\nisa(U, 'gpuArray')", "output": "ans =\n logical\n 1", "keywords": ["triu", "upper triangular", "matrix", "diagonal", "gpu"], "suggestedPath": "/triu-5.m" }, { "id": "true:1", "builtinKey": "true", "builtinTitle": "true", "builtinSlug": "true", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 2x3 logical array of true values", "summary": "Create logical arrays filled with true values.", "code": "mask = true(2, 3)", "output": "mask = [1 1 1; 1 1 1]", "keywords": ["true", "logical", "array", "mask"], "suggestedPath": "/true-1.m" }, { "id": "true:2", "builtinKey": "true", "builtinTitle": "true", "builtinSlug": "true", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a logical array from a size vector", "summary": "Create logical arrays filled with true values.", "code": "dims = [2 1 3];\nmask = true(dims)", "output": "mask =\n 2x1x3 logical array\n 1\n 1\n 1\n 1\n 1\n 1", "keywords": ["true", "logical", "array", "mask"], "suggestedPath": "/true-2.m" }, { "id": "true:3", "builtinKey": "true", "builtinTitle": "true", "builtinSlug": "true", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a true mask with the same size as an existing array", "summary": "Create logical arrays filled with true values.", "code": "A = rand(3, 2);\nmask = true(A)", "output": "mask =\n 3x2 logical array\n 1 1\n 1 1\n 1 1", "keywords": ["true", "logical", "array", "mask"], "suggestedPath": "/true-3.m" }, { "id": "union:1", "builtinKey": "union", "builtinTitle": "union", "builtinSlug": "union", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Combining Two Numeric Vectors", "summary": "Combine two arrays, returning their union with MATLAB-compatible ordering and index outputs.", "code": "A = [5 7 1];\nB = [3 1 1];\n[C, IA, IB] = union(A, B)", "output": "C =\n 1\n 3\n 5\n 7\nIA =\n 3\n 1\n 2\nIB =\n 1", "keywords": ["union", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/union-1.m" }, { "id": "union:2", "builtinKey": "union", "builtinTitle": "union", "builtinSlug": "union", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Preserving Input Order with `'stable'`", "summary": "Combine two arrays, returning their union with MATLAB-compatible ordering and index outputs.", "code": "A = [5 7 1];\nB = [3 2 4];\nC = union(A, B, 'stable')", "output": "C =\n 5\n 7\n 1\n 3\n 2\n 4", "keywords": ["union", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/union-2.m" }, { "id": "union:3", "builtinKey": "union", "builtinTitle": "union", "builtinSlug": "union", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Union of Matrix Rows", "summary": "Combine two arrays, returning their union with MATLAB-compatible ordering and index outputs.", "code": "A = [1 2; 3 4; 1 2];\nB = [3 4; 5 6];\n[C, IA, IB] = union(A, B, 'rows')", "output": "C =\n 1 2\n 3 4\n 5 6\nIA =\n 1\n 2\nIB =\n 2", "keywords": ["union", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/union-3.m" }, { "id": "union:4", "builtinKey": "union", "builtinTitle": "union", "builtinSlug": "union", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Working with Character Arrays", "summary": "Combine two arrays, returning their union with MATLAB-compatible ordering and index outputs.", "code": "A = ['m','z'; 'm','a'];\nB = ['a','x'; 'm','a'];\nunion(A, B)", "output": "ans =\n 4x1 char array\n a\n m\n x\n z", "keywords": ["union", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/union-4.m" }, { "id": "union:5", "builtinKey": "union", "builtinTitle": "union", "builtinSlug": "union", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Union on GPU Data", "summary": "Combine two arrays, returning their union with MATLAB-compatible ordering and index outputs.", "code": "G = gpuArray([1 4 2 5]);\nH = gpuArray([2 6]);\n[C, IA, IB] = union(G, H)", "output": "C =\n 1\n 2\n 4\n 5\n 6\nIA =\n 1\n 3\n 4\nIB =\n 2", "keywords": ["union", "set", "stable", "rows", "indices", "gpu"], "suggestedPath": "/union-5.m" }, { "id": "unique:1", "builtinKey": "unique", "builtinTitle": "unique", "builtinSlug": "unique", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Getting Sorted Unique Values", "summary": "Return the unique elements or rows of arrays with optional index outputs.", "code": "A = [3 1 3 2];\nC = unique(A)", "output": "C =\n 1\n 2\n 3", "keywords": ["unique", "set", "distinct", "stable", "rows", "indices", "gpu", "string", "char"], "suggestedPath": "/unique-1.m" }, { "id": "unique:2", "builtinKey": "unique", "builtinTitle": "unique", "builtinSlug": "unique", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Preserving Input Order with `'stable'`", "summary": "Return the unique elements or rows of arrays with optional index outputs.", "code": "A = [4 2 4 1 2];\nC = unique(A, 'stable')", "output": "C =\n 4\n 2\n 1", "keywords": ["unique", "set", "distinct", "stable", "rows", "indices", "gpu", "string", "char"], "suggestedPath": "/unique-2.m" }, { "id": "unique:3", "builtinKey": "unique", "builtinTitle": "unique", "builtinSlug": "unique", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Returning Indices for Reconstruction", "summary": "Return the unique elements or rows of arrays with optional index outputs.", "code": "A = [7 5 7 3];\n[C, IA, IC] = unique(A);\nreconstructed = C(IC)", "output": "C =\n 3\n 5\n 7\nIA =\n 4\n 2\n 1\nIC =\n 3\n 2\n 3\n 1\nreconstructed =\n 7\n 5\n 7\n 3", "keywords": ["unique", "set", "distinct", "stable", "rows", "indices", "gpu", "string", "char"], "suggestedPath": "/unique-3.m" }, { "id": "unique:4", "builtinKey": "unique", "builtinTitle": "unique", "builtinSlug": "unique", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Finding Unique Rows in a Matrix", "summary": "Return the unique elements or rows of arrays with optional index outputs.", "code": "A = [1 3; 1 3; 2 4; 1 2];\n[C, IA, IC] = unique(A, 'rows')", "output": "C =\n 1 2\n 1 3\n 2 4\nIA =\n 4\n 1\n 3\nIC =\n 2\n 2\n 3\n 1", "keywords": ["unique", "set", "distinct", "stable", "rows", "indices", "gpu", "string", "char"], "suggestedPath": "/unique-4.m" }, { "id": "unique:5", "builtinKey": "unique", "builtinTitle": "unique", "builtinSlug": "unique", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Selecting Last Occurrences", "summary": "Return the unique elements or rows of arrays with optional index outputs.", "code": "A = [9 8 9 7 8];\n[C, IA] = unique(A, 'last')", "output": "C =\n 7\n 8\n 9\nIA =\n 4\n 5\n 3", "keywords": ["unique", "set", "distinct", "stable", "rows", "indices", "gpu", "string", "char"], "suggestedPath": "/unique-5.m" }, { "id": "unique:6", "builtinKey": "unique", "builtinTitle": "unique", "builtinSlug": "unique", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Working with Empty Arrays", "summary": "Return the unique elements or rows of arrays with optional index outputs.", "code": "A = zeros(0, 3);\n[C, IA, IC] = unique(A, 'rows')", "output": "C =\nIA =\nIC =", "keywords": ["unique", "set", "distinct", "stable", "rows", "indices", "gpu", "string", "char"], "suggestedPath": "/unique-6.m" }, { "id": "unique:7", "builtinKey": "unique", "builtinTitle": "unique", "builtinSlug": "unique", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Using `unique` on GPU Arrays", "summary": "Return the unique elements or rows of arrays with optional index outputs.", "code": "G = gpuArray([5 3 5 1]);\n[C, IA, IC] = unique(G, 'stable')", "output": "C =\n 5\n 3\n 1\nIA =\n 1\n 2\n 4\nIC =\n 1\n 2\n 1\n 3", "keywords": ["unique", "set", "distinct", "stable", "rows", "indices", "gpu", "string", "char"], "suggestedPath": "/unique-7.m" }, { "id": "unique:8", "builtinKey": "unique", "builtinTitle": "unique", "builtinSlug": "unique", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Unique Characters in a Char Array", "summary": "Return the unique elements or rows of arrays with optional index outputs.", "code": "chars = ['m','z'; 'm','a'];\n[C, IA] = unique(chars)", "output": "C =\n a\n m\n z\nIA =\n 4\n 1\n 3", "keywords": ["unique", "set", "distinct", "stable", "rows", "indices", "gpu", "string", "char"], "suggestedPath": "/unique-8.m" }, { "id": "unique:9", "builtinKey": "unique", "builtinTitle": "unique", "builtinSlug": "unique", "category": "array/sorting_sets", "categoryPath": ["array", "sorting_sets"], "exampleTitle": "Unique Strings with Row Deduplication", "summary": "Return the unique elements or rows of arrays with optional index outputs.", "code": "S = [\"alpha\" \"beta\"; \"alpha\" \"beta\"; \"gamma\" \"beta\"];\n[C, IA, IC] = unique(S, 'rows', 'stable')", "output": "C =\n 2x2 string array\n \"alpha\" \"beta\"\n \"gamma\" \"beta\"\nIA =\n 1\n 3\nIC =\n 1\n 1\n 2", "keywords": ["unique", "set", "distinct", "stable", "rows", "indices", "gpu", "string", "char"], "suggestedPath": "/unique-9.m" }, { "id": "upper:1", "builtinKey": "upper", "builtinTitle": "upper", "builtinSlug": "upper", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Convert a string scalar to uppercase", "summary": "Convert strings, character arrays, and cell arrays of character vectors to uppercase.", "code": "txt = \"RunMat\";\nresult = upper(txt)", "output": "result = \"RUNMAT\"", "keywords": ["upper", "uppercase", "convert to uppercase", "string case", "character arrays"], "suggestedPath": "/upper-1.m" }, { "id": "upper:2", "builtinKey": "upper", "builtinTitle": "upper", "builtinSlug": "upper", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Uppercase each element of a string array", "summary": "Convert strings, character arrays, and cell arrays of character vectors to uppercase.", "code": "labels = [\"north\" \"South\"; \"East\" \"west\"];\nuppered = upper(labels)", "output": "uppered = 2×2 string\n \"NORTH\" \"SOUTH\"\n \"EAST\" \"WEST\"", "keywords": ["upper", "uppercase", "convert to uppercase", "string case", "character arrays"], "suggestedPath": "/upper-2.m" }, { "id": "upper:3", "builtinKey": "upper", "builtinTitle": "upper", "builtinSlug": "upper", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Uppercase character array rows while preserving shape", "summary": "Convert strings, character arrays, and cell arrays of character vectors to uppercase.", "code": "animals = char(\"cat\", \"doge\");\nresult = upper(animals)", "output": "result =\n\n 2×4 char array\n\n 'CAT '\n 'DOGE'", "keywords": ["upper", "uppercase", "convert to uppercase", "string case", "character arrays"], "suggestedPath": "/upper-3.m" }, { "id": "upper:4", "builtinKey": "upper", "builtinTitle": "upper", "builtinSlug": "upper", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Uppercase a cell array of character vectors", "summary": "Convert strings, character arrays, and cell arrays of character vectors to uppercase.", "code": "C = {'hello', 'World'};\nout = upper(C)", "output": "out = 1×2 cell array\n {'HELLO'} {'WORLD'}", "keywords": ["upper", "uppercase", "convert to uppercase", "string case", "character arrays"], "suggestedPath": "/upper-4.m" }, { "id": "upper:5", "builtinKey": "upper", "builtinTitle": "upper", "builtinSlug": "upper", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Keep missing strings as missing", "summary": "Convert strings, character arrays, and cell arrays of character vectors to uppercase.", "code": "vals = [\"data\", string(missing), \"gpu\"];\nconverted = upper(vals)", "output": "converted = 1×3 string\n \"DATA\" <missing> \"GPU\"", "keywords": ["upper", "uppercase", "convert to uppercase", "string case", "character arrays"], "suggestedPath": "/upper-5.m" }, { "id": "upper:6", "builtinKey": "upper", "builtinTitle": "upper", "builtinSlug": "upper", "category": "strings/transform", "categoryPath": ["strings", "transform"], "exampleTitle": "Handle text stored on a GPU input", "summary": "Convert strings, character arrays, and cell arrays of character vectors to uppercase.", "code": "codes = gpuArray(uint16('runmat'));\ntxt = char(gather(codes));\nresult = upper(txt)", "output": "result = 'RUNMAT'", "keywords": ["upper", "uppercase", "convert to uppercase", "string case", "character arrays"], "suggestedPath": "/upper-6.m" }, { "id": "var:1", "builtinKey": "var", "builtinTitle": "var", "builtinSlug": "var", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Sample variance of a vector", "summary": "Variance of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "x = [1 2 3 4 5];\nv = var(x); % uses flag = 0 (sample) by default", "output": "v = 2.5", "keywords": ["var", "variance", "statistics", "gpu", "omitnan", "all"], "suggestedPath": "/var-1.m" }, { "id": "var:2", "builtinKey": "var", "builtinTitle": "var", "builtinSlug": "var", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Population variance of each column", "summary": "Variance of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "A = [1 3 5; 2 4 6];\nvpop = var(A, 1); % divide by n instead of n-1", "output": "vpop = [0.25 0.25 0.25]", "keywords": ["var", "variance", "statistics", "gpu", "omitnan", "all"], "suggestedPath": "/var-2.m" }, { "id": "var:3", "builtinKey": "var", "builtinTitle": "var", "builtinSlug": "var", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Collapsing every dimension at once", "summary": "Variance of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "B = reshape(1:12, [3 4]);\noverall = var(B, 0, 'all')", "output": "overall = 13", "keywords": ["var", "variance", "statistics", "gpu", "omitnan", "all"], "suggestedPath": "/var-3.m" }, { "id": "var:4", "builtinKey": "var", "builtinTitle": "var", "builtinSlug": "var", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Reducing across multiple dimensions", "summary": "Variance of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "C = cat(3, [1 2; 3 4], [5 6; 7 8]);\nsliceVariance = var(C, [], [1 3]); % keep columns, reduce rows & pages", "output": "sliceVariance = [6.6667 6.6667]", "keywords": ["var", "variance", "statistics", "gpu", "omitnan", "all"], "suggestedPath": "/var-4.m" }, { "id": "var:5", "builtinKey": "var", "builtinTitle": "var", "builtinSlug": "var", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Ignoring NaN values", "summary": "Variance of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "D = [1 NaN 3; 2 4 NaN];\nrowVariance = var(D, 0, 2, 'omitnan')", "output": "rowVariance = [2; 2]", "keywords": ["var", "variance", "statistics", "gpu", "omitnan", "all"], "suggestedPath": "/var-5.m" }, { "id": "var:6", "builtinKey": "var", "builtinTitle": "var", "builtinSlug": "var", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Variance on the GPU without manual `gpuArray`", "summary": "Variance of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "G = rand(1024, 512);\nspread = var(G, 1, 'all'); % stays on the GPU when the provider supports std reductions", "keywords": ["var", "variance", "statistics", "gpu", "omitnan", "all"], "suggestedPath": "/var-6.m" }, { "id": "var:7", "builtinKey": "var", "builtinTitle": "var", "builtinSlug": "var", "category": "math/reduction", "categoryPath": ["math", "reduction"], "exampleTitle": "Preserving default behaviour with an empty normalisation flag", "summary": "Variance of scalars, vectors, matrices, or N-D tensors with MATLAB-compatible options.", "code": "C = [1 2; 3 4];\nrowVariance = var(C, [], 2)", "output": "rowVariance = [0.5; 0.5]", "keywords": ["var", "variance", "statistics", "gpu", "omitnan", "all"], "suggestedPath": "/var-7.m" }, { "id": "vertcat:1", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Stacking matrices by adding rows", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "A = [1 2; 3 4];\nB = [5 6; 7 8];\nC = vertcat(A, B)", "output": "C =\n 1 2\n 3 4\n 5 6\n 7 8", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-1.m" }, { "id": "vertcat:2", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Building a column vector from scalars", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "col = vertcat(1, 2, 3, 4)", "output": "col =\n 1\n 2\n 3\n 4", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-2.m" }, { "id": "vertcat:3", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Combining character arrays into taller text blocks", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "top = ['RunMat'];\nbottom = ['Rocks!'];\nbanner = vertcat(top, bottom)", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-3.m" }, { "id": "vertcat:4", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Joining string arrays into multi-row tables", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "header = [\"Name\" \"Score\"];\nrows = [\"Alice\" \"98\"; \"Bob\" \"92\"];\ntable = vertcat(header, rows)", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-4.m" }, { "id": "vertcat:5", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Preserving logical masks when stacking", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "mask1 = logical([1 0 1]);\nmask2 = logical([0 1 0]);\nstacked = vertcat(mask1, mask2)", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-5.m" }, { "id": "vertcat:6", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Extending cell arrays downwards", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "row1 = {1, \"low\"};\nrow2 = {2, \"high\"};\ngrid = vertcat(row1, row2)", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-6.m" }, { "id": "vertcat:7", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Keeping gpuArray inputs resident on the device", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "G1 = gpuArray(rand(128, 256));\nG2 = gpuArray(rand(64, 256));\nstacked = vertcat(G1, G2)", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-7.m" }, { "id": "vertcat:8", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Requesting GPU output with the `'like'` prototype", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "proto = gpuArray.zeros(1, 3);\nresult = vertcat([1 2 3], [4 5 6], \"like\", proto)", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-8.m" }, { "id": "vertcat:9", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Working with empty rows without surprises", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "empty = zeros(0, 3);\ncombo = vertcat(empty, empty)", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-9.m" }, { "id": "vertcat:10", "builtinKey": "vertcat", "builtinTitle": "vertcat", "builtinSlug": "vertcat", "category": "array/shape", "categoryPath": ["array", "shape"], "exampleTitle": "Stacking complex matrices preserves imaginary parts", "summary": "Stack inputs top-to-bottom (dimension 1) exactly like MATLAB's semicolon syntax.", "code": "z1 = complex([1 2], [3 4]);\nz2 = complex([5 6], [7 8]);\njoined = vertcat(z1, z2)", "keywords": ["vertcat", "vertical concatenation", "stack rows", "square brackets", "gpu"], "suggestedPath": "/vertcat-10.m" }, { "id": "view:1", "builtinKey": "view", "builtinTitle": "view", "builtinSlug": "view", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Set an explicit 3-D camera angle", "summary": "Control 3-D camera angles for surfaces and spatial plots using azimuth/elevation views and MATLAB `view` semantics.", "code": "[X, Y] = meshgrid(linspace(-2, 2, 60), linspace(-2, 2, 60));\nZ = sin(X.^2 + Y.^2);\nsurf(X, Y, Z);\nview(45, 30);", "keywords": ["view", "3-D camera", "azimuth elevation", "matlab view", "rotate 3-D plot"], "suggestedPath": "/view-1.m" }, { "id": "view:2", "builtinKey": "view", "builtinTitle": "view", "builtinSlug": "view", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Use MATLAB-style view presets", "summary": "Control 3-D camera angles for surfaces and spatial plots using azimuth/elevation views and MATLAB `view` semantics.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 40), linspace(-3, 3, 40));\nZ = sin(X) .* cos(Y);\nsurf(X, Y, Z);\nview(2);\nview(3);", "keywords": ["view", "3-D camera", "azimuth elevation", "matlab view", "rotate 3-D plot"], "suggestedPath": "/view-2.m" }, { "id": "view:3", "builtinKey": "view", "builtinTitle": "view", "builtinSlug": "view", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Query a subplot-local camera", "summary": "Control 3-D camera angles for surfaces and spatial plots using azimuth/elevation views and MATLAB `view` semantics.", "code": "ax = subplot(1, 2, 2);\nplot3(cos(0:0.1:5), sin(0:0.1:5), 0:0.1:5);\nview(ax, [60 20]);\nget(ax, 'View')", "output": "% Returns a 1x2 vector [60 20]", "keywords": ["view", "3-D camera", "azimuth elevation", "matlab view", "rotate 3-D plot"], "suggestedPath": "/view-3.m" }, { "id": "warning:1", "builtinKey": "warning", "builtinTitle": "warning", "builtinSlug": "warning", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Displaying a simple warning", "summary": "Display formatted warnings, control warning state, and query per-identifier settings.", "code": "warning(\"Computation took longer than expected.\")", "keywords": ["warning", "diagnostics", "state", "query", "backtrace"], "suggestedPath": "/warning-1.m" }, { "id": "warning:2", "builtinKey": "warning", "builtinTitle": "warning", "builtinSlug": "warning", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Emitting a warning with a custom identifier", "summary": "Display formatted warnings, control warning state, and query per-identifier settings.", "code": "warning(\"runmat:io:deprecatedOption\", ...\n \"Option '%s' is deprecated and will be removed in %s.\", ...\n \"VerboseMode\", \"1.2\")", "keywords": ["warning", "diagnostics", "state", "query", "backtrace"], "suggestedPath": "/warning-2.m" }, { "id": "warning:3", "builtinKey": "warning", "builtinTitle": "warning", "builtinSlug": "warning", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Turning a specific warning off and back on", "summary": "Display formatted warnings, control warning state, and query per-identifier settings.", "code": "warning(\"off\", \"runmat:io:deprecatedOption\");\n% ... code that triggers the warning ...\nwarning(\"on\", \"runmat:io:deprecatedOption\")", "keywords": ["warning", "diagnostics", "state", "query", "backtrace"], "suggestedPath": "/warning-3.m" }, { "id": "warning:4", "builtinKey": "warning", "builtinTitle": "warning", "builtinSlug": "warning", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Promoting a warning to an error", "summary": "Display formatted warnings, control warning state, and query per-identifier settings.", "code": "warning(\"error\", \"runmat:solver:illConditioned\");\n% The next call raises an error instead of printing a warning.\nwarning(\"runmat:solver:illConditioned\", ...\n \"Condition number exceeds threshold %.2e.\", 1e12)", "keywords": ["warning", "diagnostics", "state", "query", "backtrace"], "suggestedPath": "/warning-4.m" }, { "id": "warning:5", "builtinKey": "warning", "builtinTitle": "warning", "builtinSlug": "warning", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Querying and restoring warning state", "summary": "Display formatted warnings, control warning state, and query per-identifier settings.", "code": "state = warning(\"query\", \"all\"); % capture the current table\nwarning(\"off\", \"all\"); % silence all warnings temporarily\nwarning(\"Some temporary warning.\");\nwarning(state); % restore original configuration", "keywords": ["warning", "diagnostics", "state", "query", "backtrace"], "suggestedPath": "/warning-5.m" }, { "id": "warning:6", "builtinKey": "warning", "builtinTitle": "warning", "builtinSlug": "warning", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Enabling backtraces for debugging", "summary": "Display formatted warnings, control warning state, and query per-identifier settings.", "code": "warning(\"on\", \"backtrace\"); % warning(\"backtrace\",\"on\") is equivalent\nwarning(\"runmat:demo:slowPath\", \"Inspect the call stack above for context.\");\nwarning(\"off\", \"backtrace\")", "keywords": ["warning", "diagnostics", "state", "query", "backtrace"], "suggestedPath": "/warning-6.m" }, { "id": "warning:7", "builtinKey": "warning", "builtinTitle": "warning", "builtinSlug": "warning", "category": "diagnostics", "categoryPath": ["diagnostics"], "exampleTitle": "Displaying verbose suppression guidance", "summary": "Display formatted warnings, control warning state, and query per-identifier settings.", "code": "warning(\"on\", \"verbose\");\nwarning(\"runmat:demo:slowPath\", \"Inspect the call stack above for context.\");\nwarning(\"default\", \"verbose\"); % restore the default verbosity", "keywords": ["warning", "diagnostics", "state", "query", "backtrace"], "suggestedPath": "/warning-7.m" }, { "id": "weboptions:1", "builtinKey": "weboptions", "builtinTitle": "weboptions", "builtinSlug": "weboptions", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Setting custom timeouts for webread calls", "summary": "Create an options struct that configures webread and webwrite HTTP behaviour.", "code": "opts = weboptions(\"Timeout\", 10);\nhtml = webread(\"https://example.com\", opts)", "keywords": ["weboptions", "http options", "timeout", "headers", "rest client"], "suggestedPath": "/weboptions-1.m" }, { "id": "weboptions:2", "builtinKey": "weboptions", "builtinTitle": "weboptions", "builtinSlug": "weboptions", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Providing HTTP basic authentication credentials", "summary": "Create an options struct that configures webread and webwrite HTTP behaviour.", "code": "opts = weboptions(\"Username\", \"ada\", \"Password\", \"lovelace\");\nprofile = webread(\"https://api.example.com/me\", opts)", "keywords": ["weboptions", "http options", "timeout", "headers", "rest client"], "suggestedPath": "/weboptions-2.m" }, { "id": "weboptions:3", "builtinKey": "weboptions", "builtinTitle": "weboptions", "builtinSlug": "weboptions", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Sending JSON payloads with webwrite", "summary": "Create an options struct that configures webread and webwrite HTTP behaviour.", "code": "opts = weboptions(\"ContentType\", \"json\", \"MediaType\", \"application/json\");\npayload = struct(\"title\", \"RunMat\", \"stars\", 5);\nreply = webwrite(\"https://api.example.com/projects\", payload, opts)", "keywords": ["weboptions", "http options", "timeout", "headers", "rest client"], "suggestedPath": "/weboptions-3.m" }, { "id": "weboptions:4", "builtinKey": "weboptions", "builtinTitle": "weboptions", "builtinSlug": "weboptions", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Applying custom headers with struct syntax", "summary": "Create an options struct that configures webread and webwrite HTTP behaviour.", "code": "headers = struct(\"Accept\", \"application/json\", \"X-Client\", \"RunMat\");\nopts = weboptions(\"HeaderFields\", headers);\ndata = webread(\"https://api.example.com/resources\", opts)", "keywords": ["weboptions", "http options", "timeout", "headers", "rest client"], "suggestedPath": "/weboptions-4.m" }, { "id": "weboptions:5", "builtinKey": "weboptions", "builtinTitle": "weboptions", "builtinSlug": "weboptions", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Combining existing options with overrides", "summary": "Create an options struct that configures webread and webwrite HTTP behaviour.", "code": "base = weboptions(\"ContentType\", \"json\");\nopts = weboptions(base, \"Timeout\", 15, \"QueryParameters\", struct(\"verbose\", true));\nresult = webread(\"https://api.example.com/items\", opts)", "keywords": ["weboptions", "http options", "timeout", "headers", "rest client"], "suggestedPath": "/weboptions-5.m" }, { "id": "webread:1", "builtinKey": "webread", "builtinTitle": "webread", "builtinSlug": "webread", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Reading JSON data from a REST API", "summary": "Download web content (JSON, text, or binary) over HTTP/HTTPS.", "code": "opts = weboptions(\"ContentType\", \"json\", \"Timeout\", 15);\nweather = webread(\"https://api.example.com/weather\", opts, \"city\", \"Reykjavik\");\ndisp(weather.temperatureC)", "output": " 2.3", "keywords": ["webread", "http get", "rest client", "json", "https", "api"], "suggestedPath": "/webread-1.m" }, { "id": "webread:2", "builtinKey": "webread", "builtinTitle": "webread", "builtinSlug": "webread", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Downloading plain text as a character vector", "summary": "Download web content (JSON, text, or binary) over HTTP/HTTPS.", "code": "html = webread(\"https://example.com/index.txt\", \"Timeout\", 5);\nextract = html(1:200)", "keywords": ["webread", "http get", "rest client", "json", "https", "api"], "suggestedPath": "/webread-2.m" }, { "id": "webread:3", "builtinKey": "webread", "builtinTitle": "webread", "builtinSlug": "webread", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Retrieving binary payloads such as images", "summary": "Download web content (JSON, text, or binary) over HTTP/HTTPS.", "code": "bytes = webread(\"https://example.com/logo.png\", \"ContentType\", \"binary\");\nfilewrite(\"logo.png\", uint8(bytes))", "keywords": ["webread", "http get", "rest client", "json", "https", "api"], "suggestedPath": "/webread-3.m" }, { "id": "webread:4", "builtinKey": "webread", "builtinTitle": "webread", "builtinSlug": "webread", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Supplying custom headers and credentials", "summary": "Download web content (JSON, text, or binary) over HTTP/HTTPS.", "code": "headers = struct(\"Accept\", \"application/json\", \"X-Client\", \"RunMat\");\ndata = webread(\"https://api.example.com/me\", ...\n \"Username\", \"ada\", \"Password\", \"secret\", ...\n \"HeaderFields\", headers, ...\n \"ContentType\", \"json\")", "keywords": ["webread", "http get", "rest client", "json", "https", "api"], "suggestedPath": "/webread-4.m" }, { "id": "webread:5", "builtinKey": "webread", "builtinTitle": "webread", "builtinSlug": "webread", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Passing query parameters as a struct", "summary": "Download web content (JSON, text, or binary) over HTTP/HTTPS.", "code": "query = struct(\"limit\", 25, \"sort\", \"name\");\nresponse = webread(\"https://api.example.com/resources\", query, \"ContentType\", \"json\")", "keywords": ["webread", "http get", "rest client", "json", "https", "api"], "suggestedPath": "/webread-5.m" }, { "id": "webwrite:1", "builtinKey": "webwrite", "builtinTitle": "webwrite", "builtinSlug": "webwrite", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Posting form fields to a REST endpoint", "summary": "Send data to web services using HTTP POST/PUT requests and return the response.", "code": "payload = struct(\"name\", \"Ada\", \"score\", 42);\nopts = struct(\"ContentType\", \"json\"); % expect JSON response\nreply = webwrite(\"https://api.example.com/submit\", payload, opts);\ndisp(reply.status)", "output": " \"ok\"", "keywords": ["webwrite", "http post", "rest client", "json upload", "form post", "binary upload"], "suggestedPath": "/webwrite-1.m" }, { "id": "webwrite:2", "builtinKey": "webwrite", "builtinTitle": "webwrite", "builtinSlug": "webwrite", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Sending JSON payloads", "summary": "Send data to web services using HTTP POST/PUT requests and return the response.", "code": "body = struct(\"title\", \"RunMat\", \"stars\", 5);\nopts = struct(\"MediaType\", \"application/json\", \"ContentType\", \"json\");\nresp = webwrite(\"https://api.example.com/projects\", body, opts)", "keywords": ["webwrite", "http post", "rest client", "json upload", "form post", "binary upload"], "suggestedPath": "/webwrite-2.m" }, { "id": "webwrite:3", "builtinKey": "webwrite", "builtinTitle": "webwrite", "builtinSlug": "webwrite", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Uploading plain text", "summary": "Send data to web services using HTTP POST/PUT requests and return the response.", "code": "message = \"Hello from RunMat!\";\nreply = webwrite(\"https://api.example.com/echo\", message, ...\n \"MediaType\", \"text/plain\", \"ContentType\", \"text\")", "keywords": ["webwrite", "http post", "rest client", "json upload", "form post", "binary upload"], "suggestedPath": "/webwrite-3.m" }, { "id": "webwrite:4", "builtinKey": "webwrite", "builtinTitle": "webwrite", "builtinSlug": "webwrite", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Uploading raw binary data", "summary": "Send data to web services using HTTP POST/PUT requests and return the response.", "code": "bytes = uint8([1 2 3 4 5]);\nwebwrite(\"https://api.example.com/upload\", bytes, ...\n \"ContentType\", \"binary\", \"MediaType\", \"application/octet-stream\")", "keywords": ["webwrite", "http post", "rest client", "json upload", "form post", "binary upload"], "suggestedPath": "/webwrite-4.m" }, { "id": "webwrite:5", "builtinKey": "webwrite", "builtinTitle": "webwrite", "builtinSlug": "webwrite", "category": "io/http", "categoryPath": ["io", "http"], "exampleTitle": "Supplying credentials, custom headers, and query parameters", "summary": "Send data to web services using HTTP POST/PUT requests and return the response.", "code": "headers = struct(\"X-Client\", \"RunMat\", \"Accept\", \"application/json\");\nopts = struct(\"Username\", \"ada\", \"Password\", \"lovelace\", ...\n \"HeaderFields\", headers, ...\n \"QueryParameters\", struct(\"verbose\", true));\nprofile = webwrite(\"https://api.example.com/me\", struct(), opts)", "keywords": ["webwrite", "http post", "rest client", "json upload", "form post", "binary upload"], "suggestedPath": "/webwrite-5.m" }, { "id": "which:1", "builtinKey": "which", "builtinTitle": "which", "builtinSlug": "which", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Finding a built-in function's implementation", "summary": "Identify which variable, builtin, script, class, or folder RunMat will execute for a given name.", "code": "which(\"sin\")", "output": "built-in (RunMat builtin: sin)", "keywords": ["which", "search path", "builtin lookup", "script path", "variable shadowing"], "suggestedPath": "/which-1.m" }, { "id": "which:2", "builtinKey": "which", "builtinTitle": "which", "builtinSlug": "which", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Checking if a workspace variable shadows a builtin", "summary": "Identify which variable, builtin, script, class, or folder RunMat will execute for a given name.", "code": "answer = 42;\nwhich(\"answer\")", "output": "'answer' is a variable.", "keywords": ["which", "search path", "builtin lookup", "script path", "variable shadowing"], "suggestedPath": "/which-2.m" }, { "id": "which:3", "builtinKey": "which", "builtinTitle": "which", "builtinSlug": "which", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Listing all matches on the path", "summary": "Identify which variable, builtin, script, class, or folder RunMat will execute for a given name.", "code": "which(\"sum\", \"-all\")", "output": "{\n [1,1] = built-in (RunMat builtin: sum)\n [2,1] = //runmat/stdlib/sum.m\n}", "keywords": ["which", "search path", "builtin lookup", "script path", "variable shadowing"], "suggestedPath": "/which-3.m" }, { "id": "which:4", "builtinKey": "which", "builtinTitle": "which", "builtinSlug": "which", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Locating a script or function file", "summary": "Identify which variable, builtin, script, class, or folder RunMat will execute for a given name.", "code": "which(\"helpers/process_data\")", "output": "//projects/runmat/helpers/process_data.m", "keywords": ["which", "search path", "builtin lookup", "script path", "variable shadowing"], "suggestedPath": "/which-4.m" }, { "id": "which:5", "builtinKey": "which", "builtinTitle": "which", "builtinSlug": "which", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Restricting the search to variables", "summary": "Identify which variable, builtin, script, class, or folder RunMat will execute for a given name.", "code": "which(\"-var\", \"velocity\")", "output": "'velocity' is a variable.", "keywords": ["which", "search path", "builtin lookup", "script path", "variable shadowing"], "suggestedPath": "/which-5.m" }, { "id": "which:6", "builtinKey": "which", "builtinTitle": "which", "builtinSlug": "which", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Restricting the search to files", "summary": "Identify which variable, builtin, script, class, or folder RunMat will execute for a given name.", "code": "which(\"fft\", \"-file\")", "output": "//runmat/overrides/fft.m", "keywords": ["which", "search path", "builtin lookup", "script path", "variable shadowing"], "suggestedPath": "/which-6.m" }, { "id": "who:1", "builtinKey": "who", "builtinTitle": "who", "builtinSlug": "who", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "List All Workspace Variables", "summary": "List the names of variables in the workspace or MAT-files (MATLAB-compatible).", "code": "a = 42;\nb = rand(3, 2);\nnames = who", "output": "names =\n 2×1 cell array\n {\"a\"}\n {\"b\"}", "keywords": ["who", "workspace", "variables", "introspection", "mat-file"], "suggestedPath": "/who-1.m" }, { "id": "who:2", "builtinKey": "who", "builtinTitle": "who", "builtinSlug": "who", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Filter With Wildcard Patterns", "summary": "List the names of variables in the workspace or MAT-files (MATLAB-compatible).", "code": "alpha = 1;\nbeta = 2;\nnames = who(\"a*\")", "output": "names =\n 1×1 cell array\n {\"alpha\"}", "keywords": ["who", "workspace", "variables", "introspection", "mat-file"], "suggestedPath": "/who-2.m" }, { "id": "who:3", "builtinKey": "who", "builtinTitle": "who", "builtinSlug": "who", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Use Regular Expressions", "summary": "List the names of variables in the workspace or MAT-files (MATLAB-compatible).", "code": "x1 = rand;\nx2 = rand;\nmatches = who('-regexp', '^x\\d$')", "output": "matches =\n 2×1 cell array\n {\"x1\"}\n {\"x2\"}", "keywords": ["who", "workspace", "variables", "introspection", "mat-file"], "suggestedPath": "/who-3.m" }, { "id": "who:4", "builtinKey": "who", "builtinTitle": "who", "builtinSlug": "who", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Inspect Variables Stored In A MAT-File", "summary": "List the names of variables in the workspace or MAT-files (MATLAB-compatible).", "code": "save('snapshot.mat', 'alpha', 'beta')\nfile_names = who('-file', 'snapshot.mat')", "output": "file_names =\n 2×1 cell array\n {\"alpha\"}\n {\"beta\"}", "keywords": ["who", "workspace", "variables", "introspection", "mat-file"], "suggestedPath": "/who-4.m" }, { "id": "who:5", "builtinKey": "who", "builtinTitle": "who", "builtinSlug": "who", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "List Only Global Variables", "summary": "List the names of variables in the workspace or MAT-files (MATLAB-compatible).", "code": "global shared;\nlocal = 1;\nglobals = who('global')", "output": "globals =\n 1×1 cell array\n {\"shared\"}", "keywords": ["who", "workspace", "variables", "introspection", "mat-file"], "suggestedPath": "/who-5.m" }, { "id": "whos:1", "builtinKey": "whos", "builtinTitle": "whos", "builtinSlug": "whos", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "List All Workspace Variables", "summary": "List variables in the workspace or MAT-files with MATLAB-compatible metadata.", "code": "a = 42;\nb = rand(3, 2);\ninfo = whos;\n{info.name}", "output": " {\"a\"} {\"b\"}", "keywords": ["whos", "workspace variables", "memory usage", "struct array", "introspection"], "suggestedPath": "/whos-1.m" }, { "id": "whos:2", "builtinKey": "whos", "builtinTitle": "whos", "builtinSlug": "whos", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Filter Variables With Wildcards", "summary": "List variables in the workspace or MAT-files with MATLAB-compatible metadata.", "code": "alpha = 1;\nbeta = 2;\nresults = whos(\"a*\");\n{results.name}", "output": " {\"alpha\"}", "keywords": ["whos", "workspace variables", "memory usage", "struct array", "introspection"], "suggestedPath": "/whos-2.m" }, { "id": "whos:3", "builtinKey": "whos", "builtinTitle": "whos", "builtinSlug": "whos", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Use Regular Expressions To Match Names", "summary": "List variables in the workspace or MAT-files with MATLAB-compatible metadata.", "code": "x1 = rand;\nx2 = rand;\nmatches = whos('-regexp', '^x\\\\d$');\ncellstr({matches.name})", "output": " {'x1'}\n {'x2'}", "keywords": ["whos", "workspace variables", "memory usage", "struct array", "introspection"], "suggestedPath": "/whos-3.m" }, { "id": "whos:4", "builtinKey": "whos", "builtinTitle": "whos", "builtinSlug": "whos", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Inspect Variables Stored In A MAT-File", "summary": "List variables in the workspace or MAT-files with MATLAB-compatible metadata.", "code": "save('snapshot.mat', 'alpha', 'beta')\nfile_info = whos('-file', 'snapshot.mat');\n{file_info.name}", "output": " {\"alpha\"} {\"beta\"}", "keywords": ["whos", "workspace variables", "memory usage", "struct array", "introspection"], "suggestedPath": "/whos-4.m" }, { "id": "whos:5", "builtinKey": "whos", "builtinTitle": "whos", "builtinSlug": "whos", "category": "introspection", "categoryPath": ["introspection"], "exampleTitle": "Check GPU Arrays Without Gathering", "summary": "List variables in the workspace or MAT-files with MATLAB-compatible metadata.", "code": "G = gpuArray(rand(1024));\nmeta = whos('G');\nmeta.bytes % estimated bytes on device", "output": "meta.bytes\nans =\n 8.3886e+06", "keywords": ["whos", "workspace variables", "memory usage", "struct array", "introspection"], "suggestedPath": "/whos-5.m" }, { "id": "write:1", "builtinKey": "write", "builtinTitle": "write", "builtinSlug": "write", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Sending an array of bytes to an echo service", "summary": "Write numeric or text data to a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"127.0.0.1\", 50000);\ncount = write(client, uint8(1:4))", "output": "count =\n 4", "keywords": ["write", "tcpclient", "networking", "socket", "binary data", "text"], "suggestedPath": "/write-1.m" }, { "id": "write:2", "builtinKey": "write", "builtinTitle": "write", "builtinSlug": "write", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Writing doubles with explicit byte order", "summary": "Write numeric or text data to a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"localhost\", 50001, \"ByteOrder\", \"big-endian\");\nvalues = [1.5 2.5 3.5];\nwrite(client, values, \"double\")", "keywords": ["write", "tcpclient", "networking", "socket", "binary data", "text"], "suggestedPath": "/write-2.m" }, { "id": "write:3", "builtinKey": "write", "builtinTitle": "write", "builtinSlug": "write", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Transmitting ASCII text", "summary": "Write numeric or text data to a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"127.0.0.1\", 50002);\nwrite(client, \"RunMat TCP\", \"char\")", "keywords": ["write", "tcpclient", "networking", "socket", "binary data", "text"], "suggestedPath": "/write-3.m" }, { "id": "write:4", "builtinKey": "write", "builtinTitle": "write", "builtinSlug": "write", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Sending UTF-8 encoded strings", "summary": "Write numeric or text data to a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"127.0.0.1\", 50003);\nwrite(client, \"Διακριτό\", \"string\")", "keywords": ["write", "tcpclient", "networking", "socket", "binary data", "text"], "suggestedPath": "/write-4.m" }, { "id": "write:5", "builtinKey": "write", "builtinTitle": "write", "builtinSlug": "write", "category": "io/net", "categoryPath": ["io", "net"], "exampleTitle": "Handling connection closures", "summary": "Write numeric or text data to a remote host through a MATLAB-compatible tcpclient struct.", "code": "client = tcpclient(\"example.com\", 12345, \"Timeout\", 0.25);\ntry\n write(client, uint8([1 2 3 4]));\ncatch err\n disp(err.identifier)\nend", "output": "RunMat:write:ConnectionClosed", "keywords": ["write", "tcpclient", "networking", "socket", "binary data", "text"], "suggestedPath": "/write-5.m" }, { "id": "writematrix:1", "builtinKey": "writematrix", "builtinTitle": "writematrix", "builtinSlug": "writematrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Save a numeric matrix to a CSV file", "summary": "Write numeric or string matrices to delimited text files with MATLAB-compatible defaults.", "code": "A = [1 2 3; 4 5 6];\nwritematrix(A, \"results.csv\")", "keywords": ["writematrix", "csv", "delimited text", "write", "append", "quote strings", "decimal separator"], "suggestedPath": "/writematrix-1.m" }, { "id": "writematrix:2", "builtinKey": "writematrix", "builtinTitle": "writematrix", "builtinSlug": "writematrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Export data with a custom semicolon delimiter", "summary": "Write numeric or string matrices to delimited text files with MATLAB-compatible defaults.", "code": "A = [1 2 3; 4 5 6];\nwritematrix(A, \"results.dat\", 'Delimiter', ';')", "keywords": ["writematrix", "csv", "delimited text", "write", "append", "quote strings", "decimal separator"], "suggestedPath": "/writematrix-2.m" }, { "id": "writematrix:3", "builtinKey": "writematrix", "builtinTitle": "writematrix", "builtinSlug": "writematrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Append additional rows to an existing report", "summary": "Write numeric or string matrices to delimited text files with MATLAB-compatible defaults.", "code": "writematrix([7 8 9], \"report.txt\");\nwritematrix([10 11 12], \"report.txt\", 'WriteMode', 'append')", "keywords": ["writematrix", "csv", "delimited text", "write", "append", "quote strings", "decimal separator"], "suggestedPath": "/writematrix-3.m" }, { "id": "writematrix:4", "builtinKey": "writematrix", "builtinTitle": "writematrix", "builtinSlug": "writematrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Write string data with quoting disabled", "summary": "Write numeric or string matrices to delimited text files with MATLAB-compatible defaults.", "code": "names = [\"Alice\" \"Bob\" \"Charlie\"];\nwritematrix(names, \"names.csv\", 'QuoteStrings', false)", "keywords": ["writematrix", "csv", "delimited text", "write", "append", "quote strings", "decimal separator"], "suggestedPath": "/writematrix-4.m" }, { "id": "writematrix:5", "builtinKey": "writematrix", "builtinTitle": "writematrix", "builtinSlug": "writematrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Use a European decimal separator and explicit line ending", "summary": "Write numeric or string matrices to delimited text files with MATLAB-compatible defaults.", "code": "vals = [12.34; 56.78];\nwritematrix(vals, \"eu.csv\", 'DecimalSeparator', ',', 'LineEnding', 'unix')", "keywords": ["writematrix", "csv", "delimited text", "write", "append", "quote strings", "decimal separator"], "suggestedPath": "/writematrix-5.m" }, { "id": "writematrix:6", "builtinKey": "writematrix", "builtinTitle": "writematrix", "builtinSlug": "writematrix", "category": "io/tabular", "categoryPath": ["io", "tabular"], "exampleTitle": "Write GPU-resident data transparently", "summary": "Write numeric or string matrices to delimited text files with MATLAB-compatible defaults.", "code": "G = gpuArray(rand(2, 3));\nwritematrix(G, \"gpu_output.csv\")", "output": "% Data is gathered from the GPU automatically and written to disk as CSV.", "keywords": ["writematrix", "csv", "delimited text", "write", "append", "quote strings", "decimal separator"], "suggestedPath": "/writematrix-6.m" }, { "id": "xor:1", "builtinKey": "xor", "builtinTitle": "xor", "builtinSlug": "xor", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Checking if exactly one condition is true", "summary": "Element-wise logical XOR for scalars, arrays, and gpuArray values.", "code": "result = xor(true, false)", "output": "result =\n logical\n 1", "keywords": ["logical xor", "exclusive or", "boolean xor", "MATLAB xor", "gpuArray xor"], "suggestedPath": "/xor-1.m" }, { "id": "xor:2", "builtinKey": "xor", "builtinTitle": "xor", "builtinSlug": "xor", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Performing XOR on numeric arrays element-wise", "summary": "Element-wise logical XOR for scalars, arrays, and gpuArray values.", "code": "A = [1 0 2 0];\nB = [3 4 0 0];\nC = xor(A, B)", "output": "C =\n 1×4 logical array\n 0 1 1 0", "keywords": ["logical xor", "exclusive or", "boolean xor", "MATLAB xor", "gpuArray xor"], "suggestedPath": "/xor-2.m" }, { "id": "xor:3", "builtinKey": "xor", "builtinTitle": "xor", "builtinSlug": "xor", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Applying XOR with implicit expansion against a scalar", "summary": "Element-wise logical XOR for scalars, arrays, and gpuArray values.", "code": "mask = [1; 0; 3; 0];\nflag = xor(mask, 1)", "output": "flag =\n 4×1 logical array\n 0\n 1\n 0\n 1", "keywords": ["logical xor", "exclusive or", "boolean xor", "MATLAB xor", "gpuArray xor"], "suggestedPath": "/xor-3.m" }, { "id": "xor:4", "builtinKey": "xor", "builtinTitle": "xor", "builtinSlug": "xor", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Comparing character arrays with XOR", "summary": "Element-wise logical XOR for scalars, arrays, and gpuArray values.", "code": "lhs = ['R' 'u' 0];\nrhs = ['R' 0 'n'];\ndiff = xor(lhs, rhs)", "output": "diff =\n 1×3 logical array\n 0 1 1", "keywords": ["logical xor", "exclusive or", "boolean xor", "MATLAB xor", "gpuArray xor"], "suggestedPath": "/xor-4.m" }, { "id": "xor:5", "builtinKey": "xor", "builtinTitle": "xor", "builtinSlug": "xor", "category": "logical/bit", "categoryPath": ["logical", "bit"], "exampleTitle": "Running `xor` directly on `gpuArray` inputs", "summary": "Element-wise logical XOR for scalars, arrays, and gpuArray values.", "code": "G1 = gpuArray([0 2 0 4]);\nG2 = gpuArray([1 0 3 4]);\ndeviceResult = xor(G1, G2);\nhostResult = gather(deviceResult)", "output": "deviceResult =\n 1×4 gpuArray logical array\n 1 1 1 0\nhostResult =\n 1×4 logical array\n 1 1 1 0", "keywords": ["logical xor", "exclusive or", "boolean xor", "MATLAB xor", "gpuArray xor"], "suggestedPath": "/xor-5.m" }, { "id": "zeros:1", "builtinKey": "zeros", "builtinTitle": "zeros", "builtinSlug": "zeros", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 2x3 matrix of zeros", "summary": "Create arrays filled with zeros within the MATLAB language.", "code": "A = zeros(2, 3)", "output": "A = [0 0 0; 0 0 0]", "keywords": ["zeros", "array", "logical", "gpu", "like"], "suggestedPath": "/zeros-1.m" }, { "id": "zeros:2", "builtinKey": "zeros", "builtinTitle": "zeros", "builtinSlug": "zeros", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 4x1 logical matrix of zeros", "summary": "Create arrays filled with zeros within the MATLAB language.", "code": "mask = zeros(4, 1, 'logical')", "output": "mask = [0 0 0 0]", "keywords": ["zeros", "array", "logical", "gpu", "like"], "suggestedPath": "/zeros-2.m" }, { "id": "zeros:3", "builtinKey": "zeros", "builtinTitle": "zeros", "builtinSlug": "zeros", "category": "array/creation", "categoryPath": ["array", "creation"], "exampleTitle": "Creating a 128x128 matrix of zeros on a GPU", "summary": "Create arrays filled with zeros within the MATLAB language.", "code": "H = zeros(128, 128)", "output": "H = [0 0 0 ... 0; 0 0 0 ... 0; ...; 0 0 0 ... 0]", "keywords": ["zeros", "array", "logical", "gpu", "like"], "suggestedPath": "/zeros-3.m" }, { "id": "zlabel:1", "builtinKey": "zlabel", "builtinTitle": "zlabel", "builtinSlug": "zlabel", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Add a z-axis label to a surface plot", "summary": "Set z-axis labels for 3-D plots, surfaces, and MATLAB `zlabel` workflows.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 50), linspace(-3, 3, 50));\nZ = sin(X) .* cos(Y);\nsurf(X, Y, Z);\nzlabel('Height');", "keywords": ["zlabel", "z-axis label", "3-D axis label", "matlab zlabel", "surface axis labeling"], "suggestedPath": "/zlabel-1.m" }, { "id": "zlabel:2", "builtinKey": "zlabel", "builtinTitle": "zlabel", "builtinSlug": "zlabel", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Create a multiline z-axis label and style it", "summary": "Set z-axis labels for 3-D plots, surfaces, and MATLAB `zlabel` workflows.", "code": "[X, Y] = meshgrid(-2:0.2:2, -2:0.2:2);\nZ = X .* exp(-X.^2 - Y.^2);\nsurf(X, Y, Z);\nh = zlabel([\"Depth\", \"(km)\"]);\nset(h, 'FontWeight', 'bold');", "keywords": ["zlabel", "z-axis label", "3-D axis label", "matlab zlabel", "surface axis labeling"], "suggestedPath": "/zlabel-2.m" }, { "id": "zlabel:3", "builtinKey": "zlabel", "builtinTitle": "zlabel", "builtinSlug": "zlabel", "category": "plotting", "categoryPath": ["plotting"], "exampleTitle": "Target a specific subplot axes", "summary": "Set z-axis labels for 3-D plots, surfaces, and MATLAB `zlabel` workflows.", "code": "[X, Y] = meshgrid(linspace(-3, 3, 30), linspace(-3, 3, 30));\nZ = sin(X) .* cos(Y);\nsubplot(1, 2, 1);\nsurf(X, Y, Z);\nax = subplot(1, 2, 2);\nplot3(cos(0:0.1:5), sin(0:0.1:5), 0:0.1:5);\nzlabel(ax, 'Trajectory Height');", "keywords": ["zlabel", "z-axis label", "3-D axis label", "matlab zlabel", "surface axis labeling"], "suggestedPath": "/zlabel-3.m" }];
|
|
4
|
+
//# sourceMappingURL=builtin-examples-catalog.js.map
|