Azzera filtri
Azzera filtri

How to find values fron their location?

2 visualizzazioni (ultimi 30 giorni)
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 Commenti
Shameer Parmar
Shameer Parmar il 8 Lug 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 il 8 Lug 2019
What is the intention of
for sun = 1:1:p j = 1:1:l ;
?

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by