MATLAB: How to read a txt file as input values

.txt filesinput valuesMATLAB

I wish to read a txt file with a 4×4 square of input values st matlab reads the first row and enters them into my inputs, then the second row etc… any help would be appreciated!

Best Answer

num = load('YourFile.txt') ;
for K = 1 : size(num, 1)
First = num(K, 1);
Second = num(K, 2);
Third = num(K, 3);
Last = num(K, 4);
Do whatever at this point
end