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

 채택된 답변

Stephen23
Stephen23 2016년 7월 8일
편집: Stephen23 2016년 7월 8일

1 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2016년 7월 8일

편집:

2016년 7월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by