Function with value after string

2 次查看(过去 30 天)
Hi, i want to create a function with the same idea as the plot function when you write 'Marker' and then you put '+' it recognize de marker type, or when you put 'MarkerSize',15 etc.
In my case I need:
  • 'method','...'
  • 'scale',..
  • 'plott',..
Does someone know how to implement that?

采纳的回答

Alejandro Fernández
I found the solution, thank you so much.
if isempty(find(strcmpi(varargin,'method'), 1))
method = 'csape';
else
method = varargin{find(strcmpi(varargin,'method'), 1)+1};
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by