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 回表示 (過去 30 日間)
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

回答 (1 件)

Daniel M
Daniel M 2019 年 10 月 7 日
exp(e(time,i))

カテゴリ

Help Center および File ExchangeGenomics and Next Generation Sequencing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by