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

 채택된 답변

Star Strider
Star Strider 2019년 4월 17일

0 개 추천

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

Taha Alars
Taha Alars 2019년 4월 17일
you are the best thank you so much
Star Strider
Star Strider 2019년 4월 17일
As always, my pleasure.
Taha Alars
Taha Alars 2019년 4월 18일
편집: Taha Alars 2019년 4월 18일
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
S = load(...)
Star Strider
Star Strider 2019년 4월 18일
@Stephen — Thank you.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Taha Alars
Taha Alars 2019년 4월 17일

0 개 추천

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

댓글 수: 2

save('NameOfNewFile.mat', 'data')
Star Strider
Star Strider 2019년 4월 17일
@Walter — Thank you.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기

태그

질문:

2019년 4월 17일

댓글:

2019년 4월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by