Debian Codegraph @

contrib/ms-sbvar/TZcode/MatlabFiles/binread.m

raw
1 %
2 % Copyright (C) 1997-2012 Tao Zha
3 %
4 % This free software: you can redistribute it and/or modify
5 % it under the terms of the GNU General Public License as published by
6 % the Free Software Foundation, either version 3 of the License, or
7 % (at your option) any later version.
8 %
9 % It is distributed in the hope that it will be useful,
10 % but WITHOUT ANY WARRANTY; without even the implied warranty of
11 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 % GNU General Public License for more details.
13 %
14 % If you did not received a copy of the GNU General Public License
15 % with this software, see <http://www.gnu.org/licenses/>.
16 %
17 nbuffer = 10;
18 ndraws=3*nbuffer;
19
20 n=3;
21 yhatw = zeros(n^2,ndraws);
22 seldraw = [3 7];
23
24 [fid,message]=fopen('outyhat.bin')
25 %[xd,count]=fread(fid,[n^2,length(seldraw)],'double'); % (1) working
26 [xd,count]=fread(fid,inf,'single'); % (2) working. with 'single' or 'double'
27 fid
28 message
29 count
30 %xdd=reshape(xd,n^2,length(seldraw)) % (1) working
31 xdd=reshape(xd,n^2,ndraws) % (2) working