Non Compatible Indices, Combining array sections
Show older comments
Hi All,
I am trying to pull certain elements from a large 1x30000 double (Say P) to create a smaller 1x3600 double (Say H). I am currently getting an error "Unable to perform assignment because the indices on the left side are not compatiblewith the size of the right side." I am guessing that is because what I have written is not adding the different k values together and is getting stuck at k=1. Any help would be much appreciated.
n=60;
Res=5;
S=1640;
for k = 1:n
H(k) = (P((S+((k-1)*48*Res)):(S+(12*Res)+((k-1)*(48*Res)))));
end
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!