Hello All,
would you be so kind, can you help me resolve my problem? I dont know how to save data, which I have loaded into uitable in guide. I need analyze these data...I need access to data after closing figure...:( My uitable contains about 80 000 rows.

4 Kommentare

Geoff Hayes
Geoff Hayes am 7 Nov. 2015
Radoslav - how did the data get loaded into the uitable in the first place? From a file that the user selected or was it generated by the business logic of the GUI?
Radoslav Vandzura
Radoslav Vandzura am 7 Nov. 2015
Bearbeitet: Radoslav Vandzura am 7 Nov. 2015
from a file....I push pushbutton load data....
Geoff Hayes
Geoff Hayes am 7 Nov. 2015
Bearbeitet: Geoff Hayes am 7 Nov. 2015
Since the data is from a file, then you already have access to it even after the GUI has closed. I don't understand why you feel that you somehow need to save it the workspace or perhaps a mat file if you already have the data.
Radoslav Vandzura
Radoslav Vandzura am 8 Nov. 2015
But I dont want to save it on my desktop (or directory), I want to save it in Matlab memory because I want to close actual figure and I want to open new figure where I will analyze data (call the variables, data).
I create aplication in guide which is designed for data mining (data analysis) and it consists from many figures. Every figure is for different part of analysis, first figure is for data loading and saving. Next figure is for cleaning the data, next is for visualization and so on. So I need to access to data all the time. Do you understand? :)

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Image Analyst
Image Analyst am 7 Nov. 2015

0 Stimmen

If you've closed the figure, any data stored in the figure is lost. The only way to get it again is to write it to a file. You can use xlswrite, dlmwrite(), fprintf(), save(), or a bunch of other ways.

7 Kommentare

Radoslav Vandzura
Radoslav Vandzura am 7 Nov. 2015
And when i want to create save button what i shoult write inside the function?
It doesn't need to be a special button just for calling save() - you can put the call in to save anywhere in your code that you want to save the variable to a .mat file. Let's say you want to save a variable called "data", you'd do
folder = 'c:/whatever';
baseFileName = 'SavedData.mat';
fullFileName = fullfile(folder, baseFileName);
% Save the variable to the .mat file on disk.
save(fullFileName, 'data');
To recall later in the command window or an m-file:
storedStructure = load(fullFileName);
data = storedStructure.data;
Radoslav Vandzura
Radoslav Vandzura am 8 Nov. 2015
I have created function for save data:
function pushbutton4_Callback(hObject, eventdata, handles)
get(handles.edit3,'data') %edit3 is tag for uitable object
and then i close the figure...
Later I need call some variable of my excel file, for example...
I have column named 'Age'. How can i call this column and do min a max age of this column?
From the help for table:
LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
% Create a table, T, as a container for the workspace variables.
t = table(Age,Height,Weight,BloodPressure,...
'RowNames',LastName)
% Read from Excel file
% t = readtable(fullFileName);
% Extract all rows in the 'Age' column:
ageColumn = t{:,'Age'}
% Get the max of all the ages:
maxAge = max(ageColumn)
Radoslav Vandzura
Radoslav Vandzura am 8 Nov. 2015
yes, but I have many rows...a can not write all of them...I only need call variables (first variable, second.....) and do operations on this.
Image Analyst
Image Analyst am 8 Nov. 2015
I don't understand. The code does not depend on whether you have many or few rows. And it does do operations - you saw how I called the max() operation. Do you still have a problem with the code? If so, let's see it.
Radoslav Vandzura
Radoslav Vandzura am 11 Nov. 2015
Bearbeitet: Radoslav Vandzura am 11 Nov. 2015
I would like to show in graph variables which I have loaded into GUIDE (through button Load). After loading data, names of columns are in pop-up menu. But when I select some name of columns nothing is shown in graph, any axes.....I would like to do it due to analysis which i will do...but I dont know it is stored somewhere or not....because after pressing start, only one variable (ans) is shown in workspace and it is empty....I dont know why....and I think it is a reason why axes arent shown ....

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by