Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

could anyone help me how to solve the issue.

1 visualización (últimos 30 días)
jaah navi
jaah navi el 23 de Abr. de 2019
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
code:
A=[ 12 11 10 9;
8 7 6 5;
4 3 2 1]
B=[1 2 3 4;
5 6 7 8;
9 10 11 12]
C= partitions(3)
total = length(C)
idx = randperm(total,1)
D = C(idx)
partdisp(D)
for len_partition=1:length(D)
for len_cluster=1:length(D{len_partition})
display_user_inside_cluster=(D{len_partition}{len_cluster})
for b =1:size(B,2)
for a =1:size(A,1)
rate(a,b) =((A(a,b)).*(B(a,b)))
end
end
overallrate(len_cluster)= sum(sum(rate))
end
end
totalrate=sum(overallrate)
The above code executes and gives the result.In this code based on command partdisp(D),the overallrate(len_cluster)= sum(sum(rate)) gets calculated.
Could anyone help me how to make the command partdisp(D) based on overallrate(len_cluster)= sum(sum(rate)),
i.e,I want to make the code in the reverse order to execute.
Could anyone please help me on this.
  2 comentarios
Rik
Rik el 23 de Abr. de 2019
What is the reason you put partdisp before the loop then?
Jan
Jan el 23 de Abr. de 2019
You can replace
for b =1:size(B,2)
for a =1:size(A,1)
rate(a,b) =((A(a,b)).*(B(a,b)))
end
end
by
rate = A .* B;
But why is this called inside the loops at all? It has the same value.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by