How to solve the error 'Row index exceeds table dimensions'

Hi,
I am trying to plot a graph in matlab by using simple code but it shows me 'Row Index exceeds table dimensions'.
Please see the error message below:
Please see the snapshot of my table:
Please advise
Thanks

 Accepted Answer

You haven't shown us the size of your table, which would be helpful given the error message you are getting. My suspicion is that, in MATLAB, your table does not have 3843 rows. Based on your indexing, and the fact you used readtable, I suspect if you use 1:3842, your code will work. If that is the case, then you can just use a colon instead to indicate all rows.
f{:,8:11};
f{:,4:7};

5 Comments

Hi Cris,
Please find the 2 images one for error message I am receiving after running the new code and other is showing that my table has 3843 row. Could you advise what to do next to solve this issue?
Thanks
Row 1 does not get imported, so the size of your table in MATLAB is 3842. Check the size in the Workspace in MATLAB, not in Excel. The solution given in my first reply will fix the error you are getting.
Thanks Cris, it's working now.
By the way if I want to plot a scatter plot what would be the code?
Cheers!

Sign in to comment.

Categories

Products

Release

R2020b

Community Treasure Hunt

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

Start Hunting!