OAM_lm =
Hi,
Assuming that the two fields are already represented as vectors, a simpler way to add these two fields is to simply use the + operator between them. MATLAB vectorizes the operation such that it is more efficient than individually adding the components. Vectorization also makes the resulting code more readable.
This can be done as shown below:
syms l phi beta z F_lm;
x_hat = [1;0] ; y_hat = [0;1];
HE_odd = F_lm*(x_hat*sin(l*phi) + y_hat*cos(l*phi))*exp(1i*beta*z);
HE_even = F_lm*(x_hat*cos(l*phi) -y_hat*sin(l*phi))*exp(1i*beta*z);
OAM_lm = HE_even + HE_odd % This operation is vectorized
Refer to the below documentation link to understand more about vectorization