How to draw the contour lines in MATLAB.

2 views (last 30 days)
Can any any one help me how to draw the contour lines in MATLAB. I have data in Excel. i Need to draw contour lines for 0.1, 0.2 till 1.

Accepted Answer

Walter Roberson
Walter Roberson on 24 Feb 2021
data = readmatrix('Sai.xlsx');
contour(data, 0.1:0.1:1)
colorbar
  4 Comments

Sign in to comment.

More Answers (2)

Benjamin Kraus
Benjamin Kraus on 23 Feb 2021
The answer depends in part on how the data is formatted in Excel, but something like this should get you started (see attached spreadsheet):
tbl = readtable('Peaks.xlsx');
contour(tbl.Variables,0.1:0.1:1);
  4 Comments
SARVESH R
SARVESH R on 24 Feb 2021
Sir i got an error like this
Warning: Variable names were modified to make them valid MATLAB identifiers.
> In makeValidName at 25
In @table\private\setVarNames at 48
In table.readXLSFile at 113
In table.readFromFile at 35
In readtable at 118
In Contour at 2
Error using table/subsrefDot (line 76)
Unrecognized variable name 'variables'.
Error in table/subsref (line 62)
[varargout{1:nargout}] = subsrefDot(t,s);
Error in Contour (line 6)
contour(tbl.variables,0.1:0.1:1)

Sign in to comment.


SARVESH R
SARVESH R on 24 Feb 2021
Sir i would like to draw the contour lines for 0.9, 0.8,0.7, 0.6,0.5,0.4,0.3,0.2 and 0.1

Products


Release

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by