How do is solve the problem of ' subscripted assignment dimension mismatch' in below code
1 回表示 (過去 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 で Discrete Data Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!