필터 지우기
필터 지우기

how it works in the following example Vo=Vs.*(Vs>=0)

조회 수: 2 (최근 30일)
N/A
N/A 2013년 4월 16일
Vm=120*sqrt(2);R=2; dth=pi/100; wt=0:dth:4*pi; Vs=Vm.*sin(wt); Vo=Vs.*(Vs>=0); id=Vo/R; Vd=Vs-Vo; plot(wt,Vo);

채택된 답변

John Petersen
John Petersen 2013년 4월 16일
I believe you are asking what
Vo=Vs.*(Vs>=0);
does, correct?
.* is an element by element multiply. Vs>=0 returns a vector with ones for every element of Vs>=0, and 0 for every element where Vs<0. So the result is that Vo is the same as Vs where Vs is positive and 0 where ever Vs is negative.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by