function c = wv_vec(v) % WV_VEC Wrap a vector so that jsonencode always produces an array. % % jsonencode(5) is 5 and jsonencode([5]) is also 5, so a per-method quantity % arrives on the JavaScript side as a bare number whenever a lab happens to % show one method. A cell array of scalars always encodes as an array. c = num2cell(v(:)'); end