Borrar filtros
Borrar filtros

How can i retrieve variables created in a function?

26 visualizaciones (últimos 30 días)
Jacob
Jacob el 28 de Mzo. de 2014
Comentada: Azzi Abdelmalek el 28 de Mzo. de 2014
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

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 28 de Mzo. de 2014
Call your function:
[x,z]=panelgen(airf,N,AoA)
  4 comentarios
Jacob
Jacob el 28 de Mzo. de 2014
Already solved. I wanted to know how to get my variables created in my function to the global workspace. Thanks
Azzi Abdelmalek
Azzi Abdelmalek el 28 de Mzo. de 2014
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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by