How to change methods access to public in App Designer

Hello, I'm currrently creating an app in App Designer MATLAB. I'm trying to change the header names of a table that is being read in. There are 27 columns so my approach is to read in a MAT file with the header names. App Designer is making it difficult to load the file. I saw an example where the method was switched to public instead of private to make it accessible. How is this possible? The area is grayed out and I'm unsure how to switch it to public.

Risposte (1)

To Answer your specific question, use the interface to create a public function.
However, I'd be surprised if you needed to do this to load a file. Can you share your current code for reading the file along with a sample file (copy/paste the code; use the paperclip icon to attach a sample file).

4 Commenti

Unfortunately, I'm unable to share my code. I can try to give an example of what my code looks like though.
properties (Access = public)
headers = load('Headers.mat');
end
methods(Access = private) %Want to change to public
function fileInput(app, event)
app.headers; %Receives an error saying mat file is not found.
end
end
The error would suggest an issue with locating the mat file, not with reading it.
Make sure 'Headers.mat' is either in your current folder, or in a folder that has been added to your MATLAB path.
It is within the same folder as the app along with other files that have no problem being read in. I'm unsure why the MAT file is the only one giving an error.
Share the actual error message (all the red text).

Accedi per commentare.

Categorie

Scopri di più su Develop Apps Using App Designer in Centro assistenza e File Exchange

Richiesto:

il 29 Apr 2024

Commentato:

il 29 Apr 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by