Pass variables to the workspace from a function
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
deltanabla
le 15 Jan 2015
Modifié(e) : Sean de Wolski
le 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 commentaires
Réponse acceptée
Sean de Wolski
le 15 Jan 2015
Modifié(e) : Sean de Wolski
le 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!