MATLAB: How to read an array from a file

readingarrays fscanf

Im trying to read the following array from a txt file but the typical functions like fscanf or textscan does not work. Help! The array is the following
[52] $
(1,1)=1 (2,1)=2.50000 (3,1)=2.50000 (4,1)=1014.00000
(1,2)=2 (2,2)=7.50000 (3,2)=2.50000 (4,2)=1014.00000
(1,3)=3 (2,3)=2.50000 (3,3)=7.50000 (4,3)=1014.00000
(1,4)=4 (2,4)=7.50000 (3,4)=7.50000 (4,4)=1014.00000
And the code im trying to use is:
FID = fopen('DatosMP','r');
props=fscanf(FID,'%i %f')
fclose(FID)
And when i try ti display props it throws
props=[]

Best Answer

FID = fopen('DatosMP','r');
data = cell2mat(textscan(FID, '(%f,%f)=%f', 'HeaderLines',1, 'CollectOutput', 1));
fclose(FID);
props = full(sparse(data(:,1), data(:,2), data(:,3)));