Hey guys, i need help with vector maniuplation

4 visualizaciones (últimos 30 días)
Shameendra Narayan Halder
Shameendra Narayan Halder el 24 de Jun. de 2018
Comentada: Paolo el 24 de Jun. de 2018
Hey guys, can someone help me with this?
Create vector “v” (begin at -3 and end at 3, step size 1). Create a vector "w" which includes all elements from "v" but multiply all values which are smaller/equal "0" (<0) by 2.

Respuesta aceptada

Paolo
Paolo el 24 de Jun. de 2018
v = -3:1:3
w = v
w(w<0) = w(w<0)*2
  2 comentarios
Shameendra Narayan Halder
Shameendra Narayan Halder el 24 de Jun. de 2018
Thanks a lot! Works perfect
Paolo
Paolo el 24 de Jun. de 2018
You are welcome, don't forget to mark the answer as accepted.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by