필터 지우기
필터 지우기

Problem using imagesc plot for non uniform values

조회 수: 28 (최근 30일)
Abhik Saha
Abhik Saha 2020년 10월 5일
답변: Maju Kuriakose 2023년 5월 30일
I have to plot the imagesc using matlab. Where in the y array I have 16 different points for which x values are same, and the z values are different in each points and then for the next 16 different points for y array is same as the above y array but now x values are change compare to the previous x array and it is constant upto next 16 data points. The process continues for 320 data sets. How do I plot this using imagesc?
  댓글 수: 2
KSSV
KSSV 2020년 10월 5일
What problem you have to plot? Show us the data. You can use pcolor also.
Abhik Saha
Abhik Saha 2020년 10월 5일
Please see the data file where I need to plot (1,2,3) and plot (1,2,4) lines
where 1,2,3,4 are the columns in the data file

댓글을 달려면 로그인하십시오.

채택된 답변

KSSV
KSSV 2020년 10월 5일
data = importdata("data_analysis.txt") ;
x = data(:,1) ; y = data(:,2) ;
z1 = data(:,3) ; z2 = data(:,4) ;
% Use interpolation
xi = linspace(min(x),max(x),300) ;
yi = linspace(min(y),max(y),300) ;
[X,Y] = meshgrid(xi,yi) ;
Z1 = griddata(x,y,z1,X,Y) ;
pcolor(X,Y,Z1)
shading interp
  댓글 수: 1
Abhik Saha
Abhik Saha 2020년 10월 5일
Thank you very much for the code. Yes it works well.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Maju Kuriakose
Maju Kuriakose 2023년 5월 30일
Use 'mesh' instead of imagesc. Then select appropriate 2D plane

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by