Exchange data from Workspace struct
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jelthe
am 14 Apr. 2016
Kommentiert: Jelthe
am 21 Apr. 2016
Hello,
I want to exchange data from a Workspace struct with my own data. Sounds easy but: MY data (lets call it y) y is a 700x1 double. The data x from the struct is 9000 times 700x1 double. So how can i tell matlab to get in to the struct and exchange every 9000 x with my y. I hope you did understand my question.
I attached an image so you can see i want to do.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161213/image.jpeg)
thanks.
0 Kommentare
Akzeptierte Antwort
Guillaume
am 14 Apr. 2016
Bearbeitet: Guillaume
am 14 Apr. 2016
This is one of the rare case where deal is useful:
[data.data] = deal(y);
Note that your structure is called data and so is the field of the structure. Please come up with some more meaningful names.
I have to ask, what is the point of storing 9599 times the same data?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!