이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
how to do vector
조회 수: 1(최근 30일)
I have code to run but firstly my data should be balanced panel which I did. however, the second condition is that each variable a N*T vector which I do not know how to do. Could you please advise me how to do this task with thanks
John BG 2018년 4월 7일
this is John BG <mailto:email@example.com firstname.lastname@example.org>
the problem is the line
inside the function pd2.
reshape only works if the input matrix has exactly N*T elements.
To solve the uncertainty, you can do something like the following:
clear all;close all;clc
the previous is just to test it works.
Use something like these 2 ifs: if length of series shorter than N*T, then pad zeros or a value of your choice until you have N*T elements, and then use reshape.
If series has more elements than N*T you have make a decision, a possible policy could be take the N*T initial elements of the input series.
if numel(series)<=N*T % if series length shorter that N*T, add zeros up to N*T
if numel(series)>N*T % if series length larger than N*T,
If you find this answer useful would you please be so kind to consider marking my answer as Accepted Answer?
To any other reader, if you find this answer useful please consider clicking on the thumbs-up vote link
thanks in advance for time and attention