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!