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??

 Respuesta aceptada

Star Strider
Star Strider el 17 de Abr. de 2019
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 comentarios

Taha Alars
Taha Alars el 17 de Abr. de 2019
you are the best thank you so much
Star Strider
Star Strider el 17 de Abr. de 2019
As always, my pleasure.
Taha Alars
Taha Alars el 18 de Abr. de 2019
Editada: Taha Alars el 18 de Abr. de 2019
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
Stephen23
Stephen23 el 18 de Abr. de 2019
S = load(...)
Star Strider
Star Strider el 18 de Abr. de 2019
@Stephen — Thank you.

Iniciar sesión para comentar.

Más respuestas (1)

Taha Alars
Taha Alars el 17 de Abr. de 2019

0 votos

how can I save the struct that I made to new mat file??

2 comentarios

save('NameOfNewFile.mat', 'data')
Star Strider
Star Strider el 17 de Abr. de 2019
@Walter — Thank you.

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 17 de Abr. de 2019

Comentada:

el 18 de Abr. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by