MATLAB Answers

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
Alejandro Fernández 2020년 7월 26일
I found the solution, thank you so much.
if isempty(find(strcmpi(varargin,'method'), 1))
method = 'csape';
method = varargin{find(strcmpi(varargin,'method'), 1)+1};

추가 답변(0개)




Community Treasure Hunt

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

Start Hunting!

Translated by