필터 지우기
필터 지우기

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 CenterFile Exchange에서 2-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