1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
save(['C:\TP\rest','.mat'],'pos','scale','orient','desc');
[fid,msg] = fopen( ['C:\TP\rest','.mat'], 'r' );
if fid == -1
error( msg );
end
[head count] = fscanf( fid, '%d', 2 );
pos = zeros(head(1),2);
orient = zeros(head(1),1);
scale = zeros(head(1),1);
desc = zeros(head(1),head(2));
for k = 1:head(1)
x = fscanf( fid, '%f', 2 )';
pos(k,:) = [x(2) x(1)];
scale(k) = fscanf( fid, '%f', 1 );
orient(k) = fscanf( fid, '%f', 1 );
desc(k,:) = fscanf( fid, '%d', head(2) )';
end
fclose( fid ); |
Partager