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.
3 件のコメント
採用された回答
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.
2 件のコメント
その他の回答 (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 で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!