I want my function to ignore some inputs
8 views (last 30 days)
Show older comments
Hello, I made a function called plotgeral that makes plots what I want with the format that I desire.
the 1st line of the function where i declare my outputs and inputs is:
out = plotgeral(Y,Y1,Y2,Y3,Y4,Y5,Xaxis title,Yaxis title,title,legend,legend1,legend2,legend3,legend4,legend5)
Sometimes I want to draw the plot with 6 inputs of data (Y -> Y5), but sometimes I just want the Y and Y1, for example. What should I do in this case? The name of Axis, title and legend are defined by me in the script with ' '.
I tried
out = plotgeral(Y,Y1,[],[],[],[],Xaxis title,Yaxis title,title,legend,legend,[],[],[],[])
but I get an error on the part of the legend, because [] it an invalid argument for the legend.
Thanks for your time.
Answers (0)
See Also
Categories
Find more on Legend in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!