how can i overcome this error
Show older comments
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 Comments
Geoff Hayes
on 10 Jul 2018
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
on 11 Jul 2018
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
Accepted Answer
More Answers (0)
Categories
Find more on Code Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!