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

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -