Loading a generated array into a visible table in AppDesigner
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Show older comments
0 votes
Hi everyone,
I am creating an application that can be used to display imported data into a table, plot the same data into histograms, scatter plots and general plots.
I have two issues that I would like help on.
How do I pass the results obtained from one function to the next function. for example, how do I get my imported data to plot without repeating the whole code?
Secondly, how can I display my already imported data in form of a table in AppDesigner as it is
Accepted Answer
"How do I pass the results obtained from one function to the next function. for example, how do I get my imported data to plot without repeating the whole code? "
There are several ways to do this. Assuming the import function is defined within your appdesigner file, the cleanest method would be to merely pass the data into the plotting function as an additional input. Alternatively, you could store the data in the "UserData" property of the axis handle and then retreive it from within your plotting function.
app.UIAxes.UserData = myData; %store the data
myData = app.UIAxes.UserData; %retrieve the data from within the plotting function
Secondly, how can I display my already imported data in form of a table in AppDesigner as it is
Here's instructions how to set up the table when the app first starts
And here are some demos showing how to update the table once there is new data
10 Comments
Lui
on 8 May 2019
The second part returns the following error
%No appropriate method, property, or field 'UITablle' for class 'Estimator'.
I'd need to see the relevant section of code that is generating the error. Perhaps a typo (you have two L's in UITable)? Also, perhaps you're trying to access the wrong object. What's the Estimator class object?
Lui
on 8 May 2019
Estimator is the Classdef:
I have loaded and generated a table already. I would like to display using the user interface at on the appDesigner. Please have a look below
M2002=table2array(M2002(:,2:20));
x=M2002;
app.Load_DataButton.UserData = x;
% Cell edit callback: UITable
function UITableCellEdit2(app, event)
x = app.Load_DataButton.UserData;
app.UITablle.Data={x}
%yields the error below
%Error setting property 'Data' of class 'Table':Data within a cell array must have size [1 1]
Error setting property 'Data' of class 'Table':
Data within a cell array must have size [1 1]
Could you share a sample of {x} if it's too large to copy-paste the entire array? My guess is that one of the cells in the array contains more than 1 element. There must be one element per cell in the table.
If your data are a matrix (numeric), then you shouldn't be putting it into a cell array.
Lui
on 8 May 2019
Attached id the file
Adam Danz
on 8 May 2019
Thanks. What happens when you input the matrix (instead of converting it to a cell array)?
app.UITablle.Data= x; % not {x}
Lui
on 8 May 2019
Thank you so much Adam for walking through this with me. I feel like calling you. It works.
haha no problem. Glad I could help.
Lui
on 12 May 2019
hi Adam
Could you please take a look at this? It is part of the problem I am trying to sort
I will appreciate your feedback on this set of problem
Adam Danz
on 13 May 2019
I replied there.
More Answers (0)
Categories
Find more on Noncentral t Distribution in Help Center and File Exchange
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)