Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How to add with a Matrix

2 visualizaciones (últimos 30 días)
John Woods
John Woods el 19 de Jun. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I have a 1x276 matrix that I want to add 1 to each element but each time I do, my matrix turns to all ones. So for example lets say A=[32 45 96] and I want to make it B=[33 46 97] how do I do that?

Respuestas (1)

Walter Roberson
Walter Roberson el 19 de Jun. de 2020
Editada: Walter Roberson el 19 de Jun. de 2020
B = A + 1
or
B = A;
for idx = 1 : numel(B)
B(idx) = B(idx) + 1;
end

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by