MATLAB: What is wrong with this FORTRAN to MATLAB conversion

fortranMATLABtextscan

I'm running MATLAB R2016a Student and getting error messages. Here is the CNSMTX program:
fid=fopen('ZLS918_919_KCR_Test_Up_0.txt','r');
fmt_num0='%7f %7f %7f %7f %7f %7f %3f %3f %3f %3f %2f %24c';%FORMAT(6F7.0,4I3,I2,6A4)
fmt_num1='%7f %7f %7f %7f %7f %7f %7f %7f %7f %7f'; %FORMAT(10F7.0)
fmt_num2='%21c %7f %7f %7f %7f %7f %7f %7f'; %FORMAT(3A4,7F7.0)
%READ(20,106) XXL,SW,CBAR,B2,XMAC,XREF,S1CON,PUNCH,IDUM,IDUN,ITNGO,
% & (ITIT(I),I=1,6)
ProjectTitle=textscan(fid,'%4c',20); %FORMAT(20A4)
[XXL,SW,CBAR,B2,XMAC,XREF,S1CON,PUNCH,IPROP,IDUM,ITNGO,...
ITIT]=textscan(fid,fmt_num0,1) % line 13 in MATLAB
%READ(20,101) (XV(I),YV(I),H(I),XEA(I),C(I),EAANGL(I),TANL(I),
% 1 TANT(I),YE(I),XE(I),I=1,L)
for i=1:XXL
[XV(i),YV(i),H(i),XEA(i),C(i),EAANGL(i),TANL(i),TANT(i), ...
YE(i),XE(i)]=textscan(fid,fmt_num1,1)
end
Error using textscan Too many output arguments.
Error in CNSMTX (line 13) ITIT]=textscan(fid,fmt_num0,1)

Best Answer

The textscan function outputs one cell of cell arrays for each field in the format specifier, or one a cell of cell arrays for each class (numeric and character) if you specify 'CollectOutput',true. See the documentation for details, since my description here lacks them.