Question
fin1 = fopen('file1.txt'); fin2 = fopen('file2.txt'); while ~feof(fin1) && ~feof(fin2) r1 = fgetl(fin1); r2 = fgetl(fin2); if ~strcmp(r1, r2) fprintf('diff %s vs %s ', r1,
fin1 = fopen('file1.txt'); fin2 = fopen('file2.txt'); while ~feof(fin1) && ~feof(fin2) r1 = fgetl(fin1); r2 = fgetl(fin2); if ~strcmp(r1, r2) fprintf('diff %s vs %s ', r1, r2) end end fclose(fin1); fclose(fin2); Given the above code, which of the following statements is true?
1. Since Matlab opens basket 0 for the keyboard, 1 for the display, and 2 for the error display (red), it is likely that fin1 and fin2 will be assigned to baskets 3 and 4 respectively.
2. All the lines of the files will be read in, but perhaps not all will be printed.
3. Each line fgetl brings in is treated as a single character string, regardless of commas or spaces.
4. Lines that are different will be displayed side by side.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started