How can i retrieve variables created in a function?
31 次查看(过去 30 天)
显示 更早的评论
Hi! I am creating a script where i need to use two functions which i insert in the script. Lets put as an example my function panelgen()--> function [x,z]=panelgen(airf,N,AoA)
Which outputs should be x and z. However when i run it, the output is ans= blabla, and in the workspace there is no evidence of those variables that have been created.
Also, the ans displayed is equal to the first of the variable in the square bracket[x,z] but only to the first one, if i put z in front it will display z.
How can i retrieve those variables to use them in my script?
Thank you very much
0 个评论
采纳的回答
Azzi Abdelmalek
2014-3-28
Call your function:
[x,z]=panelgen(airf,N,AoA)
4 个评论
Azzi Abdelmalek
2014-3-28
You can add inside your function
global a b c % a,b and c are your variables
% Do the same thing in Matlab Windows Command
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Whos 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!