How to make function assign variables that will stick around after the function is done running?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Solarmew
el 20 de Mayo de 2015
Comentada: Star Strider
el 20 de Mayo de 2015
For example:
function test(x)
car.color = x;
end
if i first input
global car
I want car.color to exist after i input test('red')
0 comentarios
Respuesta aceptada
Star Strider
el 20 de Mayo de 2015
Have it return the structure ‘car’ as an output:
function car = test(x)
car.color = x;
end
%
car = test('red')
produces:
car =
color: 'red'
8 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!