Hello All, I am total new bee with MATLAB, hence I am still not able to find the solution for the above question. My task is: Once I click the button, I will extract the file name and also load the data in the file (.xlxs format) and the file name must get displayed in the edit field when I click the button and select a file.
Below is the code I am trying implement.
% Callbacks that handle component events methods (Access = private) % Button pushed function: motorButton function motorButtonPushed(app, event) file = 'C:\Users\acer\Desktop\sample'; [pathstr,name,ext] = fileparts(file) disp(name) set(app.EditField.Value,'String', convertCharsToStrings(name)) % app.EditField.property=convertCharsToStrings(name) end % Value changing function: EditField function EditFieldValueChanging(app, event) fig = uifigure; ef = uieditfield(fig); ef.Value = 'New sample'; % app.EditField.value=1; % changingValue = event.Value; % app.EditField.value=num2str(name); end end I am able to store the filename in the variable called "name", and I want to display this filename on the EDITFIELD area. But for this should I write a call back function in the motorButton section of code OR should I write a seperate call back function for the EDITFIELD section of code? So. may I know, what is exactly the work around this feature? Please suggest me with a detailed solution (code) if possible. This is the output I am fecthing for the above code.