writing series values in excel file columns using matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
Q :\ i need to write values in excel file columns , where my code is successfully write values from column A to columns Z and if my values exceed that char which mean more than 26 values its give me writing error because the column name after column z is AA , AB , AC .. and so on , i need to write values in these columns how we can do that please ?
i use the following code for long time
row_range = '2';
column_range = 'B';
for i:1 length(file list)
file_range = strcat(row_range ,column_range);
xlswrite('D:\wilyam.xls',{images}, 'Sheet1', file_range);
column_range = char(column_range + 1);
end
row_range = char(row_range + 1); %Moving to the next row
Q:\ how we can we write in columns AA , AB , AC ,,,, etc ?
댓글 수: 0
답변 (1개)
Morteza
2015년 8월 19일
Here is the simple way:
x = {'Enter name for excel file :'};
y = 'Entery.';
z = 1;
o = {''};
options.Resize = 'on';
options.WindowStyle = 'normal';
options.Interpreter = 'tex';
answer = cell2mat(inputdlg(x,y,z,o,options));
if isempty(answer) == 1
return
end
ndata = rand(50);
[S,W] = size(ndata);
str = nan(S+1,W+1);
Time = num2cell(zeros(S,1));
STR = num2cell(zeros(1,W));
for i = 1:S+1
for j = 1:W+1
if i ~= 1
if j ~= 1
str(i,j) = ndata(i-1,j-1);
end
end
end
end
xlswrite(answer,str );
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!