How to output a large matrix to one excel with multiple sheets in specific size?

조회 수: 1 (최근 30일)
Hello,
I have a large matrix (289x46) which are x and y data. The first 289x23 are x data, and the rest 289x23 are y data. I want to export each column of x and y from the matrix to one sheet in excel, move to the next column of x and y, output again ans so on. Therefor I can have 23 sheets after output. How can I make this happen?
Thank you.

채택된 답변

Voss
Voss 2022년 4월 25일
편집: Voss 2022년 4월 26일
% a 289x52 matrix:
xy = readmatrix('test100_4.4.22cellsmeetcriteria.xlsx');
% write each pair of columns (one x and one y)
% to a sheet of output.xlsx, for the first 23 pairs:
for ii = 1:23
writematrix([xy(:,ii) xy(:,ii+23)],'output.xlsx','Sheet',ii);
end
  댓글 수: 4

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by