for i = 1 :1: N
for j = 1 :1: N
if u(i,j) < 1-a(i,j) && N<1- (u(i,j)/(1-a(i,j)))
z= (1-a(i,j))*N
end
end
end

4 Kommentare

Rik
Rik am 17 Nov. 2020
This time I edited your question for you. Next time, please use the tools explained on this page to make your question more readable.
What do you mean by 'it doesn't work'?
Peter Perkins
Peter Perkins am 19 Nov. 2020
Also, you don't need loops at all.
z = zeros(size(a));
i = (u < 1-a) && (N < 1 - u./(1-a))
z(i) = (1-a(i)) .* N;
Nirajan Khatri
Nirajan Khatri am 20 Nov. 2020
@ Rik thank you, i have u matrix and a matrix so i was trying to use conditional loop, next time i will surely do it
Nirajan Khatri
Nirajan Khatri am 20 Nov. 2020
@ Peter Perkins Sir thank you

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 17 Nov. 2020

Kommentiert:

am 20 Nov. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by