The input character is not valid in MATLAB statements or expressions
조회 수: 4 (최근 30일)
이전 댓글 표시
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.
채택된 답변
Steven Lord
2020년 6월 4일
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.
추가 답변 (1개)
Jay Delfin
2021년 6월 14일
??? Error: File: Untitled9.m Line: 1 Column: 11
The input character is not valid in MATLAB statements or expressions. how to fix this
M = input(’Matrix size:’);
A = zeros(M);
A(1,1:M-1) = 1;
A(1:M-1,M) = 2;
A(M,2:M) = 3;
A(2:M,1) = 4;
figure, imagesc(A), axis equal off
댓글 수: 4
Steven Lord
2022년 11월 22일
I'm guessing the character before the 0.44 on that first line is not a hyphen (-) but is instead a dash, inserted by Microsoft Word or Microsoft Outlook. Compare the line copied from your post (the first line below) and a copy of that line where I selected the dash and pressed the hyphen key on my keyboard (the second line below.) The second of those commands should run and the first should error.
p = [0.8 –0.44 0.36 0.02];
p = [0.8 -0.44 0.36 0.02];
Les Beckham
2022년 11월 22일
And, as in @Steven Lord's answer from 14 Jun 2021, the single quote characters in the xlabel and ylabel command lines are also not normal single quote characters.
double('‘T...n’')
double('''')
참고 항목
카테고리
Help Center 및 File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!