Copying values between two index number
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
651 1338 1997 2679 3394 4222 4879 5619 6313 7047 7624 8408
1 1 1 1 1 1 1 1 1 1 1 1
0 1,34 1,28 1,33 1,39 1,61 1,28 1,44 1,35 1,43 1,12 1,53
Hi Everyone,
I have the above table, which in the first row the location is represented and in the third some kind of time interval. Now I want to copy the values of the third row between 1:2500, 2500:5000 and so on of the first row. How can I do this?
Thank you!
1 comentario
Image Analyst
el 17 de En. de 2019
This does not make sense: "Now I want to copy the values of the third row between 1:2500, 2500:5000 and so on of the first row."
Are you copying values of "the third row", OR of "the first row"? Or both?
What, exactly is being copied? And where is it copied TO? A new variable? Vectors? A matrix?
Respuestas (2)
madhan ravi
el 17 de En. de 2019
https://www.mathworks.com/matlabcentral/answers/440210-how-can-i-copy-a-column-i-already-have-and-add-it-on-to-the-end-of-my-matrix#answer_356811- see if it helps make sure you read all the comments there
0 comentarios
Andrei Bobrov
el 17 de En. de 2019
P = [651 1338 1997 2679 3394 4222 4879 5619 6313 7047 7624 8408
1 1 1 1 1 1 1 1 1 1 1 1
0 1.34 1.28 1.33 1.39 1.61 1.28 1.44 1.35 1.43 1.12 1.53];
out = accumarray(ceil(P(1,:)'/2500),P(end,:)',[],@(x){x});
0 comentarios
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!