Creating a function with varying numbers of input parameters
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sebastian Daneli
el 29 de Sept. de 2020
Respondida: Abdolkarim Mohammadi
el 29 de Sept. de 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 comentarios
Respuesta aceptada
Abdolkarim Mohammadi
el 29 de Sept. de 2020
You should use Variable-length input argument list using varargin().
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!