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 ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!