Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

matlab function definition is misplaced or improperly nested

271 views
Skip to first unread message

murth...@gmail.com

unread,
Jul 17, 2014, 6:07:44 AM7/17/14
to
Dear all,
I am getting an error stating that
"function definition is misplaced or improperly nested" in the below code.
[matches,~] = match_descr(d1,d2);

Steven Lord

unread,
Jul 17, 2014, 10:13:21 AM7/17/14
to

<murth...@gmail.com> wrote in message
news:1fd26e6d-a97d-4f5d...@googlegroups.com...
The problem is not in the usage of this function, the problem is in how the
function is defined. Smart indent the file containing match_descr:

http://www.mathworks.com/help/matlab/matlab_prog/improve-code-readability.html

"If you clear this option, you can manually apply indenting by selecting the
lines in the Editor to indent, right-clicking, and then selecting Smart
Indent from the context menu."

If your functions are nested correctly, the last END should be lined up with
the FUNCTION keyword in the first function declaration in the file as per
the examples on this page.) If they aren't, there will be a mismatch and/or
Code Analyzer will flag the file with a red Error condition.

--
Steve Lord
sl...@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

0 new messages