How do is solve the problem of ' subscripted assignment dimension mismatch' in below code
조회 수: 3 (최근 30일)
이전 댓글 표시
lambda=0:1:10;
t=20;
MTBF=lambda.^-1;
R(t)=exp(-t./MTBF);
MTTF=MTBF-t;
plot(MTBF,lambda,R(t),lambda,'--',MTTF,lambda,'o');
ylabel('Failure rate');
title('Mean time between failure,Reliability function,Mean time to failure Vs. Rate of failure')
댓글 수: 0
답변 (1개)
Star Strider
2017년 10월 14일
Try this:
lambda=0:1:10;
t=20;
MTBF = 1./lambda;
R = @(t) exp(-t./MTBF);
MTTF = MTBF-t;
plot(MTBF,lambda, R(t),lambda,'--', MTTF,lambda,'o');
ylabel('Failure rate');
title('Mean time between failure,Reliability function,Mean time to failure Vs. Rate of failure')
You might also want to consult the documentation for the legend function.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!