diff --git a/6_rendering/gtHexagonalUnitCell.m b/6_rendering/gtHexagonalUnitCell.m index 93c3fe51a557255f51192008dbb4b083be439195..34a82385eeee972eeebf3bc3c4b5c0d9d8995c92 100644 --- a/6_rendering/gtHexagonalUnitCell.m +++ b/6_rendering/gtHexagonalUnitCell.m @@ -164,6 +164,7 @@ if nargout == 1 data.ycrys = ycrys; data.zcrys = zcrys; data.lcrys = lcrys; + data.app = app; if app.draw data.hf = gcf; if app.patch diff --git a/zUtil_Cryst/gtDisorientation.m b/zUtil_Cryst/gtDisorientation.m index abb60c23d4a4b43c5a933e04046cc460b834bd79..b53a3beceef8644b6239a673f326dd014fee48f9 100644 --- a/zUtil_Cryst/gtDisorientation.m +++ b/zUtil_Cryst/gtDisorientation.m @@ -18,7 +18,7 @@ function [mis_angle, mis_axis, info] = gtDisorientation(ori1, ori2, symm, vararg % mode = <string> Mode of rotation ({'passive'} or 'active') % sort = <string> Sort disorientation axis components after taking % absolute values (if empty, do nothing at all) -% ({''}, 'descend' or 'descend') +% ({''}, 'ascend' or 'descend') % % OUTPUT: % mis_angle = <double> Misorientation angles between the 2 grain sets diff --git a/zUtil_Help/export.m b/zUtil_Help/export.m index 54b5e2d052f710f193b0a3460988a6ee9b741369..590091c1ad93cddc62e41a45cd3fcfb5f1022f51 100644 --- a/zUtil_Help/export.m +++ b/zUtil_Help/export.m @@ -1,4 +1,8 @@ -function export(name,hf) +function export(name,hf) +if isempty(hf) + hf = gcf; +end + export_fig(fullfile('8_analysis','figures',name),'-png','-r300','-transparent',hf) saveas(hf, fullfile('8_analysis','figures',name), 'fig') disp(['Saved figure as ' fullfile('8_analysis','figures',name) '.fig']) diff --git a/zUtil_Maths/gtMisorientation.m b/zUtil_Maths/gtMisorientation.m index 8f0b9d9e5cda4357a7c792c44cb72f3ce5156689..30da1740f71a9e37ef522a92c689599c9b2ed201 100644 --- a/zUtil_Maths/gtMisorientation.m +++ b/zUtil_Maths/gtMisorientation.m @@ -63,7 +63,7 @@ mis_angle = mis_angles(dummy); if nargout > 1 mis_axis = misorientation_axes{dummy}; - if exist('latticepar', 'var') && ~isempty(latticepar) + if (~isempty(latticepar)) mis_axis = gtCart2Hex(mis_axis, latticepar); end diff --git a/zUtil_Maths/rotateVectors.m b/zUtil_Maths/rotateVectors.m index 37db415893bff3848502bfb770f12e1093765cdd..b90aa6727152c9512c678b78975e3dbc53a13b46 100644 --- a/zUtil_Maths/rotateVectors.m +++ b/zUtil_Maths/rotateVectors.m @@ -49,14 +49,13 @@ else gtError('rotateVectors:missingArgument','The angle/axis information is missing...Quitting') end -if size(vectors,2) < size(vectors,1) && ~isRowVectorWithLength(vectors,3) + +if size(vectors,2) ~=3 && size(vectors,1) == 3 vectors = vectors'; -elseif size(vectors,2) ~= 3 - gtError('rotateVectors:wrongSize','size(vectors,2) must be 3...Quitting') end - N = size(vectors,1); + new_vectors = arrayfun(@(num) (R * vectors(num,:)')', 1:N, 'UniformOutput', false)'; if app.cell2mat