필터 지우기
필터 지우기

How to make the vector the same length

조회 수: 1 (최근 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 CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by