MATLAB - multiple return values from a function?

前端 未结 4 412
隐瞒了意图╮
隐瞒了意图╮ 2021-02-04 23:35

I\'m writing 2 functions in matlab, an initialize function and a function to insert items into an array treating it like a doubly-linked list. However, my initialize function on

4条回答
  •  梦毁少年i
    2021-02-04 23:58

    I think Octave only return one value which is the first return value, in your case, 'array'.

    And Octave print it as "ans".

    Others, 'listp','freep' were not printed.

    Because it showed up within the function.

    Try this out:

    [ A, B, C] = initialize( 4 )
    

    And the 'array','listp','freep' will print as A, B and C.

提交回复
热议问题