フィルターのクリア

The input character is not valid in MATLAB statements or expressions

4 ビュー (過去 30 日間)
SUBHAJIT KAR
SUBHAJIT KAR 2020 年 6 月 4 日
コメント済み: Les Beckham 2022 年 11 月 22 日
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 件のコメント
SUBHAJIT KAR
SUBHAJIT KAR 2020 年 6 月 4 日
Here is the output of the command -'which appcoef -all':
C:\Program Files\MATLAB\R2016a\toolbox\wavelet\wavelet\appcoef.m
SUBHAJIT KAR
SUBHAJIT KAR 2020 年 6 月 4 日
Any recomendation to solve the problem? I think the inbuilt function is not working.

サインインしてコメントする。

採用された回答

Steven Lord
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 件のコメント
SUBHAJIT KAR
SUBHAJIT KAR 2020 年 6 月 5 日
How to open appcoef function in editor? Any particular command?
Steven Lord
Steven Lord 2020 年 6 月 5 日
Use the edit function.

サインインしてコメントする。

その他の回答 (1 件)

Jay Delfin
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
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
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’')
ans = 1×7
8216 84 46 46 46 110 8217
double('''')
ans = 39

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeShifting and Sorting Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by