How i recall a variable?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nuno
el 20 de Mayo de 2015
Respondida: Image Analyst
el 20 de Mayo de 2015
Hello everyone!
I am building a graphic interface in Matlab, and in starting window i select one value (1 or 0) and save it in a variable "plane". In code:
function Iniciar_Callback(iniObject, eventdata)
close figure 1
dname = uigetdir('C:\');
prompt = {'what is number?:'}; dlg_title = 'Window'; num_lines = 1; def = {'1 or 0'};
nomeR = inputdlg(prompt,dlg_title,num_lines,def);
nomeR=cell2mat(nomeR);
if nomeR=='1';
plane=1;
elseif nomeR=='0';
plane=0;
else
errordlg('Plano não valido','ATENÇÃO');
end
assignin('base','plane',plane);
% And i want call plane in next function
function Model_Callback(varObject, eventdata)
How i do? Big thanks
0 comentarios
Respuesta aceptada
Image Analyst
el 20 de Mayo de 2015
Several ways of doing this are in the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
0 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!