Reading a multi line string into a single string
Show older comments
I have opened a file with a string consisting of three lines. I want to read these lines from the file and store them in my "template" variable as a three line string. All I can get is the last line of the string to be stored in "template"
while feof(fid) == 0;
line = fgets(fid);
template = strvcat(line)
end
Thanks for the help
Accepted Answer
More Answers (1)
Matt Tearle
on 19 Mar 2011
0 votes
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!