I have a data points in a text document named data.txt. This file contains 1000 data points of random numbers in the form below
0.0773
0.6455
-0.9333
etc.
This data points is called xn if loaded.
The requirement is to find X such that X is a column vector of xn-1 and xn-2. How do I iterate through the data points of xn to get xn-1 and xn-2 and then combine xn-1 and xn-2 to form a colum vector called X. Your suggestions pls

 채택된 답변

Rik
Rik 2022년 1월 26일

0 개 추천

No loops required:
xn=rand(1000,1);%replace this with the code reading your text file
X=[xn-1;xn-2];

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Large Files and Big Data에 대해 자세히 알아보기

질문:

2022년 1월 26일

답변:

Rik
2022년 1월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by