I've created an empty array with the name pattern and now I am reading a file that generates strings and each string I want to be saved in a variable p. I want the pattern to be displayed on the MATLAB command window. The line assigned to P should be stored in array pattern.
pattern=[]
while ~isnan(l)
p=fgetl(fp);
pattern=(pattern,p[])
end
Can you help, I think I am doing it wrong to assign pattern. Because it wouldn't get the result
pattern = [];
while(~feof(fid))
l = fgetl(fid);
idx = regexp(l, '^information$');
if size(idx,1)>0
l = fgetl(fid);
while ~isnan(l)
p = fgetl(fid);
end
end
end
The above is the code