How to make a three dimensional matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Wietze Zijpp
el 6 de Abr. de 2022
Respondida: Dyuman Joshi
el 7 de Abr. de 2022
Suppose I have the following
function [G,Tstat,P] = Fama_MacBeth(X,Y)
% Inputs:
% X is the matrix of explenatory variables of dimensions TxNxK, where T is
% the sample size, N is the number of assets, and k is the number of
% independent variables;
% Y is the matrix of excess returns of dimensions TxN;
Now I have my data Y of size T x N and X of size T x N.
I know that k = 3. However , how do I transform my matrix X such that it becomes T x N x 3
0 comentarios
Respuesta aceptada
Dyuman Joshi
el 7 de Abr. de 2022
%random example
y = reshape(1:30,5,6);
repmat(y,1,1,3)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!