Clear Filters
Clear Filters

Reshape the vector as indexed matrix.

1 view (last 30 days)
Sangeetha R
Sangeetha R on 6 Mar 2020
Edited: Sangeetha R on 10 Mar 2020
I need to reshape each row vector in 'x' to the 2D matrix as indexed in 'idx'. I have written the code and working fine. But it takes more time as the number of rows in x is high. Is there any way to reduce the execution time?
idx = buffer(1:28000,10,5,'nodelay');
for i=1:4732
Elapsed time is 1.450427 seconds.

Answers (1)

Alex Mcaulley
Alex Mcaulley on 6 Mar 2020
Yes, just removing the for loop because this loop doesn't do anything in your code.


Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!