Could any body help me to put mat file in workspace from current folder in gui surface ?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Onur PEKER
el 22 de Feb. de 2014
Editada: Onur PEKER
el 22 de Feb. de 2014
I am trying this code but it is not working.Nothing is changing in workspace when I push button which name is airflow_input
if true
function airflow_input_Callback(hObject, eventdata, handles)
airflow_input=importdata('airflow_test_data.txt');
load('norm_airflow_area'); load('norm_airflow_dev');
end
0 comentarios
Respuesta aceptada
Jan
el 22 de Feb. de 2014
Your observation is correct. Each function has its own workspace in Matlab. The contents of the files are loaded into the callback's workspace, but they are deleted as soon as this function is left afterwards. Try this:
function airflow_input_Callback(hObject, eventdata, handles)
airflow_input = importdata('airflow_test_data.txt');
area_data = load('norm_airflow_area');
dev_data = load('norm_airflow_dev');
disp(area_data)
disp(dev_data)
end
You see, that the variables are imported, but not forwarded magically to the base workspace of the command window. If you really want to do this, use:
assignin('base', 'area_data', area_data);
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Whos 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!