Skip to main content
3-Newcomer
April 19, 2023
Solved

This value must be integer

  • April 19, 2023
  • 2 replies
  • 2909 views

please I don't know how to overcome this error

HA_10661232_0-1681937224385.png

 

 

 

Best answer by ttokoro

image.pngimage.png

image.png

2 replies

ttokoro
21-Topaz I
ttokoro21-Topaz IAnswer
21-Topaz I
April 19, 2023

image.pngimage.png

image.png

t.t.
21-Topaz II
April 19, 2023


Hi,

Here is the pwrfit() to the data.

Capture.JPG

Cheers

Terry

3-Newcomer
April 19, 2023

thank you Mr.Terryhendicott you are so kind

 

25-Diamond I
April 20, 2023

You may use "submatrix" to get only parts of your vectors and use "slope" on them.

The two slopes you seem to be looking for are

Werner_E_0-1681954574225.png

 

You may also use "line" to get slope and intersect for the linear regression in one go and use them to draw the line fit

Werner_E_1-1681954669477.png

 

3-Newcomer
April 20, 2023

thanks, Mr. Werner that's so helpful. But the reason I exclude some values from the vector is that I can't conduct log(0), I tried to do a program in Mathcad to fulfill this but I couldn't make it, can you please help me out to do this issue in a program that calculates the slope of between the log of the data with excluding any value that equals to zero 

 

with regards

 

25-Diamond I
April 20, 2023

Here is a way to eliminate all values in a vector which are zero or negative:

Werner_E_0-1681996657420.png

 

The method will fail if no values of zero or below are in the vector because match will fail in that case.
You can deal with this problem by using "try ... on error..."

Werner_E_1-1681996941106.png

One drawback still remains - if all values are zero or negative, this routine returns the vector unchanged instead of returning an error or Nan or the like. Don't think this would be an issue in your application, though.