find the minimum value

2 visualizaciones (últimos 30 días)
arian hoseini
arian hoseini el 25 de Jun. de 2022
Editada: arian hoseini el 25 de Jun. de 2022
i need to find which LD(:,6) is min for example min of LD(:,6) between Z2(14)&Z2(2) is 70Km then i need to sumZ2(2) with Z(1) but im confused here
tic
clc
clear all
% -------------------------------Input Data--------------------------------
% Line characeteristics
% bus R line X km
LD = [1 2 0.004 1 0.05i 100
1 3 0.0057 2 0.0714i 70
3 4 0.005 3 0.0563i 80
4 5 0.005 4 0.045i 100
5 6 0.0045 5 0.0409i 110
2 6 0.0044 6 0.05i 90
1 6 0.005 7 0.05i 100];
%Relay 1 2 3 ...
CTR= [240 240 160 240 240 240 160 240 160 240 240 240 240 160];
% a = Angle(45);
PTR= 150e3/110;
%----------------------------- zone (1) ----------------------------------%
for k = 1 : 2
for b=1:7
z(b,1)=(LD(b,3)+LD(b,5))*LD(b,6);
theta(b,1) = angle(z(b,1));
z = abs(z);
end
end
z=repmat(z,2,1);
theta=repmat(theta,2,1);
for b= 1:14
zsz1(1,b) = (0.8*(z(b,1))/(cos((theta(b,1)-45)*pi/180))*(CTR(1,b)/PTR));
end
%----------------------------- zone (2) ----------------------------------%
Z=zsz1*1.25; %100 Percentage of Line
Z=Z'
Z2=Z/2 %50 Percentage Line
Z3=[Z(1)+min(Z2(14),Z2(2))] %this line is wrong i need to find which LD(:,6) is min for example min of LD(:,6) between Z2(14)&Z2(2) is 70Km
toc
  2 comentarios
Image Analyst
Image Analyst el 25 de Jun. de 2022
"but im confused here" <== you're not the only one. 🤨
You say "i need to find which LD(:,6) is min" so why can't you just do
[minValue, indexOfMinValuke] = min(LD(:, 6);
arian hoseini
arian hoseini el 25 de Jun. de 2022
Editada: arian hoseini el 25 de Jun. de 2022
first i calculated Z and Z2 now i need to find which LD is min for (Z2(14),Z2(2)) but u are calculating min LD for the whole column....LD for Z2(14) is 100Km and for Z2(2) is 70Km so Z2(2) is min here after that i need to calculate Z3

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by