Finding the distance between two points in an image

2 views (last 30 days)
Hi there,
I need help with creating a line between two points over an image which will give me the distance.
I tried running it, but it gave me an error.
Error: File: startDrawing.m Line: 1 Column: 1
Function definitions are not permitted in this context.
This is the link I am using:

Answers (1)

Rik
Rik on 21 Nov 2019
You are using R2016a, but using functions in scripts was introduced in R2016b. The documentation page you linked does not mention this, because it assumes you are running the latest release.
You can either move all functions to their own file, or make the script part a function as well.
Note that some functions or syntax options might have been introduced between R2016a and R2019b, so the example might not work in your release.

Categories

Find more on Images in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!