フィルターのクリア

automatically cycle through function inputs

4 ビュー (過去 30 日間)
Philip Hoskinson
Philip Hoskinson 2015 年 7 月 24 日
コメント済み: Nitai Fingerhut 2019 年 5 月 30 日
I want to simplify a function so that I don't have to create multiple loops for each input:
function [] = NAME( a,b,c,d,e,g,e,h,th,sg,r etc..)
for i = (number of inputs??)
figure(i)
plot( automatically cycle through inputs)
end

回答 (1 件)

Fabio Freschi
Fabio Freschi 2015 年 7 月 24 日
use varargin:
function name(varargin)
for i = 1:nargin
figure(i), plot(varargin{1});
end
end
  2 件のコメント
Philip Hoskinson
Philip Hoskinson 2015 年 7 月 24 日
Should be varargin{i} instead of {1} ?
Nitai Fingerhut
Nitai Fingerhut 2019 年 5 月 30 日
yes

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDesktop についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by