Question: Why am I getting the error index exceeds the number of array elements from this code. X MATLAB R2020b - academic use HOME PLOTS APFS
Why am I getting the error "index exceeds the number of array elements" from this code.

X MATLAB R2020b - academic use HOME PLOTS APFS LIVE EDITOR INSERT VIEW Search Documentation Sign In Task Section Break % Run Step Stop bal rind Files 5 A Normal New Open Save Sl Compare to Text BIUM Code Print Find - FILE NAVIGATE TEXT C: Usersweidr OneDrive Documents MATLAB C. Live Editor - C:\Users weicimOneDrive Documents MATLAB\lork02.inlx forhw02.mly + Control Relactor CODE Run Run and Advance Section Run to End SECTION RUN OS 1 2. 3 4 5 6 investment=12000 stock_percent-0.015 bond_percent-0.015 retirementamount=le6 yearly_stock_inv=1000 investment - 12889 stock_percent - 0.8150 bond percent = 0.8150 retirement amount - 1000020 yearly_stock_iny - 1800 d Workspace Name Value ans 31.7100 bond_percent 00150 gradyear 1941 gradyear_index 16 10 A investment 12000 EM 95x2 table rate retiremenilam.. 1000000 stock investm.. 1.0009+02 stock percent 00150 total investm.. 10000 year 95x7 double year_index 25 yearly stock i.. 1000 95x7 double 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 M = readtable("SP5rates.xlsx'); year-M{:,1}; %Curlique braces convert the table to vector rate=M{:,2); Curlique braces convert the table to vector plot(year,rate) gradyear_index-randi(55) gradyear-1925 grudyear_index rate(gradyear_index) i=18 year_index-gradyear_index+i-1 rate(year_index) total_investment-yearly_stock_inv*i while total investment
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
