How to find values fron their location?

2 visualizaciones (últimos 30 días)
Mohammad Sulaiman Stanekzai
Mohammad Sulaiman Stanekzai el 6 de Jul. de 2019
Comentada: Walter Roberson el 8 de Jul. de 2019
In the following coding i am able to find the loction of values in "elseif" command but i cant find their values. Please help me.
Thanks in advance.
sym x;
sym y;
sym n;
sym z;
sym b;
pv = xlsread('POWER PV');
p = size (pv,1);
load = xlsread('LOAD');
pemfc = xlsread('PEMFC 1');
l = size (pemfc,1);
for sun = 1:1:p j = 1:1:l ;
if load(sun,1) < pv (sun,1);
x = pv(sun,1)-load (sun,1);
elseif load(sun,1) > pv (sun,1);
y = load(sun,1) - pv (sun,1);
z = find (pemfc(j,1)> y ,1); % it just shows the location of values. I also need thier values but i cant find it.
x = -z;
else
x = 0;
end
n(sun,1) = double (x)
end
  3 comentarios
Shameer Parmar
Shameer Parmar el 8 de Jul. de 2019
So as you are saying that the 'z' is location of values then you can find the value at z location as..
x = pv(z,1);
OR
x = load(z,1);
Walter Roberson
Walter Roberson el 8 de Jul. de 2019
What is the intention of
for sun = 1:1:p j = 1:1:l ;
?

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by