Download file from MatLab
이전 댓글 표시
I'm currently working in MatLab AppDesigner. I am trying to get MatLab to download the contents of an editable Text Area as a specific type of file (.cfile) and save this file to a specific location. The user should be able to edit the code of the file in the Text Area, and then click a button which will cue MatLab to download the file as a .cfile and save it to a specific location on the user's device. Initially, the Text Area will contain a default code setup, which the user can modify before downloading. I am relatively new to MatLab; does anyone know how I could do this? Thanks!
댓글 수: 10
Rik
2018년 8월 2일
Download means it is loaded from a web page of some sort, but the rest of your description sounds like it's just saving a file.
Hanna Al-Kowsi
2018년 8월 2일
Rik
2018년 8월 2일
Then I would create a figure with a text field and a save button. The callback function for that uicontrol button would then use get to load the contents of the text field to a cell array. You can use uiputfile to ask te user for a file location. Then the writing of the file depends on your file format.
Hanna Al-Kowsi
2018년 8월 2일
Hanna Al-Kowsi
2018년 8월 2일
Rik
2018년 8월 2일
I mentioned several functions. Did you read the corresponding documentation pages?
Hanna Al-Kowsi
2018년 8월 3일
편집: Hanna Al-Kowsi
2018년 8월 3일
Rik
2018년 8월 3일
The uiputfile function asks the user for a location to save your file to, it doesn't write the file. With the writing of the file we can't help you because you didn't give a description of the file format.
Hanna Al-Kowsi
2018년 8월 3일
Rik
2018년 8월 3일
If it is just a text file with some extension, you should be able to find plenty of examples how to write the contents of a cell to a text file. I could find what type of file it would be, as there isn't even a filext page.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Downloads에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
