importing data from input dialog box to a text file in GUI.
2 views (last 30 days)
Show older comments
the code is as below:
prompt={'Name','Age','Sex','Height(cms)','Weight(kgs)'};
patient =inputdlg(prompt); %dialog boxes to input patient details
[filename, pathname] = uiputfile('*.txt', 'Choose a file name'); outname = fullfile(pathname, filename); %data=[prompt;patient']; fid=fopen(outname,'w');
C1=cell2mat(prompt) C2=cell2mat(patient')
fprintf(fid, '%s \t \n %s ', C1,C2);
fclose(fid);
I want the text file to have the first column as the details in prompt and the second column to have the details corresponding to the details in prompt that are entered by the user in the input dialog box. The output that i am getting right now isn't what I am looking for.any help would be deeply appreciated
0 Comments
Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!