Commit c794dd0e authored by fpa's avatar fpa

replaced function normr() of Neural Network Toolbox by manual code

parent 38d97805
...@@ -63,8 +63,15 @@ if abs(dot(v,u,2)) > 1e-5 ...@@ -63,8 +63,15 @@ if abs(dot(v,u,2)) > 1e-5
end end
% normalize view/up vectors % normalize view/up vectors
v(~isnan(v(:,1)),:) = normr(v(~isnan(v(:,1)),:)); [~,colv]=size(v);
u(~isnan(u(:,1)),:) = normr(u(~isnan(u(:,1)),:)); [~,colu]=size(u);
if (colv == 1)
v(~isnan(v(:,1)),:) = v(~isnan(v(:,1)),:) ./ abs(v(~isnan(v(:,1)),:));
u(~isnan(u(:,1)),:) = u(~isnan(u(:,1)),:) ./ abs(u(~isnan(u(:,1)),:));
else
v = sqrt( ones ./ (sum((v(~isnan(v(:,1)),:).*v(~isnan(v(:,1)),:))')) )' * ones(1,colv).*v(~isnan(v(:,1)),:);
u = sqrt( ones ./ (sum((u(~isnan(u(:,1)),:).*u(~isnan(u(:,1)),:))')) )' * ones(1,colu).*u(~isnan(u(:,1)),:);
end
% init. % init.
y = NaN(size(v,1),1); y = NaN(size(v,1),1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment