Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
N/A
N/A el 16 de Abr. de 2013
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);

Respuesta aceptada

John Petersen
John Petersen el 16 de Abr. de 2013
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.

Más respuestas (0)

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by