Skip to content

MATLAB Cheat Sheet

Timo Denk edited this page Oct 17, 2018 · 7 revisions

List of commonly used (or looked-up) MATLAB commands.

Extract array from tensor: arr = squeeze(tensor(4,:,:))

Shape of tensor: size(tensor)

Random integers within bounds (docs): r = randi([-min max],1,num)

Comment: code; % comment multi-line with %{ ... %}

Reshape: B = reshape(A,sz1,...,szN)