find the minimum value
5 views (last 30 days)
Show older comments
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 Comments
Image Analyst
on 25 Jun 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);
Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!