Borrar filtros
Borrar filtros

how to find resultant min Graph.

1 visualización (últimos 30 días)
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar el 20 de Dic. de 2018
Comentada: Shubham Mohan Tatpalliwar el 20 de Dic. de 2018
hello,
I am working on a project in which i have calculated some fuel consumption values at different states of the powertrain. so now i have 4 matrices of the values.
And i want to compare them all and take out the minimum values ina resultant graph.
Let the 4 matrices be A B C D
A=[1 2 3 4 5; 2 3 4 5 6; 5 6 7 8 9]
B=[2 3 4 5 6; 5 6 7 8 0; 0 0 0 0 0]
C=[0 0 0 0 0; 1 2 0 0 0; 3 4 0 0 0]
D=[0 0 0 5 6; 0 0 0 7 5; 0 0 0 0 0]
Zero would not be considered as the Minimum value
and the resultant expected matrix is
Result=[1 2 3 4 5; 1 2 4 5 5; 3 4 7 8 9]
  4 comentarios
madhan ravi
madhan ravi el 20 de Dic. de 2018
Can you explain how the final Result is obtained?
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar el 20 de Dic. de 2018
for every position it would comapre all 4 matrix and would slect the minimum one.
as in 1 st row all the min values are in A matrix so it has picked up that values
1 2 3 4 5
but for 2nd row
first two min values are in C 1 2
next 2 min values are in A 4 5
and last min value is in D 5
and thus it will do it further for every row

Iniciar sesión para comentar.

Respuesta aceptada

Stephen23
Stephen23 el 20 de Dic. de 2018
Editada: Stephen23 el 20 de Dic. de 2018
>> W = cat(3,A,B,C,D);
>> R = min(W./(W~=0),[],3)
R =
1 2 3 4 5
1 2 4 5 5
3 4 7 8 9

Más respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by