Hi All - i'm having difficulty getting my data in the right format and wondered if you could help?
% Here is my data
data = [8; 7; 1; 5]
% I have the row positions of where the data sits in the desired format
datarowpositions = [0; 0; 0; 4; 0; 1; 0; 2; 0; 0; 3; 0]
% This is how I would like the data to be moved into
desired = [0; 0; 0; 5; 0; 8; 0; 7; 0; 0; 1; 0]
Thank you so much for your time.
1 Comment
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/711038-how-do-i-insert-data-into-new-format-based-on-row-positions#comment_1250148
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/711038-how-do-i-insert-data-into-new-format-based-on-row-positions#comment_1250148
Sign in to comment.