Saving all variables in a single file (ideally an excel file)

조회 수: 8 (최근 30일)
AluminiumMan
AluminiumMan 2024년 2월 22일
댓글: Walter Roberson 2024년 2월 22일
Hi, I was just wondering if there was a way to save all variables in a workspace to a single Excel file? Ideally each variable would be saved as a single tab, but could also simply be added to the next column in a single worksheet tab.
If they can't be saved as an Excel sheet, then what are the other options? Is there another way to save an entire workspace full of variables to a single file?

답변 (1개)

Dyuman Joshi
Dyuman Joshi 2024년 2월 22일
One option is to save all the variables in a workspace to a .mat file.
On the Home tab, in the Variable section, click Save Workspace.
Load the data back into the workspace using load.
Saving the full workspace to an excel file would be a tedious task (especially if you have a lot of variables), as you will have to manually put all the variables in a cell array/table (if they are heterogenous or non-uniform), or concatenate them into a numerical array (if they are compatible for concatenation), and then use any of writecell, writetable or writematrix accordingly.
  댓글 수: 3
AluminiumMan
AluminiumMan 2024년 2월 22일
Is there a way to programatically save the entire workspace as a .MAT file rather than do it manually? And are .MAT files compatable with Tableau?
Walter Roberson
Walter Roberson 2024년 2월 22일
save(FILENAME)
saves the entire current workspace as a .MAT file.

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

카테고리

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

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by