MATLAB Answers

Finding the distance between two points in an image

7 views (last 30 days)
Alvin Huang
Alvin Huang on 21 Nov 2019
Answered: Rik on 21 Nov 2019
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:

  0 Comments

Sign in to comment.

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.

  0 Comments

Sign in to comment.

Sign in to answer this question.

Tags