MATLAB: Interpolation using the floor function

MATLAB: Interpolation using the floor function

matlab error

When I try to run this line of code I keep getting an error saying Unbalanced or unexpected parenthesis or bracket.
e= (((t-time[floor(t/30)])/(time[floor(t/30)+1]-time[floor(t/30)]))*e1) + (((time[floor(t/30)+1]-t)/(time[floor(t/30)+1]-time[floor(t/30)+1))*e0)
I was just wondering if anyone knows what I have done wrong as I cannot seem to get it to run.
Thanks

Best Answer

  • This is not accepted MATLAB syntax:
    time[floor(t/30)]
    The [] operator is used for concatenation. MATLAB array indexing uses ()
  • Add a Comment

    Your email address will not be published. Required fields are marked *