Hello.
What I am looking for is a way to do what strsplit does since my teacher said he didn't know this function and therefore i could not use it. My code so far is
function [n_nos, graph] = Receber1( fich )f = fopen(fich, 'r');if f == -1 disp('Insucesso ao abrir o ficheiro.');else n_nos = 0; graph = []; while feof(f) == 0 line = fgetl(f); graph(end+1, :) = str2double(strsplit(strtrim(line))); n_nos = n_nos+1; end fechar = fclose(f); if fechar == 0 disp('Ficheiro carregado com sucesso.'); else disp('Insucesso ao fechar o ficheiro.'); n_nos = -1; end end end
Thank you so much.
Best Answer