writing series values in excel file columns using matlab

조회 수: 1 (최근 30일)
ahmed obaid
ahmed obaid 2015년 8월 19일
댓글: ahmed obaid 2015년 8월 19일
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 ?

답변 (1개)

Morteza
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 );
  댓글 수: 1
ahmed obaid
ahmed obaid 2015년 8월 19일
thank you sir for your reply ,,, sir is there any method to deal with columns and rows as numbers for example instead of char(column-range+1) can use any other expression to write an values one by one in each column cell ,, my values are 50 values ... thanks

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

카테고리

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