MATLAB: How to import matrix to app designer app designercell arraydata import I have a cell array in my matlab workspace. How do I import it or use its data in code written in app designer? Best Answer Before 2017b,there was a workaround to pass data from workspace to appdesigner. Please refer this link for the method:https://www.mathworks.com/matlabcentral/answers/284140-call-an-mlapp-with-input-argument-sIn 2017b,the problem is resolved:1) If you want to share/load data from outside the app, try the following: a) You can load data from a MAT file in appdesigner code as shown below (inside a callback function): >> mydata = load('data.mat'); % This will load all the variables in data.mat to mydata structure b) If you would like to load your data at the initialization phase of the app, add the above code in "startupFcn" callback of the app. c) You can read data from base workspace as shown below. >> data = evalin('base','varName'); % varName is in MATLAB base workspace https://www.mathworks.com/help/matlab/ref/evalin.html2) If you want to share data among callbacks of the app, you can create additional public/private properties of the app and store data in these proprieties. Refer to the following documentation page for additional information on this. https://www.mathworks.com/help/matlab/creating_guis/share-data-across-callbacks-in-app-designer.html3) If you want to pass data from app to other external function or to the base workspace, you can do this as shown below: >> app = myTestApp; % call app and assign to a variable >> % Retrieve public properties (x,y) of the app >> x = app.x; >> y = app.y; Related SolutionsMATLAB: How to export app data in the workspace There are multiple options. You can use one of the followingassigninexport2wsdlg.save it in a mat file.Please look at the following answer thread:https://www.mathworks.com/matlabcentral/answers/274564-store-matlab-app-designer-variables-to-work-space MATLAB: Creating a delete button in App Designer Leah - your delete button callback could look something likefunction DelButtonPushed(app, event) app.OutButton.Text = app.OutButton.Text(1:end-1);endI'm assuming that app.OutButton.Text is just a string that we can then remove the last character from. Related QuestionHow to access and interact with the variables loaded in the AppPassing workspace variable to matlab App DesignerUnrecognized function or variable in app designerHow to pass gui output to workspaceAppdesigner: Using a app’s method from another appCalling the code behind PushButton Pressed Event
Best Answer