- Is it worth the trouble for you to transfer those matrices to an sql-database? (You don't want to store the mat-files themselfs in the database.)
- Are you comfortable working with sql-databases?
- What do you plan to do with this data?
- Over how long a period of time?
how can we create database with .mat files ?
22 次查看(过去 30 天)
显示 更早的评论
hello
i have .mat files
its contain heart beat
i want to add it to database and then link it to matlab
how i can add these type of file to database ?
I've attached here one of them here
4 个评论
per isakson
2019-4-23
编辑:per isakson
2019-4-23
Rahaf mutlaq, My questions are not relevant because I missed the context. Thank you for the answers.
回答(1 个)
Walter Roberson
2019-4-19
Yes, it is possible. It is, however, of low value to do so.
.mat files are just files, so they can be read in as arrays of uint8, and those arrays of uint8 can be stored as blobs in a database.
However, all you can do with those blobs is ask about things like the length of the blob, or retrieve the blob in case you wanted to do something like compress the blob as part of a corpus of tests on how well various compression routines do.
To go beyond that, to examine the contents of the .mat that you had stored, you would need information about the detailed binary structure of .mat files. That is documented for MAT5.0 format, but is not completely documented for MAT7.0 files. For MAT7.3 files, all that is documented is that it is a modified HDF5 format.
It is possible to retrieve a blob from the database, write it out to a temporary file, and then use the usual facilities such as load() to retrieve information from the temporary file that was saved from the blob. Many people would suggest that if you were going to do that, then you might as well just store the original files.
Some various recommendations on what you have to tell Microsoft Access in order to store BLOB:
... You still haven't answered my question at https://www.mathworks.com/matlabcentral/answers/451967-mat-files-database#comment_695325
13 个评论
Walter Roberson
2019-4-22
You changed
chosen_file = fullnames{choice};
into
popumpmenu1_Callback = fullnames{choice };
which you should not have done: it should be left as chosen_file
Also, you should not set(handles.popupmenu1_Callback, etc), you should set(handles.popupmenu1, etc)
Note: for this code to execute, something will need to have set handles.popupmenu1 to the handle of a uicontrol style listbox or style popup.
For the callback to work, something will need to have set handles.popupmenu1 'Callback' property to invoke popmenu1_Callback passing in the current handles structure as the third parameter; also, handles.axes_for_plotting_data would have to have been set to an axes handle.
Furthermore, the reference to datastruct.NameOfVariableYouStoredDataInto needs to be adjusted to use the name of the variable that the data is stored in, inside your .mat file.
If you were to create a GUI using GUIDE, then the handles structure and callback property would be set up properly as long as you had given the listbox the tag 'popupmenu1' and you had created an axes that you gave the tag 'axes_for_plotting_data' to.
In practice, if you were to create a GUI using GUIDE, then the *_Callback functions would not terminate with an "end" statement like you have here. You need that "end" if you have that function inside a script, but in practice GUIDE GUIs generate code in function files, not in scripts.
Walter Roberson
2019-4-25
Value of a pop-up menu or listbox is the number of the entry that the user had selected. If the String property was a cell array of three character vectors, and the user selected the second of them, then the Value property would be set to 2. It is not the content of the string that was selected, but you can retrieve the String property and index that at the Value property to get the content of what was selected.
For readability I constructed the popup to have only the base filenames such as 's0010_rem', but for each of those, we need to know the complete filename with directory. You could mnake the complete file name part of what was displayed to the user, but that is generally a waste of space and harder to read. So instead we store the complete names in the UserData property of the uicontrol. The callback retrieves the Value (index number) and we use that to index into the list of complete file names we stored in the UserData property in order to find the complete name of the file to read.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!