Creating a simple 2D contour plot from XYZ values from an excel table that I imported into Matlab
Show older comments
Hello everyone, As mentioned in the heading - I'm having trouble using data in an excel table that I imported into Matlab to then plot up a visual 2D contours plan using that data (XYZ data) The main problem I am having is... "Subscripting a table using linear indexing (one subscript) or multidimensional indexing (three or more subscripts) is not supported. Use a row subscript and a variable subscript."
Data is attached
Any help greatly appreciated :)
4 Comments
Guillaume
on 25 May 2018
The main problem I am having is ...
It's difficult to tell you what you're doing wrong if you don't tell us what you're doing.
In any case, it's really not clear what 2D contour you're hoping to obtain from your 3D data. There's not many point and they're scattered all over. No two point is at the same height (Z) so all the contours would be made of just one point.
Rhys Holmewood
on 25 May 2018
Guillaume
on 25 May 2018
The problem is underneath in "" i.e It's telling me to use a row subscript and a variable subscript
Yes, you've told us the error you're getting but not what you're doing to get that error
Rhys Holmewood
on 26 May 2018
Edited: Guillaume
on 26 May 2018
Accepted Answer
More Answers (1)
Ameer Hamza
on 25 May 2018
Edited: Ameer Hamza
on 25 May 2018
You can first convert the table into an array. For example
data = readtable('Contours.xls');
dataArray = table2array(data);
contourf(dataArray);

Categories
Find more on Contour Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!