Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How to handle this loop?

1 Ansicht (letzte 30 Tage)
Abhinav
Abhinav am 22 Mär. 2015
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I have a loop in my code as below
for i=1:n-1
k=1:sz1;
temp=rand(1,sz1)
if temp(1,:)<=0.6
QAKAN1(i,k)=QAKAN11(:,k).*temp(:,k)
QAKAN11=QAKAN11(:,k)-QAKAN1(i,k)
end
end
QAKAN1
where 'n' and 'sz1' are integers. The problem is that if temp is greater than 0.6, it is executing the loop and returning the result as 0.
0 0
182.93 1789.8
0 0
249.72 682.57
Please help in solving the problem.
QAKAN11= 1125 3323

Antworten (0)

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by