%Lab 25 Solutions %lab25func %Patrick D. Schmid %define a function with retval as return value %and id_val, cap_val and date_val as parameters %function name must be identical to file name function retval = lab25func(id_val, cap_val, date_val) %open the output file and append instead of overwrite fid=fopen('output.txt', 'at'); %print to the file fprintf(fid, 'For fuel station %2.0f:\n', id_val); fprintf(fid, ' Capacity = %5.0f\n', cap_val); fprintf(fid, ' Date Scheduled = %2.0f\n', date_val); %close it fclose(fid); %set retval to 0 retval = 0;