How create a image from a csv file

7 ビュー (過去 30 日間)
Héctor Rubén Díaz
Héctor Rubén Díaz 2018 年 3 月 15 日
編集済み: Pawel Jastrzebski 2018 年 3 月 16 日
I have a csv file with 3 columns. X Y and a field, for instance pressure, p.
How can I create a image from those columns?

回答 (1 件)

Pawel Jastrzebski
Pawel Jastrzebski 2018 年 3 月 16 日
編集済み: Pawel Jastrzebski 2018 年 3 月 16 日
If by image you meant i.e.
  • Contour plot - you can't really do it as your Z data (3rd column) would have to be a matrix of a X*Y size (or 1st column * 2nd column)
But you can still show a 3-dimensional data in 2D by using i.e.:
See the following example:
x = 1:100;
y = 1:10:1000;
z = cos(linspace(0,4*pi,100)).*rand(1,100);
%2D scatter with colorbar
figure
scatter(x,y,[],z)
colorbar
%3D scatter with colorbar
figure
scatter3(x,y,z,[],z)
colorbar
view(45,45)
There's also possibility of creating an image from the an array, but you would have to see if it works for your data:

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by