필터 지우기
필터 지우기

how to compute a for cycle in copulapdf varying nu parameter from 1 to 8

조회 수: 2 (최근 30일)
I have to use copulapdf command and create different figures from it, varying the parameter nu from 1 to 8. The code for the copula pdf for the nu value=1 is:
nu=1;
r=0.5;
u = linspace(0,1,20);
[u1,u2] = meshgrid(u,u);
rho1 = copulaparam('t',r,nu);
y = copulapdf('t',[u1(:),u2(:)],rho1,nu);
surf(u1,u2,reshape(y,20,20))
xlabel('u1')ylabel('u2')
This script works but i want to find a way to have figures automatically for different values of nu. Can someone help me to write the for cycle for this purpose?

채택된 답변

Jeff Miller
Jeff Miller 2018년 8월 29일
Not sure if this is what you want, but it looks easy enough. Change the first line to
for nu=1:8
add
end
as the last line. And insert
figure;
before the surf command.
  댓글 수: 5
EM geo
EM geo 2018년 8월 29일
Very good, it works! really really thank you! The final script corrected is:
for nu=1:8
r=0.5;
u = linspace(0,1,20);
[u1,u2] = meshgrid(u,u);
y = copulapdf('t',[u1(:),u2(:)],r,nu);
figure;
surf(u1,u2,reshape(y,20,20))
xlabel('u1');
ylabel('u2');
end

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by