Solving an equation with two different variables of different ranges
1 次查看(过去 30 天)
显示 更早的评论
Hello All,
I am looking to solve the equation below with two different variables, phi and theta. However, those two variables are set for different ranges and the matrices sizes are different. Is there a way to get around this and solve for phi first, and then solve provide a results for every theta? Below I will provide the variables and their set ranges along with the equation to solve.
NS=4*2^(1-1);
h=(pi/2-0)/NS;
phi=0:h:pi/2;
theta = 0:2:90;
fphi = @ (phi) 1/sqrt(1-sin(theta/2).^2*sin(phi).^2) %This line may not be written properly as well as the next to account for theta as well. Again I would like to solve for phi, and then theta.
F = fphi(phi);
Any help would be much appreciated!
Thank you!
0 个评论
采纳的回答
KSSV
2017-2-27
NS=4*2^(1-1);
h=(pi/2-0)/NS;
Phi=0:h:pi/2;
Theta = 0:2:90;
[phi,theta] = meshgrid(Phi,Theta) ;
Fphi = @ (phi,theta) 1./sqrt(1-sin(theta/2).^2.*sin(phi).^2) ; %This line may not be written properly as well as the next to account for theta as well. Again I would like to solve for phi, and then theta.
F = Fphi(phi,theta);
% fphi = 1./(1-sin(theta/2).^2.*sin(phi).^2).^0.5 ;
surf(Phi,Theta,F)
3 个评论
Walter Roberson
2017-2-27
Plotting the result is not mandatory.
If you do want to plot and prefer a different style of plot, let us know what you were hoping for.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!