필터 지우기
필터 지우기

How to give a name to xlswrite with a dialogue box? (gui)

조회 수: 1 (최근 30일)
Isti
Isti 2012년 4월 29일
Let say i have an matrix M. Then i want to make a excel file which contain this matrix M. The things that i usually use is a kind of static and manually with: xlswrite('test.xls',M).
I don't know how to make a flexible one. What I mean is, when i click "save" in my GUI figure, there'll some kind of dialogue box appear then i will give the name of it's excel file.
What to do? Thanks before :')

채택된 답변

Walter Roberson
Walter Roberson 2012년 4월 29일
Use uiputfile() to get a target file name and target directory. Use fullfile() to splice the two name parts together to get a complete pathname. Pass that pathname to xlswrite()
  댓글 수: 2
Isti
Isti 2012년 4월 29일
could you give a kind of example how to use uiputfile(), fullfile()?
Walter Roberson
Walter Roberson 2012년 4월 29일
[filename, pathname] = uiputfile('*.xls', 'Choose a file name');
outname = fullfile(pathname, filename);
xlswrite(outname, M);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by