title: Having a rank deficient matrix warning in MATLAB: Rank deficient, rank = 0, tol = NaN
body: <p>I've been trying to get this expression plotted in matlab but I keep getting the Warning: <em>Rank deficient, rank = 0,  tol = NaN</em> error message.</p>
  
  <p><img src="https://i.stack.imgur.com/QAlyy.png" alt="Mathematical model I&#39;m working on"></p>
  
  <pre><code>t = 1:1:14;
  n1 = 3.43-2.30i;
  lamda = 1550*1e-9;
  
  R = abs((1i*((1/n1)-n1)*sin(2*pi*n1*t/lamda))/(2*cos(2*pi*n1*t) + 1i*(1/n1) +n1)*sin(2*pi*n1*t/lamda)))^2;
  
  figure
  plot(t,R)
  xlabel('Number of graphene layers')
  ylabel('Reflectivity')
  </code></pre>
  
  <p>I'm trying to get something similar to this plot. Please can anyone help me on how to get this fixed? Sorry I'm still a newbie to MATLAB.</p>
  
  <p>Thank you</p>
  
  <p><img src="https://i.stack.imgur.com/hrcvB.png" alt="Plot I&#39;m trying to achieve"></p>