Creating a function with varying numbers of input parameters
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sebastian Daneli
le 29 Sep 2020
Réponse apportée : Abdolkarim Mohammadi
le 29 Sep 2020
Hi
I am writing a function to plot data for me in different ways. I would like to decide in which way to plot the data when i call the function. For example, if i write
myfunction(f,k,'stem')
then I would like the result to be a stem plot. If i were to write
myfunction(f,k)
then the result should be different, but nevertheless work.
0 commentaires
Réponse acceptée
Abdolkarim Mohammadi
le 29 Sep 2020
You should use Variable-length input argument list using varargin().
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Objects 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!