English 中文(简体)
帮助:在单列MTLAB的Csv档案中记录数据。
原标题:help: code to record data in csv file from gui MATLAB

i m New to MATLAB. i) 该代码使用gui取图像特征。 i 存在问题,即制定能够记录从中提取的数据为碎纸和txt文档的代码。 i 每当图像装入单体时,从图像中提取的数据就需记录成单册。 数据将用于培训神经网络。 谁能帮助我? q

   %~~~~~~~~~~~~~~~~~~~~~~~~use when train data~~~~~~~~~~~~~~~~~~~~~
   % stt=0; %use it when train data\set grade value set 1 if pet, set 0 if nonpet
   % humoment=[num2str(M1)  ,  num2str(M2)  ,  num2str(M3)  ,  num2str(M4)  ,  num2str(M5)  ,  num2str(M6)  ,  num2str(M7)  ,  num2str(perimeter)  ,  num2str(area)  ,  num2str(xbar)  ,  num2str(ybar)  ,  num2str(stt)];
   % Record (humoment, C:MATLABDATAdatatrain.csv ) %use it when train data
   % %~~~~~~~~~~~~~~~~~~~~~~~~use when test data~~~~~~~~~~~~~~~~~~~~~~
   humoment=[num2str(M1)  ,  num2str(M2)  ,  num2str(M3)  ,  num2str(M4)  ,  num2str(M5)  ,  num2str(M6)  ,  num2str(M7)  ,  num2str(perimeter)  ,  num2str(area)  ,  num2str(xbar)  ,  num2str(ybar) ];

    data= [filename  ,  num2str(M1)  ,  num2str(M2)  ,  num2str(M3)  ,  num2str(M4)  ,  num2str(M5)  ,  num2str(perimeter)  ,  num2str(M6)  ,  num2str(M7)  ,  num2str(area)  ,  num2str(xbar)  ,  num2str(ybar)];
   Record(humoment, C:MATLABDATAdatatest.csv )
   Record(data, C:MATLABDATAdatatest.txt )  
   set(handles.edit45, String , Load completed )

   end
最佳回答

最简单的解决办法可能是取代

   Record(humoment, C:MATLABDATAdatatest.csv )
   Record(data, C:MATLABDATAdatatest.txt )

iii

fid = fopen( C:MATLABDATAdatatest.csv , a+ );
fprintf(fid,[humoment, 
 ]);
fclose(fid);

fid = fopen( C:MATLABDATAdatatest.txt , a+ );
fprintf(fid,[data, 
 ]);
fclose(fid);
问题回答

暂无回答




相关问题
Styling rows in table that uses CSV data through PHP

I ve been working on this simple code that puts a CSV file into a nice table. But because the data is imported, styling ODD rows is a pretty hard thing to do. All I need would be a method to address ...

PHP - Sanitise a comma separated string

What would be the most efficient way to clean a user input that is a comma separated string made entirely on numbers - e.g 2,40,23,11,55 I use this function on a lot of my inputs function clean($...

marking duplicates in a csv file

I m stumped with a problem illustrated in the sample below: "ID","NAME","PHONE","REF","DISCARD" 1,"JOHN",12345,, 2,"PETER",6232,, 3,"JON",12345,, 4,"PETERSON",6232,, 5,"ALEX",7854,, 6,"JON",12345,, ...

Interactive heat map in Flex

I’m at a very basic level with Flex and with programming in general. I am working on a project where I have data in an Excel (.csv) format, it’s a large Excel plot/matrix where each cell has a ...

热门标签