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!