How to change a bit of matrix from 0 to 1

3 vues (au cours des 30 derniers jours)
Afluo Raoual
Afluo Raoual le 12 Mar 2021
Modifié(e) : Afluo Raoual le 15 Mar 2021
Dear members,
I have a matrix
and I have to write a program that verify if the final bits are '0' or '1'. If final bits are '0' the program change them to '1'.

Réponse acceptée

David Hill
David Hill le 12 Mar 2021
M(6:11:end)=1;%for your Matrix M
  3 commentaires
David Hill
David Hill le 12 Mar 2021
6=size(M,1)+1
11=size(M,1)*2+1
M(size(M,1)+1:size(M,1)*2+1:end)=1;
Afluo Raoual
Afluo Raoual le 12 Mar 2021
Thank you so much

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by