楼主: 安财学子
1573 1

[问答] matlab数据处理过程中出现:带有下标的赋值维度不匹配 [推广有奖]

  • 1关注
  • 0粉丝

博士生

0%

还不是VIP/贵宾

-

威望
0
论坛币
3414 个
通用积分
2.3508
学术水平
0 点
热心指数
2 点
信用等级
0 点
经验
4210 点
帖子
23
精华
0
在线时间
411 小时
注册时间
2014-2-28
最后登录
2025-3-6

楼主
安财学子 学生认证  发表于 2019-9-1 10:37:51 |AI写论文
20论坛币
missing=sum(isnan(data)')';                                             % Location of Missing Values                        

sample=zeros(NT,3);                                                     % Sample of Complete Data        

sample(:,1)=ones(length(Y),1);sample(missing>0)=0;                      % Sample of Complete Data        
        
balanced_indi=repmat((1:N),T,1);sample(:,2)=balanced_indi(:);           % Index of Individuals
   
sample(:,3)=repmat((1:T),1,N)';                                         % Index of Time
   
Qadj=Q(sample(:,1)==1);                                                 % Values of Qit on the Adjuted Sample

Xadj=X(sample(:,1)==1,:);                                               % Values of Xit on the Adjuted Sample

sampleAdj=sample(sample(:,1)==1,:);                                     % Adjusted Sample

NT=sum(sample(:,1));                                                    % Total number of observations

% Centered Endogeneous Variable

y_cent=centered(Y,sample);                                   % Vector of Centered Data

% Centered Explicative Variables X(i,t)

for indic_k=1:K                                             % Loop on the number of explicative variable
      
    x_cent(:,indic_k)=centered(X(:,indic_k),sample);         % Centered Vector of X
   
end



if nargin==5
   
    disp('WARNING: Initial Condition Provided by User')
   
else                                               % Begin of the condition on initial condition provided by user

红色部分循环提示“带有下表的赋值维度不匹配”,求教解决方法。


关键词:MATLAB atlab matla 数据处理 Mat 赋值维度不匹配 matlab 数据处理

沙发
安财学子 学生认证  发表于 2019-9-1 10:43:34
样本是面板数据,N*T,因变量Y 自变量X 控制变量Q

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 06:55