필터 지우기
필터 지우기

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
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?

댓글을 달려면 로그인하십시오.

추가 답변 (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 CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by