how can i overcome this error
古いコメントを表示
CCT(2,3,2,3)
sum =
0
0
Error in RCT3 (line 2)
syms t r theta phi p(r) q(r) a
Output argument "R" (and maybe others) not
assigned during call to "C:\Users\Shiraz
Khan\Documents\MATLAB\RCT3.m>RCT3".
Error in CCT (line 13)
sum=sum+g(i,m)*RCT3(j,k,l,m);
2 件のコメント
Geoff Hayes
2018 年 7 月 10 日
shiraz - can you share the code for RCT3.m? Given the error message, the R output parameter is not being set given your inputs.
Geoff Hayes
2018 年 7 月 11 日
Shiraz's answer moved here
function [R]= RCT3(i,j,k,m)
syms t r theta phi p(r) q(r) a
g=[exp(p(r)) 0 0 0; 0 -exp(q(r)) 0 0; 0 0 -r^2 0; 0 0 0 -r^2*(sin(theta))^2];
x= [t r theta phi];
A=diff(SRH2(i,k,m),x(1,j));
% pretty(A)
B=diff(SRH2(i,j,m),x(1,k));
% pretty(B);
sum1=0;
for n=1:4
sum1=sum1+SRH2(i,k,n)*SRH2(n,j,m);
end
sum1;
% pretty(sum1)
sum2=0;
for n=1:4
sum2=sum2+SRH2(i,j,n)*SRH2(n,k,m);
end
sum2;
% pretty(sum2)
sum=A-B+sum1-sum2;
sum;
pretty(sum)
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Code Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!