MATLAB Answers

Pass variables to the workspace from a function

4 views (last 30 days)
deltanabla
deltanabla on 15 Jan 2015
Edited: Sean de Wolski on 15 Jan 2015
Hi Folks,
I want to see the variables and their characteristics in the work space from a function. How can I achieve this? here is a simple code
function addtwo(x,y)
% addtwo(x,y) Adds two numbers, vectors, whatever, and
% print the result = x + y
x+y
Thanks

  0 Comments

Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 15 Jan 2015
Edited: Sean de Wolski on 15 Jan 2015
function z = addtwo(x,y)
z = x+y;
Then call it:
zz = addtwo(1,3)
If you want to stop inside of addtwo, put a breakpoint there and execution will stop (click on the dash to the left hand side of the line number).

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.