How to make the vector the same length

3 ビュー (過去 30 日間)
Jackson
Jackson 2020 年 2 月 27 日
コメント済み: Jackson 2020 年 2 月 27 日
Vds = [0.1 0.2 0.3 0.4 0.5 1.0 2.0 4.0 6.0 8.0 10.0];
Vgs = [1.50 2.00 2.25 2.50];
a = [0.2274 0.2931 0.3161 0.3267 0.3317 0.3406 0.3450 0.3540 0.3608 0.3640 0.3666];
b = [2.804 4.299 5.28 6.06 6.33 6.81 7.143 7.62 8.08 8.35 8.63];
c =[6.859 10.852 13.400 15.11 16.25 18.91 18.85];
d= [15.4 25.01];
Im trying to plot(Vds,a,Vds,b,Vds,c,Vds,d) , but it keeps saying that d and c are not the same length as Vds. How do i make it so that c and d are the same length?
  3 件のコメント
Guillaume
Guillaume 2020 年 2 月 27 日
"How do i make it so that c and d are the same length?"
Create them so? I'm not sure what answer you expect. You're asking matlab to plot the value of Vds against the values of d. Vds has 11 values, d only two. That makes no sense. You also need 11 values for d (or only choose 2 of the vds values to plot). Only you know what any of the variable represent so only you can fix it.
Jackson
Jackson 2020 年 2 月 27 日
Thank you very much it worked

サインインしてコメントする。

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2020 年 2 月 27 日
when you do plot(x,y), x and y need to be same length. So in your code, Vds and d need to be same length, not between c and d
you could do
plot(Vds,a,Vds,b,Vds,c,Vds([1,end]),d)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by