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!