フィルターのクリア

how to append Image names to feature vector file?

1 回表示 (過去 30 日間)
hp
hp 2018 年 9 月 11 日
コメント済み: hp 2018 年 9 月 28 日
I have FEATUREdb.mat file where in which i have stored 500 rows of features and 121 columns(500X121), now i wanted to append image names at 122nd column to the same database(FEATUREdb).And the Image names I have stored is showing as cell and Featuredb is having double values. and the respective files Iam attaching here ..plz help
  2 件のコメント
Stephen23
Stephen23 2018 年 9 月 11 日
編集済み: Stephen23 2018 年 9 月 11 日
"And the Image names I have stored is showing as cell and Featuredb is having double values"
Then they cannot be meaningfully concatenated together (unless you convert their classes to something compatible: as table is one possible option, but I would not recommend anything else).
You could:
  • convert all of the filenames to integers (as interestingly all of the files are named with digits only... but this is a rather fragile solution)
  • Simply include the filenames as their own variable in the .mat file (simple, and easy to get the corresponding values using indexing).
  • Convert to table.
Which would you prefer?
hp
hp 2018 年 9 月 11 日
I agreed. Thats why i was thinking to convert image names to integer... and append it. either i can extract its name except its extension do any conersion...thats what my plan is... what you justs sir?

サインインしてコメントする。

採用された回答

KSSV
KSSV 2018 年 9 月 12 日
I = load('Image_names.mat') ;
names = I.Image_names ;
[F,N,E] = cellfun(@fileparts,names,'un',0) ;
iwant = str2double(N)
It is better to associate a number to the image, and append it to Feature vector. As the image names have already numbers, just pick them and append them. By the way, your feature vector attached here is of size 1000X121 and image names are 500X1.
  1 件のコメント
hp
hp 2018 年 9 月 28 日
Thank You so much...it worked...

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by