How to export data from Matlab to excel for a loop?

后端 未结 3 936
旧时难觅i
旧时难觅i 2021-01-03 15:26

I have a code for \"for loop\"

for i=1:4 statement... y=sim(net, I); end

now

3条回答
  •  生来不讨喜
    2021-01-03 16:18

    You can put xlswrite after for loop.You just want to do is save you result in a matrix.This function can write a matrix. also,you can use [] to combine string to change the range.

    >> for i=1:4
    Range=['A' num2str(i)]
    end
    Range =
    A1
    Range =
    A2
    Range =
    A3
    Range =
    A4
    

    But,this is a bad way.You should open and write Excel file every time.

提交回复
热议问题