automatically cycle through function inputs
조회 수: 2 (최근 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!