loading xn data signals of data.txt

1 次查看(过去 30 天)
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
No loops required:
xn=rand(1000,1);%replace this with the code reading your text file
X=[xn-1;xn-2];

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by