# I want to get the values of a,b,c,d when T =1 as an example

1 view (last 30 days)
Mahmoud Reda on 16 Jun 2022
Commented: Mahmoud Reda on 16 Jun 2022
This is the code for explanation
clc
clear all
a= 24:1:26;
b= 24:1:26;
c=24:1:26;
d=24:1:26;
m=length(a)
n=length(b)
f=length(c)
k=length(d)
for i=1:m;
for j= 1:n;
for l=1:f;
for o=1:k;
T(i,j,l,o)= (a(i)*b(j))/(c(l)*d(o))
end
end
end
end

KSSV on 16 Jun 2022
a= 24:1:26;
b= 24:1:26;
c=24:1:26;
d=24:1:26;
[a,b,c,d] = ndgrid(a,b,c,d) ;
a = a(:) ; b = b(:) ; c = c(:) ; d = d(:) ;
T = (a.*b)./(c.*d) ;
idx = T==1 ;
iwant = [a(idx) b(idx) c(idx) d(idx)] ;
##### 2 CommentsShowHide 1 older comment
Mahmoud Reda on 16 Jun 2022
How Can I do this using GUI ? I will be grateful if you guide me to complete that

l l on 16 Jun 2022
a= 24:1:26;
b= 24:1:26;
c=24:1:26;
d=24:1:26;
m=length(a);
n=length(b);
f=length(c);
k=length(d);
for i=1:m;
for j= 1:n;
for l=1:f;
for o=1:k;
T1= (a(i)*b(j))/(c(l)*d(o));
T(i,j,l,o)=T1;
if T1==1
sprintf('a=%f,b=%f,c=%f,d=%f\n',a,b,c,d)
end
end
end
end
end

R2018a

### Community Treasure Hunt

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

Start Hunting!