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!