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!