export values to specific cell in excell

조회 수: 2 (최근 30일)
lital levy
lital levy 2022년 8월 17일
답변: Sulaymon Eshkabilov 2022년 8월 17일
hello, i want to creat a column in excell from values i get from matlab. example:
for i:1:10
x=i;
xlswrite(data,x);
end
to get in excell- [1 2 3 4 5 6 7 8 9 10]
but it always write only the last value- [10]

답변 (2개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022년 8월 17일
Do not use a loop operation that is not efficient and xlswrite(). Use the following syntax:
writematrix((1:10).', 'MY_Data.xlsx');
  댓글 수: 1
lital levy
lital levy 2022년 8월 17일
thanks but I get my values from a loop, it is location cordinates that changes in every loop, can i save each value and send it to excell?

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


Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022년 8월 17일
Then you may need to use this syntax:
Data = [];
for ii = 1:13
N = ii;
Data = [Data; {N}]; % Accumulate all data in a single cell array
end
writecell(Data, 'MY_data1.xls')
winopen('MY_data1.xls')

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by