Good afternoon Renato, The approach I would take to your
problem is as follows:
# Matrix A is "freq", "impedance" and "phase", like this:
# properly define the Matrix A
A = [20.66, 12.32, 49.63;
21.47, 13.75, 48.86;
22.30, 15.92, 47.71;
23.17, 18.43, 45.06;
24.07, 22.61, 39.76];
# I would like to get another Matrix, B, with the result of
# multiplication of "impedance" and "phase":
#
# A(1,2) * cos(A(1,3)
# A(2,2) * cos(A(2,3))
# A(3,2) * cos(A(3,3))
# A(4,2) * cos(A(4,3))
# A(5,2) * cos(A(5,3))
#
#
# Matrix "B" =
#
# 20.66 A(1,2) * cos(A(1,3))
# 21.47 A(2,2) * cos(A(2,3))
# 22.30 A(3,2) * cos(A(3,3))
# 23.17 A(4,2) * cos(A(4,3))
# 24.07 A(5,2) * cos(A(5,3))
freq = A(:,1); # extract column 1 data into freq vector
impedance = A(:,2); # extract column 2 data into impedance vector
phase = A(:,3); # extract column 3 data into phase vector
B = [freq impedance .* cos(phase)]; # generate desired B matrix
B
clear freq impedance phase; # scuttle freq, impedance, and phase vectors
# clearing variables helps to recover memory when needed
Though not efficient in terms of storage and likely speed, extracting
the data into named variables helps me to keep track of what each
variable is. I am not an expert by any means.