xlswrite too large imput

조회 수: 31 (최근 30일)
Pablo Gomez Gómez Gonzalo
Pablo Gomez Gómez Gonzalo 2017년 6월 20일
댓글: Yixin 2023년 7월 30일
Hi everybody.
I' trying to save a very large cell matrix (1 393 120 x 15) to a xlsx, but xlswrite returns: 'The specified data range is invalid or too large to write to the specified file format. Try writing to an XLSX file and use Excel A1 notation for the range argument, for example, ‘A1:D4’.' Does anybody knows how could I do this?
Thank you!
PS: my code is xlswrite('C:\Users\***\CompresorCompleto.xlsx',DatosTot.raw); where * are the full path (and it's ok, I check it) and DatosTot.raw is the matrix I want to write
  댓글 수: 3
Walter Roberson
Walter Roberson 2017년 9월 9일
But 1393120 is more rows than is supported by Excel.
Gaurav Kumar
Gaurav Kumar 2019년 4월 20일
Dont forget to put extenstion after name of file
eg if file is xyx then write command as 'xlswrite("xyz.xlsx", data);
Hope it works for you. It worked for me. All the best

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

채택된 답변

Eric
Eric 2017년 6월 20일
The maximum number of rows in a single worksheet for newer versions of Excel is 1,048,576 according to https://support.office.com/en-us/article/excel-specifications-and-limits-1672b34d-7043-467e-8e27-269d656771c3. You're trying to create a worksheet with too many rows.
  댓글 수: 3
pavan balla
pavan balla 2021년 10월 9일
The reason for this error is when you try to save values other than 1x1 dimensions, you will face this error. Try using another method to save your values.
Walter Roberson
Walter Roberson 2021년 10월 10일
The user specifically said they are trying to save a very large cell matrix (1 393 120 x 15) which is over 1 million rows. And since the user specifically named a number over 1 million, then it is highly likely that they were indeed wanting to write over 1 million rows, as opposed to being mistaken about whether that was what they wanted to do.

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

추가 답변 (2개)

Jan
Jan 2017년 6월 20일
The documentation explains:
Input matrix, specified as a two-dimensional numeric or character array, or, if each cell
contains a single element, a cell array.
Does this match your DatosTot.raw? If so, there must be another problem. Let's ask an internet search engine for the maximum number of cells in an Exel column:
Excel 2007, 2010 and 2013 support 1'048'576 rows (2^20)
This means, that an XLSX file cannot carry 1'393'120 rows.

Seyedali Mirjalili
Seyedali Mirjalili 2018년 1월 28일
I had the same issue and managed to fix it. I was trying to create a file that did not exist in the path. So, I created the file manually and surprisingly the error disappeared. Sounds like magic, but it worked for me every single time.
  댓글 수: 1
Yixin
Yixin 2023년 7월 30일
Thanks a lot!It works on my computer.

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

카테고리

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