Pass variables to the workspace from a function

조회 수: 1 (최근 30일)
deltanabla
deltanabla 2015년 1월 15일
편집: Sean de Wolski 2015년 1월 15일
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

채택된 답변

Sean de Wolski
Sean de Wolski 2015년 1월 15일
편집: Sean de Wolski 2015년 1월 15일
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개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by