How to find values fron their location?
    4 ビュー (過去 30 日間)
  
       古いコメントを表示
    
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 件のコメント
  Shameer Parmar
      
 2019 年 7 月 8 日
				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
      
      
 2019 年 7 月 8 日
				What is the intention of
for sun = 1:1:p  j = 1:1:l ; 
?
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



