fr = fopen('inputFile.txt','r');
for i=1:numOfpoint
train_matrix= fscanf(fr,'%f',2);
y(i) = fscanf(fr,'%f',1);
end
fclose(fr);
fopen : open the file
fscanf : read the file , fscanf(fr,'%f',2); represent that the computer should read 2 number from the file.
全站熱搜