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'.
0 个评论
采纳的回答
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 个评论
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 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!