I have figured out the polyval function. Do you have any ideas as to how I could write a function to differentiate a polynomial of the form
p(x) = p(1) * x^(n) + p(2) * x^(n-1) + p(3)*x^(n-2) + ... + p(n)*x + p(n-1)
User Profile
Collapse
-
How could I fix it? I am new to C++ and I want px to be the value of the polynomial when evaluated at x.Leave a comment:
-
Matlab's polyval and polyder in C++
Hello, I am trying to write functions that behave exactly as the polyval and polymer functions do in Matlab. My code is outputting the wrong solution and I am not sure where my errors are. Thank you
...Code:#include <iostream> #include <cmath> using namespace std; float polyval(float*, int, float); void polyder(float*, int, float*); int main() { int n;
No activity results to display
Show More
Leave a comment: