Writing labels & data to a CSV file for face recognition.

조회 수: 2 (최근 30일)
sidra
sidra 2014년 1월 3일
댓글: Image Analyst 2014년 1월 4일
I have done PCA for 21 images of the same person in different conditions. LAst step of the PCA is projection of original data : signals=PC'*data. Size of signals is 21*21, now I want to write this to a CSV file with a label as +1. Please guide me how to do this in matlab. I tried csvwrite but it does not write the labels, only the data.

채택된 답변

Walter Roberson
Walter Roberson 2014년 1월 3일
csvwrite() and dlmwrite() are only for numeric data.
You could try writing the header first using fopen/fprintf/fclose and then asking one of the two to write starting from row 2.
If you are using MS Windows with Excel installed, you can use xlswrite() to write a .csv file, starting with a cell array.
  댓글 수: 2
sidra
sidra 2014년 1월 4일
Walter : I used csvwrite(filename,[y data]) where y is a column matrix containing the labels.
Image Analyst
Image Analyst 2014년 1월 4일
Why does it have to be a csv file? Are you planning on using it in some other software? Why not just store in a .mat file?

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by