필터 지우기
필터 지우기

How can i retrieve variables created in a function?

조회 수: 25 (최근 30일)
Jacob
Jacob 2014년 3월 28일
댓글: Azzi Abdelmalek 2014년 3월 28일
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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 3월 28일
Call your function:
[x,z]=panelgen(airf,N,AoA)
  댓글 수: 4
Jacob
Jacob 2014년 3월 28일
Already solved. I wanted to know how to get my variables created in my function to the global workspace. Thanks
Azzi Abdelmalek
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 CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by