필터 지우기
필터 지우기

Issue with xlsread and merged cells

조회 수: 4 (최근 30일)
Matthew
Matthew 2013년 4월 29일
Hello,
Im trying to import data from an excel file using xlsread. Im currently having an issue when trying to import the "comments" line from the excel file which is in fact 35 cells merged into one in excel.
When trying to import this cell it imports the 35 base cells on the single merged cell, causing me issues as there is multiple comments.
Here is the code below:
[num,str]=xlsread(Bag_Report,2,'B18');
rem1=str
[num,str]=xlsread(Bag_Report,2,'B19');
rem2=str
[num,str]= xlsread(Bag_Report,2,'B20');
rem3=str
[num,str]=xlsread(Bag_Report,2,'B21');
rem4=str
[num,str]=xlsread(Bag_Report,2,'B22');
rem5=str
[num,str]=xlsread(Bag_Report,2,'B23');
rem6=str
remarks = strcat(rem1,rem2,rem3,rem4,rem5,rem6)
Which imports:
rem2 =
Columns 1 through 15
'' '' '' '' '' '' '' '' '' '' '' '' '' '' ''
Any help would be appreciated!
  댓글 수: 1
per isakson
per isakson 2013년 4월 29일
편집: per isakson 2013년 4월 29일
I cannot reproduce (/understand) your problem on R2012a,64bit,Windows7 with Excel installed. However, doc says
When the specified range overlaps merged cells:
On Windows systems with Excel, xlsread expands the range to include
all merged cells.
On systems without Excel for Windows, xlsread returns data for the
specified range only, with empty or NaN values for merged cells

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by