MATLAB: Read a .ssv file

.ssvfileput into matrixreadread data

Hello I want to read a .ssv format file in MATLAB and put it in a matrix The file with format .ssv contains 1500 lines and 24 columns Help me please …For example, this code did not answer. and I dont know what to do
function [training_set, test_set] = read_data(train_path, test_path)
train_file = fopen(train_path);
training_set = cell2mat(textscan(train_file, '%f %f %f %f'));
fclose(train_file);
% open the test data and save to a matrix
test_file = fopen(test_path);
test_set = cell2mat(textscan(test_file, '%f %f %f %f'));
fclose(test_file);

Best Answer

Change
training_set = cell2mat(textscan(train_file, '%f %f %f %f'));
to
fmt = repmat('%f', 1, 24);
training_set = cell2mat(textscan(train_file, fmt));
and change the test_set from '%f %f %f %f' to refer to fmt as well.