how to see a variable of a function in the Workspace?

How to see a variable of a function in the Workspace?

4 comentarios

What varibles? what functions? post an example
How to see variables in_1, out_1, and internal in the Workspace?
function [ out_1 ] = test( in_1 )
out_1 = in_1 + 1;
internal = [ 1 2 ];
end
function out_1 = test( in_1 )
global internal
out_1 = in_1 + 1;
internal = [ 1 2 ];
Save this function as test.m then in Matlab Windows command type
global internal
in_1=10 % set a value to in_1
out_1 = test( in_1 )
internal

Iniciar sesión para comentar.

 Respuesta aceptada

function y=som(x,y,z)
global a b
a=x*y
b=y^z
y=a+b
When you call the function som
global a b
y=som(1,2,3)

Más respuestas (0)

Categorías

Más información sobre Variables en Centro de ayuda y File Exchange.

Preguntada:

el 14 de Ag. de 2016

Editada:

el 14 de Ag. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by