How to add classes number to a mat file containing feature vector of each image in a row, lets say 25 images therefore matfile having total 25 rows?

3 次查看(过去 30 天)
i am writing a code to classify 5 classes, each class have 10 images.
1. i am first extracting their feature vectors and saving them in a mat file.
2. i am saving them in row wise manner each image feature vector occupy one row, therefore there are total 5*10= 50 rows of feature vectors indicating each image (total 50 images).
3. as i have 5 classes, i want to add a class number with each feature vector. For example first 10 images belongs to class 1, next 10 images belongs to class 2 and then next 10 images belongs to class 3 and so on... the format would be like below:
class FeatureVector
1 #some value
1 #some value
1 #some value
1 #some value
1 #some value
1 #some value
1 #some value
1 #some value
1 #some value
1 #some value
2 #some value (below would be 9 more classes of 2 and after that 10 classes belongs to 3 and so on)
how can i do that???

回答(1 个)

Image Analyst
Image Analyst 2018-1-5
"How to add classes number to a mat file?"
Use save() to save variables into a .mat file.

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by