Hola, aquí puedes encontrar manuales interesantes como por ejemplo Tutorial de MATLAB 6.0 (http://www.universas.com/matlab/documentacion/matlab60.pdf) que te pueden ayudar.
Yo te propongo un par de soluciones más elegantes y menos engorrosas que las variables globales, y son:
- por una parte utilizar la propiedad 'Userdata' que tiene toda figura de Matlab, aunque te confieso que yo nunca la he utilizado. la ayuda de matlab te dice:
User-specified data. You can specify UserData as any matrix you want to associate with the figure object. The object does not use this data, but you can access it using the set and get commands.
- por otra parte, estan las estructuras.
Para que te vayas familiarizando con las estructuras y como no hay mejor manera de aprender que probando, aqui te escribo unos ejemplos:
Code:
alu.nombre='Miguel'
alu =
nombre: 'Miguel'
alu.carnet=12323
alu =
nombre: 'Miguel'
carnet: 12323
alu
alu =
nombre: 'Miguel'
carnet: 12323
alu.nombre
ans =
Miguel
a1=struct('nombre','Ignacio','Carnet',76890)
a1 =
nombre: 'Ignacio'
Carnet: 76890
alum(10)=struct('Nombre','Pepe','Carnet',544453)
alum =
1x10 struct array with fields:
Nombre
Carnet
alum(10)
ans =
Nombre: 'Pepe'
Carnet: 544453
alum(5)
ans =
Nombre: []
Carnet: []
alum
alum =
1x10 struct array with fields:
Nombre
Carnet
alum.edad=18
??? Incorrect number of right hand side elements in dot name assignment. Missing [] around left hand side is a likely cause.
alum(5).edad=18
alum =
1x10 struct array with fields:
Nombre
Carnet
edad
alum
alum =
1x10 struct array with fields:
Nombre
Carnet
edad
alum.edad
ans =
[]
ans =
[]
ans =
[]
ans =
[]
ans =
18
ans =
[]
ans =
[]
ans =
[]
ans =
[]
ans =
[]