Repeating string variables to form a new string variable
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Hello to all
I`m estimating a VAR and I want to export some results in an Excel sheet. I want to add column names direct from matlab and I did this already. However, the way my VAR is estimated, I need that my column name variable to be of size (1,nvar^2+1), where nvar is the number of variables in the system.
I created a variable called var_names = ['var1', 'var2','var3']; which contains the labels for the variables names.
In this case, where I have 3 variables, I want:
col_names = ['Horizon' var_names var_names var_names];
My question is: How to automatize this repetition? I want this to be a function of nvar so when I estimate a different model with different number of variables I do not have to change this code, so I would have something like:
col_names = ['Horizon' var_names times nvar];
Thank you all in advance.
0 件のコメント
回答 (1 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!