Having a function input be a function handle
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Whos finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!