make one struct with two datasets

I have two datasets and I want to make them in one struct just like the exmple in the photo that I uploded. how can I do it??

 采纳的回答

Try this:
data.features = rand(84, 1190);
data.labels = rand(84,1);
See the documentation on Create Structure Array (link) for an extended discussion.
Experiment to get the result you want.

5 个评论

you are the best thank you so much
As always, my pleasure.
this functions
data.features = rand(84, 1190);
data.labels = rand(84,1);
changed my datastes values. I want to keep the same datasets?
how can I do it ?
I want to load the data from mat file that I have one for features and second one for labels
@Stephen — Thank you.

请先登录,再进行评论。

更多回答(1 个)

Taha Alars
Taha Alars 2019-4-17
how can I save the struct that I made to new mat file??

类别

在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by