Info

This question is closed. Reopen it to edit or answer.

how to use if in matlab for 2 matrix condition?

1 view (last 30 days)
sukma aditya
sukma aditya on 21 Aug 2019
Closed: MATLAB Answer Bot on 20 Aug 2021
i have 2 reflection coefficient equations R1 and R2 from K with condition absolute must below 1, i use if command for this situation .But when i plot the graph the absolute reflection coefficient still above 1. (K is matrix with 1 column and 201 row)
R1=K+sqrt(K.^2-1);
R2=K-sqrt(K.^2-1);
if abs(R1)<1
r=R1;
else
r=R2;
end

Answers (1)

madhan ravi
madhan ravi on 21 Aug 2019
r=R2;
r(abs(R1)<1)=R1
  1 Comment
sukma aditya
sukma aditya on 21 Aug 2019
im sorry can you write the full code?
i cant understand hehe

Products


Release

R2016a

Community Treasure Hunt

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

Start Hunting!