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?

4 vues (au cours des 30 derniers jours)
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???

Réponses (1)

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

Catégories

En savoir plus sur Images dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by