Converting FEA data as table into n-D gridded-data Array for Use with 'griddedInterpolant'

조회 수: 5 (최근 30일)
I have a dataset represented by table obtained from FE Analyses for flux linkage and i want to process this raw data into proper format through MATLAB scripting (as Look up table), where this raw data conaines parametric sweep
I would like to convert this 4-Colomn table into gridded data set in form of 3D Aarry v=(x,y,z), where x,y,z are the first three colomns and the last colomn is v. then i want to process the data with 'griddedInterpolant' to get finer gidded data. The complete dataset provides all of the information needed to create a gridded data set.

채택된 답변

Matt J
Matt J 2024년 3월 22일
x=unique(t{:,1}); nx=numel(x);
y=unique(t{:,2}); ny=numel(y);
z=unique(t{:,3}); nz=numel(z);
v=permute( reshape(t{:,4},[ny,nx,nz]) ,[2,1,3]);
F=griddedInterpolant({x,y,z}, v)
  댓글 수: 8
Matt J
Matt J 2024년 4월 1일
편집: Matt J 2024년 4월 1일
It will work, but you will need,
v=permute( reshape(t{:,4},[nx,nz,ny]) ,[1,3,2]);
since now the y-coordinate varies the slowest.
Matt J
Matt J 2024년 4월 1일
You could also just presort with,
t=sortrows(t,[3,2,1]);
v=reshape(t{:,4},[nx,ny,nz]);

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by