필터 지우기
필터 지우기

Getting A Blank Plot From Code

조회 수: 1 (최근 30일)
Luis
Luis 2022년 11월 21일
답변: David Hill 2022년 11월 21일
I am attempting to plot the relation between two variables, but when I run the plot command, I receive a blank graph. Here is my code:
>> Yp=62e9;
>> Yfca=250e9;
>> yfsi=480e9;
>> d31=-320e-12;
>> a=linspace(0,1);
>> d31eff=-d31./((log(1-a)).*(1./a-0.5));
>> vp=1;
>> d31multi=d31eff.*Yp.*vp./((Yp-Yfca)*vp+Yfca)
>> plot(a,d31multi/d31eff)

답변 (2개)

Star Strider
Star Strider 2022년 11월 21일
It is necessary to do element-wise division in the plot call second argument:
d31multi./d31eff
However there are other problems, and I must defer to you to solve.
Yp=62e9;
Yfca=250e9;
yfsi=480e9;
d31=-320e-12;
a=linspace(0,1);
d31eff=-d31./((log(1-a)).*(1./a-0.5));
vp=1;
d31multi=d31eff.*Yp.*vp./((Yp-Yfca)*vp+Yfca)
d31multi = 1×100
1.0e-09 * NaN -0.3200 -0.3200 -0.3200 -0.3200 -0.3199 -0.3199 -0.3199 -0.3198 -0.3198 -0.3197 -0.3196 -0.3196 -0.3195 -0.3194 -0.3193 -0.3192 -0.3191 -0.3189 -0.3188 -0.3186 -0.3185 -0.3183 -0.3181 -0.3180 -0.3178 -0.3175 -0.3173 -0.3171 -0.3168
Lv = ~isnan(d31multi);
plot(a,d31multi./d31eff)
.

David Hill
David Hill 2022년 11월 21일
Yp=62e9;
Yfca=250e9;
yfsi=480e9;
d31=-320e-12;
a=linspace(0,1);
d31eff=-d31./((log(1-a)).*(1./a-0.5));
vp=1;
d31multi=d31eff.*Yp.*vp./((Yp-Yfca)*vp+Yfca)
d31multi = 1×100
1.0e-09 * NaN -0.3200 -0.3200 -0.3200 -0.3200 -0.3199 -0.3199 -0.3199 -0.3198 -0.3198 -0.3197 -0.3196 -0.3196 -0.3195 -0.3194 -0.3193 -0.3192 -0.3191 -0.3189 -0.3188 -0.3186 -0.3185 -0.3183 -0.3181 -0.3180 -0.3178 -0.3175 -0.3173 -0.3171 -0.3168
plot(a,d31multi./d31eff);%forgot the '.' all ones

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by