필터 지우기
필터 지우기

how to correct this error

조회 수: 3 (최근 30일)
prem preet
prem preet 2012년 4월 28일
댓글: Walter Roberson 2017년 10월 11일
function [ciphertext] = encrypt(plaintextfile,ciphertextfile,dim)
if nargin < 3
encodematrix=[105 18;27 171];
dim = length(encodematrix);
else
g = 2*din;
while g~=1
??? Error: File: encrypt.m Line: 7 Column: 1
At least one END is missing: the statement may begin here.
  댓글 수: 2
varmidh
varmidh 2017년 10월 11일
I have the same problem even though the code editor is green and I have double checked that every if, while, for loop does have a matching end statement.
Walter Roberson
Walter Roberson 2017년 10월 11일
varmidh, please post your code.

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

답변 (2개)

per isakson
per isakson 2012년 4월 28일
See the page "Avoid Mistakes While Editing Code" in the documentation.
The Code Analyzer of the Matlab Editor works in the background and displays a summary in the Message Indicator in upper right corner of the editor pane. It works a bit like the spell checker in a word processor. Try to keep the Message Indicator green and understand that if it is red you have a problem.
Your error message says that "at least one END is missing". Hint: a while-loop must be closed with the keyword, end.

Walter Roberson
Walter Roberson 2012년 4월 28일
"if" must be matched with "end". "while" must be matched with "end". The variable "din" (with an N) must be defined before it is used. A value must be assigned to the output variable "ciphertext"

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by