|
On Aug 19, 11:27=A0pm, Learner <cnfengshu...@gmail.com> wrote:
> Hi,
>
> I have a large time-series data containing many funds. Now I have a
> m.file that works for one sample fund (fund 1) to generate the values
> of variable y. =A0How can I do the samething for all the funds, and get
> the result in one file, as below.
>
> id =A0x1 x2 x3 =A0y
> 1 =A0 ... ... =A0... =A0...
> 1 =A0 ... ... =A0... =A0...
> 1 =A0 ... ... =A0... =A0...
> 2 =A0... ... ...
> 2 =A0... ... ...
> 2 =A0... ... ...
> 2 =A0... ... ...
> 2 =A0... ... ...
> 3 =A0... ... ...
> 3 =A0... ... ...
>
> I thought about writing the data of each fund into matlab one by one,
> and then repeat the code on the sample fund, and Concatenate the
> results.
>
> Is there any better way to do this?
>
> Thanks!
-----------------------------------
Learner:
Turn the m file into a function that can be called from another m file
- the main one. Have your main function run your function for every
fund, returning an array each time that you save into another 2D
array. Then write out the 2D array using xlswrite() or to a csv file
using fprintf().
Regards,
ImageAnalyst
|