1

I'm calling a function with 2 outputs: 2 vectors of different size.

I need to use 2 vector of different size (outside of the function) that are calculate inside of the function.

How can I use both vectors out of that function?

Thanks

yemino
  • 814

1 Answers1

2

Lets call the output vectors $X$ and $Y$, say we want to add them (I know they are of different size but this is hypothetical), so we want $X+Y$.

Write the function firstcode and execute the script:

[X,Y]=firstcode;

Z=X+Y;

disp(Z)
Daryl
  • 5,598
Ellya
  • 11,783
  • You can properly typeset code using the curly braces option {}. This corresponds to putting the code between ` marks inline and indenting by four spaces for block code. – Daryl Apr 02 '14 at 01:42
  • 1
    Would you mind fitting it for me so I can see? – Ellya Apr 02 '14 at 06:04