Skip to content

Commit 979088a

Browse files
committed
Fix Error Messages in case of failure (sw_model)
Error messages were not accurate in their description Former-commit-id: 6967c92
1 parent 02c1d81 commit 979088a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

swfiles/sw_model.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@
124124
% Search for files which are models
125125
relFiles = cellfun(@(x) x(1:end-2) ,allFiles(strncmp(allFiles, modelSearch, 3)),'UniformOutput',false);
126126
if ~any(strcmp(model, relFiles))
127-
error('sw_model:WrongINput','Model does not exists!')
127+
error('sw_model:WrongInput','Model does not exists!')
128128
end
129129
% Evaluate the model
130130
try
131131
obj = feval(model, param);
132132
catch ME
133-
error('sw_model:WrongINput','This model has an error!')
133+
error('sw_model:ModelError','This model has an error!')
134134
end
135135
end
136136

tutorials/tutorial/aniso_rotation.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@
55
v1 = [1 0 0];
66
v2 = [1 1 1]/sqrt(3);
77

8-
Find the axis around which v1 can be rotated to v2:
8+
%Find the axis around which v1 can be rotated to v2:
99

1010
ax = cross(v1,v2);
1111

12-
Find the rotation angle:
12+
%Find the rotation angle:
1313

1414
phi = atan2(norm(cross(v1,v2)),dot(v1,v2));
1515

16-
Create a rotation matrix:
16+
%Create a rotation matrix:
1717

1818
R = sw_rotmat(ax,phi);
1919

20-
Rotate the Aniso matrix:
20+
% Rotate the Aniso matrix:
2121

22-
A = R*Aniso*R?;
22+
A = R*Aniso*R;
2323

24-
This A matrix will define an easy axis anisotropy along the (111) direction with the size of 1 meV. To double check that it is right, we calculate the eigenvalues:
24+
%This A matrix will define an easy axis anisotropy along the (111) direction with the size of 1 meV. To double check that it is right, we calculate the eigenvalues:
2525

26-
[V,Aniso2] = eig(A);
26+
[V, Aniso2] = eig(A);

0 commit comments

Comments
 (0)