Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
thank you Mr.Terryhendicott you are so kind
Thank you very much Mr. Ttokoro your solution is perfect
why it's not possible to conduct the slope directly like the attached picture without creating the variables LNkrw and LNSwn
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
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
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
Here is a way to eliminate all values in a vector which are zero or negative:
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..."
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.
thank you so much Mr. Werner, this is fancier way, thank you for your support.