How to solve "A numeric or double convertible argument is expected"

I have started writing the code below for a regression project and on the first plot I am getting this error:
Error using plot
A numeric or double convertible
argument is expected
How do I fix this?
R=readtable('Regression_Rainfall_2015.xlsx');
Easting=R(:,2);
Northing=R(:,3);
Elevation=R(:,4);
Slope=R(:,5);
Aspect=R(:,6);
MinDistCoast=R(:,7);
Jan=R(:,8);
Feb=R(:,9);
Mar=R(:,10);
Apr=R(:,11);
May=R(:,12);
Jun=R(:,13);
Jul=R(:,14);
Aug=R(:,15);
Sep=R(:,16);
Oct=R(:,17);
Nov=R(:,18);
Dec=R(:,19);
figure(1)
plot(Jan, Northing)

 Accepted Answer

You are not addressing the table correctly. Use curly braces {} (as for a cell array) instead.
This should work:
Northing = R{:,3};
Jan = R{:,8};
figure(1)
plot(Jan, Northing)
Change the rest of your code as well.

More Answers (0)

Products

Tags

Community Treasure Hunt

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

Start Hunting!