MATLAB: The input character is not valid in MATLAB statements or expressions

appcoeferrorcode

The following code was running. But from today I found this error.
clear all;
close all;
clc
sample_dna2 = fastaread('MT450872_covid.fasta');
sample_dna2 = struct2cell(sample_dna2);
sample_dna2 = cell2mat(sample_dna2(2));
seq2 = sample_dna2(1:29782);
[x2] = dna_binary_double(seq2);
DNAWALK2 = cumsum(x2);
dwtmode('per');
[C,S] = wavedec(x2,8,'coif4');
A5 = appcoef(C,S,'coif4',8);
The total error message is showing as-
Error: File: appcoef.m Line: 1 Column: 4
The input character is not valid in MATLAB statements or expressions.
Error in DNAWALK (line 12)
A5 = appcoef(C,S,'coif4',8);
Please help.

Best Answer

Have you opened the appcoef function in the Editor previously, even accidentally? If so, open it in the Editor again and see if you'd accidentally typed something in line 1 column 4 of the file when you had it open previously. Don't make any other changes to it, and if you do need to eliminate the extra character save the file and close its tab in the Editor as soon as possible.