please help me how to solve this equation in matlab?
2 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/156714/image.jpeg)
i am very new to MATLAB can u please help me how to find values of R21 and X21 6 and 7 in USING MATLAB assuming i have all the values.
more importantly 1.how i can use that greek variables in MATLAB?
1 个评论
Rizwana
2014-2-14
No you cant use any special symbol like shown in those expression in matlab.. But you can use alpha/beta and phi. To be very clear, you should know whether your values alpha and beta are in degrees/radians or its in degrees does it needs conversion to rdaians...??? I will try because evn iam learning matlab..
k =2 * pi/(lamda); % assume lamda
touw = k * H; % assume H
alpha_1 = k * (sqrt(d^2 + H^2) + H ) % assume d
alpha_2 = k * (sqrt(d^2 +( H-L)^2) + (H-L) ) % assume d and L
alpha_3 = k * (sqrt(d^2 +( H+L)^2) + (H+L) )
beta_1 = k * (sqrt(sqrt(d^2 + H^2)- H);
beta_2 = k* (sqrt(d^2+(H-L)^2)-(H-L));
beta_3 = k * (sqrt(d^2 +(H +L)^2)-(H+L));
% assume Ci and Si
p = touw ((2*Ci(alpha_1)) + (2*Ci*(beta_1)) - (Ci*(alpha_2)) - (Ci*(alpha_3)) - (Ci*(beta_2)) - (Ci*(beta_3)));
q = touw ((2*Si(alpha_1)) + (2*Si*(beta_1)) - (Si*(alpha_2)) - (Si*(alpha_3)) - (Si*(beta_2)) - (Si*(beta_3)));
r = cosd (p); % it gives cosine of values in degrees. Convert it to radians if you want your answer in radians
s = sind (q);
R21 = (efficiency/8*pi) * r * s; % efficiency is assumed
Similarly you can culate X21...
Whew you can make a function... It will be easy...
I dint ran this code. If there are some errors then check out for typing mistakes like missing parenthesis
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!