- how are your original data stored
- how much more data will come (and where).
Data rearrangement inside matrices
Hello!
I am working on data preparation for deep learning. Let's say i have A = 0 variable containg time value, B = [0 0; 0.1 0.1; 0.2 0.2] matrix containing X-axis and Y-axis coordinates and C = [10 20 30; 40 50 60; 70 80 90] matrix containing function values. I need to store the data in an array D where the first column will contain time, the second column will contain X-axis values, the third column will contain Y-axis values and the fourth column will contain function values. It can be manually done pretty simple as
D(1:9,1)=A;
D(1:3,2)=B(1);
D(4:6,2)=B(2);
D(7:9,2)=B(3)
D(1:3,3)=B(1:3);
D(4:6,3)=B(1:3);
D(7:9,3)=B(1:3);
D(1:3,4)=C(1,1:3);
D(4:6,4)=C(2,1:3);
D(7:9,4)=C(3,1:3);
However, in reality there will be much more data. Hence, manual filling is inefficient. Is there any function to automize this procedure? Or should i create the for loops?
Thank you,
Alex
2 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!