Hello:
I have two matrices, A and B. Matrix B has some years missing in it. I want to concatenate horizontally two matrices, A and B to a new matrix C, which can be filled with NaN for the missing years.
A = 1981 0.79 1.56 0.90 1.151982 0.62 0.83 0.84 0.741983 0.81 0.71 0.71 0.701984 1.06 0.74 0.61 0.761985 1.23 0.86 0.67 0.611986 1.32 0.56 1.11 0.761987 0.75 1.06 0.56 1.151988 1.76 1.09 0.88 0.671989 0.90 0.77 0.94 0.771990 0.52 0.52 1.15 0.88and B = 1981 1.06171982 1.06821985 1.01491986 0.66071987 0.56421988 0.61941989 0.66931990 0.6966Desired output, C = 1981 1.0617 0.79 1.56 0.90 1.15 1982 1.0682 0.62 0.83 0.84 0.74 1983 NaN 0.81 0.71 0.71 0.70 1984 NaN 1.06 0.74 0.61 0.76 1985 1.0149 1.23 0.86 0.67 0.61 1986 0.6607 1.32 0.56 1.11 0.76 1987 0.5642 0.75 1.06 0.56 1.15 1988 0.6194 1.76 1.09 0.88 0.67 1989 0.6693 0.90 0.77 0.94 0.77 1990 0.6966 0.52 0.52 1.15 0.88
Best Answer