function - How to define array as parameter in MatLab? -
this question has answer here:
i have function:
function recon_mm(lvl, threshold, filetocompress)
i make threshold
array. checked matlab documentation find no clear example how state threshold array,
matlab not statically typed , not have syntax type annotations, can check if parameter scalar , return early.
if isscalar(threshold) error('parameter ''threshold'' must array') return end
note catch 1x1 arrays, e.g. isscalar([1]) == true
.
Comments
Post a Comment