automatically cycle through function inputs
3 ビュー (過去 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
0 件のコメント
回答 (1 件)
Fabio Freschi
2015 年 7 月 24 日
use varargin:
function name(varargin)
for i = 1:nargin
figure(i), plot(varargin{1});
end
end
参考
カテゴリ
Help Center および File Exchange で MATLAB Report Generator についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!