please solve problem index increase matrix dimension.

2 visualizaciones (últimos 30 días)
Junaid Qadir
Junaid Qadir el 10 de Ag. de 2017
Editada: José-Luis el 10 de Ag. de 2017
%%%Total energy consumption
NumberOfNodes=225;
Etotal_DBR=0;
et=0
plot(NumberOfNodes(1:10:end),Etotal_DBR(1:225),'r--o','LineWidth',2)
xlabel('NumberOfNodes')
ylabel('Total Energy consumption in joules')
title('Total Energy consumption of the network')
hold on
legend('DBR' ,'Etotal_DBR')
axis([0 500 0 1200])
plot(x,y)
grid on
hold off
  1 comentario
KSSV
KSSV el 10 de Ag. de 2017
Your NumberOfNodes, Etotal_DBR are scalars (single number) and in plot you are treating them as a vector....

Iniciar sesión para comentar.

Respuestas (1)

José-Luis
José-Luis el 10 de Ag. de 2017
Editada: José-Luis el 10 de Ag. de 2017
Both NumberOfNodes and Etotal_DBR are scalars and it seems that you want to treat them as arrays and actually do some indexing.
That ain't gonna jive.
For the obsessive: I realize a scalar is a 1x1 array.

Categorías

Más información sobre Sparse Matrices 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