79196426

Date: 2024-11-17 03:08:47
Score: 2
Natty:
Report link

Please post the code instead of an image of it. We can't do test with screenshots. Your code is badly indented around the for/end blocks. In for i, each iteration overwrites xin and fin values.

Here is a working input example:

mode(1)
for i=1:3, xf(i,:) = evstr(input("Enter data x, value f : ","s")); end
Enter data x, value f : 2, 34
Enter data x, value f : 3, 11
Enter data x, value f : 5, 67

Then

--> xf
 xf  = 
   2.   34.
   3.   11.
   5.   67.
--> Mean = sum(prod(xf,"c"))/sum(xf(:,2))
 Mean  = 
   3.8928571
Reasons:
  • RegEx Blacklisted phrase (2.5): Please post the code
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: S. Gougeon