How do I create a vector which elements are the output of another vector run through an equation?

Okay so I have an equation (a polynomial) and a starting vector. What I need is for each element of the vector to be input into the polynomial and the output of that be made into a new vector. I hope that makes sense.... essentially what I have is y=x^2 p=[1;2;3;4] and what I need to happen is have some way to make a vector r such that r=[1;4;9;16]. Does anybody know how to do this?? Thanks!

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 9 Mar 2021

Commented:

on 22 Sep 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!