2015-02-04 6 views
0

파라 메트릭 1-D 함수를 조작하는 방법을 알고 싶습니다. 예를 들어, 매개 변수 a의 differente 값에 대해 가우시안을 플롯하고자합니다. f (x) = exp (-a * (x-1) ** 2)gnuplot의 파라 메트릭 함수

다른 함수 f x)를 사용하여 많은 값을 계산할 수 있지만,이 함수를 a = 1,2,3 등으로 표시하는 방법이 있는지 궁금합니다.

감사합니다. 이 입력으로 변수 매개 변수를 사용하도록

+0

에서 "파라 메트릭 기능"을 구별 할주의 "매개 변수가있는 함수". 첫 번째는 x = cos (t), y = sin (t) (파라 메트릭 집합으로 플롯)과 같은 플롯을 참조하며, 두 번째 매개 변수는 사용자가 묻는 유형의 매개 변수입니다. – Daniel

답변

3

예, 당신의 함수를 정의 : 위에

f(x,a)=exp(-a*(x-1)**2) 

그리고 루프를.

plot for [a=1:3:1] f(x,a) t "a = ".a 

또는 값의 목록을 이용하여 : 사용

plot for [a in "1 2 3"] f(x,a) t "a = ".a 

enter image description here

1

을 다음 이것은 시퀀스 ("1 1 간격으로 3 ')에서 수행 될 수있다

gnuplot> f(x) = a*x 
gnuplot> plot for [a = 1:3:1] f(x) title sprintf("a=%d",a) 

나는 다음과 같은 그래프를 얻을 명령

enter image description here

다음과 같은 명령으로 당신이 얻을 수있는 설명을 읽을 수 있습니다

gnuplot> help for 
The `plot`, `splot`, `set` and `unset` commands may optionally contain an 
iteration for clause. This has the effect of [...] 

gnuplot> help sprintf 
`sprintf("format",var1,var2,...)` applies standard C-language format specifiers 
to multiple arguments and returns the resulting string. If you want to 
use gnuplot's own format specifiers, you must instead call `gprintf()`. 
For information on sprintf format specifiers, please see standard C-language 
documentation or the unix sprintf man page. 

HTH가

관련 문제