Hi all, just a quick question, how do I import a text file I have into matlab? Currently when I am writing my code I keep getting an error telling me Undefined variable "test1" or class "test1.txt".
filename = 'test1.txt';delimiterIn = ',';A = importdata(filename,delimiterIn);fileID = fopen('test1.txt', 'r');formatSpec = '%d %d %d %d';sizeA = [4 Inf];A = fscanf(test1.txt,formatSpec,Inf)fclose(test1.txt);A = A'
and I'm not too sure what is the problem with my code. Im really new to matlab so I would appreciate your help. Thank you!
Best Answer