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

1 次查看(过去 30 天)
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'.

采纳的回答

Walter Roberson
Walter Roberson 2020-4-22
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 个评论
indrani dalui
indrani dalui 2020-4-22
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 2020-4-22
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by