unexpected matlab operator on okada script
이전 댓글 표시
and run with the input example
[E,N] = meshgrid(linspace(-10,10,50));
[uE,uN,uZ] = okada85(E,N,2,30,70,5,3,-45,1,1,'plot');
figure, surf(E,N,uN)
and the function is
function u=uzy_ss(xi,eta,q,dip,nu)
R = sqrt(xi.^2 + eta.^2 + q.^2);
db = eta.*sin(dip) - q.*cos(dip);
yb = eta.*cos(dip) + q.*sin(dip);
u = (db.*q./R.^3).*cos(dip) ...
+ (xi.^2.*q.*A(eta,R).*cos(dip) - sin(dip)./R + yb.*q./R.^3 ...
- K2(xi,eta,q,dip,nu,R)).*sin(dip);
but then i found an error says : Error: File: okada85.m Line: 465 Column: 1 Unexpected MATLAB operator.
댓글 수: 5
Geoff Hayes
2018년 7월 5일
Amri - I was able to run the above code without any problems. I recommend that you replace your copy of the okada85.m file with the original and try again. Line 465 seems to correspond to
yb = eta.*cos(dip) + q.*sin(dip);
and there doesn't seem to be anything suspicious about this line.
Amri Rasyidi
2018년 7월 6일
OCDER
2018년 7월 6일
I get no error. Are you sure you have the right function without any edits? Maybe there's a function overriding matlab functions?
[E,N] = meshgrid(linspace(-10,10,50));
[uE,uN,uZ] = okada85(E,N,2,30,70,5,3,-45,1,1,'plot');
figure, surf(E,N,uN)
%It works. I get a plot.
LINE 465 of okada85.m
yb = eta.*cos(dip) + q.*sin(dip);
Geoff Hayes
2018년 7월 6일
Amri - if I open the okada85.m (downloaded as is from the FEX) then

Note line 465. Try replacing your copy of the file with that from the FEX.
Amri Rasyidi
2018년 7월 6일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Downloads에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!