Filter löschen
Filter löschen

simple doubt about vector

1 Ansicht (letzte 30 Tage)
Hugo Matias
Hugo Matias am 9 Nov. 2018
Bearbeitet: madhan ravi am 11 Nov. 2018
Hi I have a simple daught on matlab and I was hoping you could help me!
Imagine i generate a random vector:
a=randi(5,1,7)
and it generates: 1 3 4 2 5 1 2
My daught is: how do i replace the 1's by 10's?

Akzeptierte Antwort

madhan ravi
madhan ravi am 9 Nov. 2018
Bearbeitet: madhan ravi am 9 Nov. 2018
a=randi(5,1,7)
a(a==1)=10
  1 Kommentar
madhan ravi
madhan ravi am 9 Nov. 2018
Bearbeitet: madhan ravi am 11 Nov. 2018
If this is what you want make sure to accept the answer so that people know the question is solved else let know

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by