How to change array element with another array
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mirza M
am 4 Dez. 2014
Beantwortet: Andrei Bobrov
am 4 Dez. 2014
hi all, so i have 2 array and i want to change the value of array1 to array2. for example i have:
a = [1 1 1; 1 1 1; 1 1 1]
b = [4 4; 4 4]
and i want the array to be like this :
c = [4 4 1; 4 4 1; 1 1 1]
basicaly i want 'b' to be inside 'a' and replace all element 'a' in the same position as 'b' hehe what is the simplest code for this? thanks
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 4 Dez. 2014
a = [1 1 1; 1 1 1; 1 1 1]
b = [4 4; 4 4]
[n,m]=size(b)
a(1:n,1:m)=b
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu NaNs 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!