Loading a generated array into a visible table in AppDesigner
显示 更早的评论
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
采纳的回答
"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 个评论
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?
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.
Attached id the file
Thanks. What happens when you input the matrix (instead of converting it to a cell array)?
app.UITablle.Data= x; % not {x}
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.
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
I replied there.
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Noncentral t Distribution 的更多信息
另请参阅
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)
