Info

This question is closed. Reopen it to edit or answer.

How to take all results from for loop?

2 views (last 30 days)
ナオミ 浅川
ナオミ 浅川 on 22 Oct 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
I have for loop in following coding.I want to output all results of calculation in the execl but it only shows the last results.
Can anyone help/ give me an example to do that please?Thanks in advance
p=10
for i=[1 2 3 4 5]
p=2*p
T = table(p)
filename = 'data1.xlsx';
writetable(T, filename, 'Sheet', 1)
end

Answers (0)

Community Treasure Hunt

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

Start Hunting!