MATLAB Answers

0

How to create multiple cdfplot in one graph?

Asked by Yaser Khojah on 4 Sep 2019
Latest activity Commented on by Yaser Khojah on 4 Sep 2019
Accepted Answer by KSSV
I have tried to create a multiple cdfplot in one graph as below but I need an efficient way since I'm using this in a big matrix and would you please show how to include the legend as well please.
figure
for ki = 1:size(NPV_all,2)
cdfplot(NPV_all(:,ki)); hold on
end

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by KSSV
on 4 Sep 2019
 Accepted Answer

figure
hold on
lgd = cell(size(NPV_all,2),1) ;
for ki = 1:size(NPV_all,2)
cdfplot(NPV_all(:,ki));
lgd{ki} = strcat('column=',num2str(ki)) ;
end
legend(lgd)

  1 Comment

Thanks a lot for you help :)

Sign in to comment.