how to replace values in matrix across entire row

1 visualizzazione (ultimi 30 giorni)
I want to replace current values in a particular row of matrix with different values for each index in that particular row

Risposta accettata

Walter Roberson
Walter Roberson il 4 Set 2022
%example data
A = randi(9, 8, 4)
A = 8×4
9 3 8 5 2 9 3 9 6 9 8 9 8 6 3 1 7 2 2 1 7 8 8 1 5 2 8 9 4 8 7 9
%example row-based operations
A(3,:) = A(3,:).^2 - 2
A = 8×4
9 3 8 5 2 9 3 9 34 79 62 79 8 6 3 1 7 2 2 1 7 8 8 1 5 2 8 9 4 8 7 9
A(6, :) = randi([10 19], 1, 4)
A = 8×4
9 3 8 5 2 9 3 9 34 79 62 79 8 6 3 1 7 2 2 1 16 11 10 10 5 2 8 9 4 8 7 9

Più risposte (0)

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by