what does this error mean and why cant i use the if function i use it in another function and it worked
Show older comments
Accepted Answer
More Answers (1)
Steven Lord
on 12 Jan 2023
0 votes
The end keyword on line 705 closes the if statement on line 689.
The end keyword on line 706 closes the function definition on line 685.
You cannot start a new methods block on line 709 without first closing the previous methods block (which starts somewhere above the start of the code in your picture.
Add an end statement on line 707. If you click on that end statement (or any end statement) I believe MATLAB should show you the keyword with which that end statement is associated. Similarly if you click on the methods keyword (or if or keyboard or ...) MATLAB should show you the corresponding end.
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!