Strange error on my source code

조회 수: 12 (최근 30일)
Philippe
Philippe 2013년 10월 22일
댓글: Philippe 2013년 10월 23일
Matlab is telling me that my declaration of variables is invalid. I've tried putting a "clear all" before the declaration, but it still tells me there is an error in the code. Does anyone know the answer for this? It seems so trivial...
  댓글 수: 3
Philippe
Philippe 2013년 10월 22일
I thought I had attached it, here it is, sorry.
dpb
dpb 2013년 10월 23일
What really need is code and error in context...do whatever it was that caused the error and then cut and paste it here along with whatever function it was source

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

채택된 답변

Walter Roberson
Walter Roberson 2013년 10월 23일
The part from
%%diferentes codificacoes
on downwards is not inside any "function". You cannot have a script in the same file you declare a function. You need to move that line through to the end into a different file.
  댓글 수: 1
Philippe
Philippe 2013년 10월 23일
Thanks for the advice. There were other mistakes in the code but only syntax ones. This code was not written by me, it was a friend who helped me with most of it.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Scope Variables and Generate Names에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by