Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 100-by-1000.

1 Ansicht (letzte 30 Tage)
I need help please!!!!
This is my code:
%%
%------------- Punto 2 - Taller 1 ------------%
%clearvars ,close all clc;
%Definiendo tiempo
T = 100;
%Parámetros
s = 0.2 ;
n = 0.02 ;
d = 0.1 ;
alfa = 0.36;
%Valor inicial de A
A_0 = 1 ;
%Iniciando serie de tiempo
k = zeros(T,1000);
c = zeros(T,1000);
y = zeros(T,1000);
S = zeros(T,1000);
%Valores iniciales
k_ss = ((s*A_0)/(d+n))^(1/(1-alfa));
y_ss = A_0 * (k_ss^alfa) ;
c_ss = (1-s)*y_ss ;
s_ss = s*y_ss ;
e_ss = 1 ;
k(1) = k_ss ;
y(1) = y_ss ;
c(1) = c_ss ;
S(1) = s_ss ;
%Vector de Shocks Aleatorios
e = randn(T,1000);
%Modelo No Lineal
for time = 1:T-1
for i = 1:1000
k(time+1,i) = ((s*A_0)/(1+n))*exp(e)*(k(time,i)^alfa)+ ((1+d)/(1+n))*k(time,i);
%y(time+1,i) = k(time-1,i)^alfa;
%c(time+1,i) = (1-s)*y(time-1,i);
%S(time+1,i) = s*y(time-1,i);
end
end

Antworten (1)

Daniel M
Daniel M am 7 Okt. 2019
exp(e(time,i))

Kategorien

Mehr zu Genomics and Next Generation Sequencing finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by