i need help on making loop for given equation
2 次查看(过去 30 天)
显示 更早的评论
hello professionals.. I have problem in making loop for given equation ab-cd=1..in this i have to choose random value for a and c but b and d are previously calculated.if value of ab-cd equal to one then display otherwise goes to step where a and c are randomly selected.can u plz help me regarding this..thanks alot
0 个评论
采纳的回答
Ammar
2013-4-11
for i = 1:M
a = rand(1);
c = rand(1);
res = a*b - c*d;
if res == 1
disp('')
end
end
0 个评论
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!