Writing into excel sheet from matlab
조회 수: 4 (최근 30일)
이전 댓글 표시
I would like to write a matrix (1xn ) generated during each iteration of for loop into an excel sheet. during the first iteration the matrix should be entered into row 1, second iteration should update row2 and so on... using writematrix function in matlab. Please help me with a solution.
댓글 수: 2
Dyuman Joshi
2023년 10월 11일
Store the values in an array and use writematrix.
What seems to be the problem?
답변 (2개)
Binaya
2023년 10월 11일
Hi
You can directly use "writematrix" or use convert the matrix into a table and use "writetable" functions to write into an excel sheet.
Regards
Binaya
댓글 수: 0
KSSV
2023년 10월 11일
N = 10 ;
iwant = zeros(N,1) ;
for i = 1:N
iwant(i) = i ;
end
T = table(iwant) ;
writetable(T,'Test.xlsx')
댓글 수: 1
Dyuman Joshi
2023년 10월 11일
Why convert to a table when one can directly save the array via readmatrix?
참고 항목
카테고리
Help Center 및 File Exchange에서 Text Files에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!