0
$\begingroup$

I have used the following code in mathematica to perform mean to set of data.

Sig = N[Mean[Table[Transpose[Import[data[[i]],"Table",NumberPoint -> ","]][[2]], {i, 3, 8}]]]

But this works only for integer data and provide output, but for real numbers it provides output without performing calculation. like: I want the average of 2.2 and 4.4, which is 3.3, but mathematica shows 0.5(2.2+4.4) instead of 3.3.

How to solve this problem?

Please help me.

$\endgroup$
3
  • 3
    $\begingroup$ Look at the FullForm of your output. It looks like you are working with strings rather than numbers. ToExpression might be of use. Or you may want to change how you are doing the Import $\endgroup$
    – Bob Hanlon
    Apr 14 '18 at 13:13
  • $\begingroup$ No, I am not dealing with strings. I just try to perform mean of a set of data which aer numbers only, but mathematica is unable to perform mean when I wrote that code. it just shows the data how to do mean? $\endgroup$
    – P Pyne
    Apr 16 '18 at 3:14
  • $\begingroup$ Post the FullForm of your output that looks like 0.5(2.2+4.4) $\endgroup$
    – Bob Hanlon
    Apr 16 '18 at 4:36

Your Answer

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

Browse other questions tagged or ask your own question.