store data from matrix rowwise in indexed structure
Show older comments
Hello everyone, I have a structure 'Sample', which contains many objects (over 1000) with the same attributes. For example sample specific data is stored as a 1x2090 vector under Sample([]).YData. If I want to extract the 'YData' of sample 1 to 151 and store it in a matrix, I simply write
Select = 1:151; YData = vertcat(Sample(Select).YData);
Now I want to write selected data back to structure... Each row of a matrix should be written to the 'YData' of the corresponding sample.
Sample(Select).YData = Matrix;
doesn't work. Is there a way to implement this task in such a simple way or will only a for-loop do this job? Thanks
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!