フィルターのクリア

Making a countor map from a excel file

1 回表示 (過去 30 日間)
Chaklader Asfak
Chaklader Asfak 2011 年 8 月 2 日
Dear all,
I have excell file with 3 coloums with some numbers. top of the each coloums there is the name of variable (say, x, y and z). Anyone could help me what will be the code to make countor from the file ?
The answer will be really helpfull.
regards-
Lemon leave

採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 8 月 2 日
[Num,Txt,Raw]=xlsread('MyData.xls');
x=Num(:,1);
y=Num(:,2);
z=Num(:,3);
contour(x,y,z);
  1 件のコメント
Chaklader Asfak
Chaklader Asfak 2011 年 8 月 5 日
Hello Fangjun Jiang,
Thanks for your answer. I tried to do the same with the data but it is showing some errors: Error using ==> contour at 73
Z must be size 2x2 or greater
Other time : Error - 65
Could you please write to me what is wrong here ?
Your answer will be really helpful.

サインインしてコメントする。

その他の回答 (1 件)

Friedrich
Friedrich 2011 年 8 月 5 日
Hi,
since contour expects a matrix I would do:
[Num,Txt,Raw]=xlsread('MyData.xls');
x=Num(:,1);
y=Num(:,2);
z=Num(:,3);
F = TriScatteredInterp(x,y,z)
[qx qy] = meshgrid(min(x):0.01:max(x),min(y):0.01:max(y))
qz = F(qx,qy);
contour(qx,qy,qz)
Maybe you have to make the steps bigger for the meshgrid command. This depends on the range of your x and y values.

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by