how to get the value of two variables with respect to fixed value.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
jaah navi
el 12 de Abr. de 2019
Comentada: KSSV
el 15 de Abr. de 2019
could anyone help me how to get the values of two variables A and B under the condition A<B,such that the sum of A and B should be (10,20,30,40,50).
0 comentarios
Respuesta aceptada
KSSV
el 12 de Abr. de 2019
A = 0:50 ;
B = 0:50 ;
S = [10 20 30 40 50] ;
[A,B] = meshgrid(A,B) ;
A(A>B) = NaN ;
C = A+B ;
% Get A<B but A+B = 10
idx = find(C==10) ;
[A(idx) B(idx) A(idx)+B(idx)]
10 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!