Having a function input be a function handle
Mostra commenti meno recenti
Hi I am trying to make it so one of my inputs is a function handle so for example make it sin(x). Here is the code I have written so far. Thank you in advance for any help you can offer.
function []=Desmond(myfunction,n)
mytest=@(x) sin(x)
mytest=myfunction
x=-10:10;
y=myfunction(x).^n;
plot(x,y)
end
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Whos in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!