Creating a function in MATLAB
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Here is my question. I feel like this is an easy task but somehow cannot create a function to do this for me.
Create a function which given a value x, returns a value f(x) according the
following equation:
f(x)=xsin(x).
Thanks for the help!
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 2 Fév 2013
Modifié(e) : Azzi Abdelmalek
le 2 Fév 2013
f=@(x) x*sin(x)
%or
function y=f(x)
y=x*sin(x)
0 commentaires
Plus de réponses (1)
Image Analyst
le 2 Fév 2013
Is this homework? Did you look up how to define functions in the help? Do you know that you need to use ".*" between the x and the sin?
0 commentaires
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!