2
$\begingroup$

I have two lists and I want to find the value of MAC using below formulaformula. But the problem is transpose on the list is not permissible in Mathematica?. If I just carry out without transpose, I am getting MAC value as 1. which is wrong. I am expecting a MAC value which is between to 0.9-0.95. And the other question, Is Transpose function only applies for matrices?

Subscript[ϕ, 
  a] = {0., 0.00758684, 0.0151222, 0.0225548, 0.0298332, 0.036906, 
   0.0437221, 0.0502304, 0.0563798, 0.0621194, 0.0673986, 0.0721668, 
   0.0763735, 0.0799688, 0.0829025, 0.085125, 0.0865867, 0.0872383, 
   0.0870309, 0.0859154, 0.0838435, 0.0807667, 0.076637, 0.0714063, 
   0.0650272, 0.057452, 0.0486335, 0.0385245, 0.027078, 
   0.0142472, -0.0000147872, -0.0207673, -0.043783, -0.0688821, \
-0.095885, -0.124613, -0.154887, -0.18653, -0.219366, -0.25322, \
-0.287917, -0.323288, -0.359162, -0.395372, -0.431753, -0.468145, \
-0.504389, -0.540329, -0.575814, -0.610698, -0.644836, -0.67809, \
-0.710325, -0.741414, -0.771232, -0.799661, -0.826587, -0.851904, \
-0.875511, -0.897313, -0.917222, -0.935156, -0.95104, -0.964807, \
-0.976394, -0.985748, -0.992822, -0.997576, -0.999977, -1., \
-0.997627, -0.992848, -0.98566, -0.976065, -0.964077, -0.949712, \
-0.932996, -0.913962, -0.892648, -0.869101, -0.843373, -0.815522, \
-0.785615, -0.75372, -0.719916, -0.684284, -0.646911, -0.607891, \
-0.567319, -0.525299, -0.481935, -0.437337, -0.391619, -0.344896, \
-0.297288, -0.248917, -0.199906, -0.150381, -0.100469, -0.0502993, 0.};
Subscript[ϕ, x] = {8.61215*10^-6, 0.00907824, 0.0180589, 
  0.0268619, 0.0353983, 0.0435798, 0.0513177, 0.0585241, 0.0651109, 
  0.0709904, 0.0760754, 0.0802789, 0.0835142, 0.0856953, 0.0867361, 
  0.0865515, 0.0850563, 0.0821661, 0.0777966, 0.0718642, 0.0642853, 
  0.054977, 0.0438563, 0.0308408, 
  0.015848, -0.00120439, -0.02042, -0.0415716, -0.0645701, \
-0.0892686, -0.11552, -0.143179, -0.1721, -0.202138, -0.23315, \
-0.264993, -0.297527, -0.330612, -0.36411, -0.397886, -0.431805, \
-0.465736, -0.49955, -0.53312, -0.566323, -0.599037, -0.631146, \
-0.662535, -0.693093, -0.722713, -0.751293, -0.778732, -0.804937, \
-0.829815, -0.853282, -0.875254, -0.895657, -0.914417, -0.931468, \
-0.946747, -0.960198, -0.971769, -0.981414, -0.989092, -0.994769, \
-0.998413, -1., -0.999512, -0.996936, -0.992263, -0.985491, \
-0.976624, -0.965671, -0.952645, -0.937566, -0.920459, -0.901355, \
-0.880288, -0.857298, -0.832431, -0.805737, -0.777269, -0.747088, \
-0.715256, -0.68184, -0.646913, -0.610549, -0.572828, -0.533831, \
-0.493644, -0.452356, -0.410057, -0.366842, -0.322806, -0.278048, \
-0.232667, -0.186765, -0.140444, -0.0938079, -0.0469617, \
-0.0000101546}
mac = (Abs[
 Subscript[ϕ, a].Subscript[ϕ, x]])^2/((Subscript[ϕ, 
    a].Subscript[ϕ, x]) (Subscript[ϕ, x].Subscript[ϕ, 
    a]))
$\endgroup$
4
$\begingroup$

With corrected formula mac=...:

mac = (Abs[Subscript[\[Phi], a].Subscript[\[Phi], x]])^2/((Subscript[\[Phi],a].Subscript[\[Phi], a]) (Subscript[\[Phi],x].Subscript[\[Phi], x]))
(* 0.986738*)
$\endgroup$
  • $\begingroup$ There is a typo in my code, I didn't realize it. Thanks. and why Transpose work for {{ elements}}, not for {elements}? $\endgroup$ – acoustics Aug 2 at 7:25
  • 4
    $\begingroup$ @acoustics In MMA a onedimensional list has no orientation. "row" or "column" are meaningless. $\endgroup$ – Ulrich Neumann Aug 2 at 7:31
  • 1
    $\begingroup$ @acoustics, the difference is that Depth[{{1, 2}}] - 1 gives 2, while Depth[{1, 2}] - 1 gives 1, and Transpose[] is only intended for those cases where Depth[list] - 1 is 2 or higher. See also this thread and this thread. $\endgroup$ – J. M. will be back soon Aug 2 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.