Interpolate data to present with limited size of data

1 回表示 (過去 30 日間)
Miraboreasu
Miraboreasu 2022 年 11 月 2 日
編集済み: William Rose 2022 年 11 月 2 日
Suppose I only have 35 data points, it is very expensive to run.
x=rand(5,7)
figure
imagesc(x)
axisx=[11 12 13 14 15 16 17]
axisy=[10 20 30 40 50]
Is there any way to present them smoother, using imagesc gives too pixel. Is there any interpolation?
and display the axis with my axisx and axisy

採用された回答

Davide Masiello
Davide Masiello 2022 年 11 月 2 日
x=rand(5,7)
x = 5×7
0.2207 0.4751 0.9818 0.6898 0.8489 0.7640 0.3894 0.1370 0.3264 0.7110 0.4195 0.6313 0.4999 0.0168 0.9267 0.9988 0.6922 0.3023 0.1398 0.5576 0.8856 0.2924 0.5511 0.0081 0.9578 0.6766 0.4339 0.1714 0.5717 0.5432 0.3209 0.2490 0.3414 0.1640 0.6649
figure
contourf(x,'LineColor','none')
shading interp
axis equal off
  4 件のコメント
Miraboreasu
Miraboreasu 2022 年 11 月 2 日
編集済み: Miraboreasu 2022 年 11 月 2 日
Thank you, I think I need to rephase my quesiton, but I don't if I need to post a new thread, I will ask here first.
So for this matrix,
x=rand(5,7)
each row is one variable changing
axisx=[11 12 13 14 15 16 17]
each column is another variable changing
axisy=[10 20 30 40 50]
the value of the matrix like x(1,2) is what I want to show in colorbar
What is the best way to present them? with axis
Davide Masiello
Davide Masiello 2022 年 11 月 2 日
編集済み: Davide Masiello 2022 年 11 月 2 日
axisx = [11 12 13 14 15 16 17];
axisy = [10 20 30 40 50];
[x,y] = meshgrid(axisx,axisy);
z = rand(5,7);
[x_new,y_new] = meshgrid(linspace(axisx(1),axisx(end),100),linspace(axisy(1),axisy(end),100));
z_new = interp2(x,y,z,x_new,y_new);
contourf(x_new,y_new,z_new,linspace(min(z(:)),max(z(:)),100),'LineColor','none')
shading interp
colorbar
xlabel('x axis')
ylabel('y axis')

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by