MATLAB - multiple return values from a function? -
i'm writing 2 functions in matlab, initialize function , function insert items array treating doubly-linked list. however, initialize function returns "ans =" , initialized array. how can have set values of other variables? here's code:
function [ array, listp, freep ] = initialize( size ) array = zeros(size, 3); listp = 0; freep = 1; end
matlab allows return multiple values receive them inline.
when call it, receive individual variables inline:
[array, listp, freep] = initialize(size)
Comments
Post a Comment