For example, if a = [2 4 7 3 4], it would be 2x^4 + 4x^3 + 7x^2 + 3x + 4.
And say x = [1 2 4 5]. The program should take a and differentiate it (in this case giving 8x^3 + 12x^2 + 14x + 3) and then apply it to the values in the vector x. So this input would return 37, 143, 763, 1373.
Another example, if a = [1 2 0 1] (meaning 1x^3 + 2x^2 + 1 which is differentiated to 3x^2 + 4x) and x = [1 2 3], then the output would be 7, 20, 39.
I cannot use existing matlab functions here. Does anyone know how i would go about making this function? Thanks.
Everything you have said here points to this being a homework problem. People here are more inclined to give homework hints when the student first exhibits some genuine effort at having solved it themselves.
the cyclist