vector problem , Suma de vectores
이전 댓글 표시
Como podria dar el valor del segundo vector al primero donde haya 0 , ejemplo lo haga 1 por uno
(solo lo cambie los valores(2) del vector B , rellenen los ( 0 ) del vector A , pero solo hasta la longitud del vector A (length))
por ejemplo:
A=[ 1 0 0 0 0 1 1 0 1 0 0 1 1 1 1 0 0 0 1 0 ];
B=[ 2 0 .5 1.4 0 .88 0 .45 .49 0 0 .23 0 .39 .18 0 0 -0.15 0 -.12 0 -.22 0 1.7 -.25 .41 -.35 -.12 ];
R=[ 1 2 .5 1.4 .88 1 1 .45 1 .49 .23 1 1 1 1 .39 .18 -.15 1 -.22 ];
se que podria ser con un for, pero aun no logro interpretarlo ?
por favor podrian ayudarme
댓글 수: 2
David Hill
2020년 8월 12일
Your example does not make any sense to me. Please explain more clearly.
ALEJANDRO ESPINOZA
2020년 8월 12일
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!