How change only second number in a=ones(1,10)?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Akzeptierte Antwort
Dyuman Joshi
am 16 Jan. 2024
Simply use indexing to change the element -
a = ones(1,10);
a(2) = 2
0 Kommentare
Weitere Antworten (1)
Jaime Abad Arredondo
am 16 Jan. 2024
You should look at the syntax for array slicing. In matlab it's fairly easy. You would do something like:
a=ones(1,10);
disp(a)
a(2)=2;
disp(a)
Cheers!
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
