I want to get the values of a,b,c,d when T =1 as an example
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Mahmoud Reda
am 16 Jun. 2022
Kommentiert: Mahmoud Reda
am 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
0 Kommentare
Akzeptierte Antwort
KSSV
am 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 Kommentare
Weitere Antworten (1)
l l
am 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
0 Kommentare
Siehe auch
Kategorien
Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!