r=1:0.5:9;
i=0.5:0.5:4.5; n=12;
p=1./(n*log(1+0.01.*i));
t=log(r).*p;
figure; plot(r,t); xlabel('r');ylabel('t');

 채택된 답변

Star Strider
Star Strider 2017년 4월 17일

0 개 추천

You can’t plot it because ‘r’ is (1x17) and ‘p’ is (1x9). You cannot multiply vectors whose lengths are not the same, at least the way you have written your code.

댓글 수: 2

Catherine Ma
Catherine Ma 2017년 4월 17일
thank you so much!
Star Strider
Star Strider 2017년 4월 17일
As always, my pleasure!
If you want to create them both to be the same lengths, with different increments (or ‘step length’), you can use the linspace function.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2017년 4월 17일

댓글:

2017년 4월 17일

Community Treasure Hunt

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

Start Hunting!