Hello,
I am using the following code to plot the misorientation in a line inside a grain.
"
%create a color map of the IPF orientations of the selected material
oM = ipdfHSVOrientationMapping(ebsd('Nickel'));
%define the direction of the ipf
oM.inversePoleFigureDirection = zvector;
%convert the ebsd map orientations to a color based on the IPF
color = oM.orientation2color(ebsd('Nickel').orientations);
figure; plot(ebsd('Nickel'),color);
%select endpoints of a line on the map and store the coordinates
[x,y]=ginput(2);
% create a variable holding the xy of each end of the desired line segment
%first end, last end clicked lineSec =[x(1,:) y(1,:); x(2,:) y(2,:)];
%draw the line on the figure
hold on;
line(x,y,'linewidth',2); hold off;
%The command spatialProfile restricts the EBSD data to this line
ebsd_line = spatialProfile(ebsd('Nickel'),lineSec);
%calculate the angle between the first point of the line and all the points
%on the line
ang= angle(ebsd_line(1).orientations,ebsd_line.orientations)/degree
% plot this angle vs the x position of the point
figure;plot(ebsd_line.x,ang);
% to plot the misorientation gradient, we first calculate the average x position of two adjacent points, and then the misorientation between two adjacent points
xpos=0.5*(ebsd_line.x(1:end-1)+ebsd_line.x(2:end))
yval= angle(ebsd_line(1:end-1).orientations, ebsd_line(2:end).orientations)/degree
hold all;
plot(xpos,yval);
hold off
xlabel('x position'); ylabel('misorientation in degrees') legend('misorientation to reference orientation','orientation gradient') "
However, I am receiving these errors.
"Error using reshape
To RESHAPE the number of elements must not change.
Error in orientation/dot (line 108)
d = reshape(d,size(o1));
Error in orientation/angle (line 17)
omega = real(2*acos(abs(dot(o1,varargin{:}))));"
I was wondering why I am receiving this errors and how I can fix it. All your comments and help would be appreciated too much.
Regards,
Roghayeh