How can I process a '.mat' file??
古いコメントを表示
At this program for example... http://www.mathworks.com/matlabcentral/fileexchange/26367-guitar-tuner
If you download the program you will see there is a ButtonIcons.mat file which I think are the icons for the GUI buttons on the guitar tuner. How can I process this file ??
11 件のコメント
Michael Haderlein
2014 年 8 月 28 日
mat files are binary files which contain variables of any kind. Just drag+drop the file into the workspace window or enter 'load filename.mat' into the command window and the respective variables will be loaded.
John Bitzios
2014 年 8 月 28 日
Adam
2014 年 8 月 28 日
load
to load it into the workspace
save
to save it again. You have to use strings for variable names in saving unless you want to save your whole workspace, but the help explains that.
Michael Haderlein
2014 年 8 月 28 日
save(filename) will overwrite the data in the existing mat file by default. Use the '-append' tag to add data to an existing mat file without deleting the other data in there. If there's no file with this name, it will just be created (however, '-append' will throw an error then).
John Bitzios
2014 年 8 月 28 日
編集済み: John Bitzios
2014 年 8 月 28 日
John Bitzios
2014 年 8 月 28 日
Michael Haderlein
2014 年 8 月 28 日
Well, that's what I said: Open the mat file via load or by drag-and-drop, then change the value of one of the variables and save the mat file again. E.g.
load('D:\MATLAB\fileexchange\GuitarTuner\ButtonIcons.mat')
PlayDisabled=PlayDisabled(:,:,[3,1,2]);
save('D:\MATLAB\fileexchange\GuitarTuner\ButtonIcons.mat')
GuitarTuner
makes the play button appear blue.
John Bitzios
2014 年 8 月 28 日
Michael Haderlein
2014 年 8 月 28 日
Which attribute do you mean? The '-append'? That's described in the help of the function. I guess, the author has either drawn it in some other program (e.g. Paint)and saved it as bitmap. In Matlab it's possible, too, of course, just a bit more work.
John Bitzios
2014 年 8 月 28 日
Michael Haderlein
2014 年 8 月 28 日
Not much work for such a small image, just not as handy as in Paint or similar programs (when I woke up in the morning, I didn't expect to call Paint a handy program today). Anyway, you can just read wiki or similar about RGB images. There will be better explanations along with illustrations than I could ever provide. If you want to know what this [3,1,2] was, just define a little vector a=1:5 and play around with it the same way (a([3,1,2]),a([1,3,5]), whatever). You'll quickly see what happens ;-)
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Audio Processing Algorithm Design についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!