I have a simple matlab code using transition matrix and doing monte carlo simulation. I have attached the code.
What I need you to do is: Write the results of each run in excel with the changing pattern size. The code just write the last numbers as usual. I would like to see each run results for an array called "pattern". For example "pattern" will be like this (Assuming that t=3 and;
Run1--- 45 12 17 17 17
Run2--- 56 24 24
Run3--- 7 45 45 21
In the matlab code below: pattern: Visit pattern to company, say customer visited company 2 then company... , so the pattern 2-3... Pr: Number of times company i visited Seq: Number of times company sequential visits to company i [Here is the transition matrix excel]
clear all;
clc;
t=10;
for ii=1:t
.
%(The codes created the pattern array)
.
filename=('output1.xlsx');
xlswrite(filename,pattern,sheet1,'B2:NT2');
end
When I use the code it gives me only the last result when ii=3;
Run3--- 7 45 45 21
It does not have to be excel, other output file will be ok too. I tried to use sprintf but it does not work.
Thank you in advance.