please any one help me.i can not understand where is the problem here in last line

2 views (last 30 days)
function [newXY] = MinuOrigin_TransAll(real_end,k)
theta = real_end(k,3);
if theta <0
theta1=2*pi+theta;
end;
theta1=pi/2-theta;
rotate_mat=[cos(theta1),-sin(theta1),0;sin(theta1),cos(theta1),0;0,0,1];
toBeTransformedPointSet = real_end';
tonyTrickLength = size(toBeTransformedPointSet,2);
pathStart = real_end(k,:)';
translatedPointSet = toBeTransformedPointSet - pathStart(:,ones(1,tonyTrickLength));
newXY = rotate_mat*translatedPointSet;
for i=1:tonyTrickLength
if or(newXY(3,i)>pi,newXY(3,i)<-pi)
newXY(3,i) = 2*pi - sign(newXY(3,i))*newXY(3,i);
end;
end;
error showing:
Error: File: fingerprintmatching.m Line: 372 Column: 1
All functions in a script must be closed with an 'end'.

Accepted Answer

Walter Roberson
Walter Roberson on 22 Apr 2020
You need to add one more
end
to the bottom of the function.
When you include a function inside a script, it is required that you have an end statement that matches the function line.
function whatever
some code
end
  4 Comments
indrani dalui
indrani dalui on 22 Apr 2020
dear sir ,
i attached the total code .i am not find out where the problem is arrised .if possible please help me out with the solution.
Walter Roberson
Walter Roberson on 22 Apr 2020
Improved version attached.
However, it is obvious that this is not the original code. A number of the functions there are not called within the code, and it is not possible for code outside of the file to call those functions. Either there was more code at the top of this, or else those functions should be written to individual .m files.
The code you sent also could not have produced the error message that you originally posted about.

Sign in to comment.

More Answers (0)

Categories

Find more on File Operations 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!