MATLAB: Convert 1D to 3D 1d Please find the attached file that included "LEV(57*1), LON(100*1) and LAT(44*1)" parameters. I want to convert "LEV" to LEV(57*44*100). Thanks for your kind help. Best Answer clcclear all;close all;load('ZYX.mat')z=zeros(44,57);z(:,1)=LAT;z(1,:)=LEV;z(1,1,1:100)=LON;volshow(z) Related SolutionsMATLAB: How to write attribute in netcdf file when creating it doc ncwrite and ncwriteatthttps://in.mathworks.com/help/matlab/ref/ncwrite.html MATLAB: Preallocating matrix with a numeric trend Here is a reasonably efficient solution:U = 40:5:70; % values of Mx1V = 45:5:140; % values of Mx2M = numel(U);N = numel(V);Mx1 = repmat(U,N,1);Mx1([1==triu(ones(M),1);false(N-M,M)]) = NaN;Mx1 = Mx1(isfinite(Mx1));Mx2 = hankel(V(1:M),[V(M:end),nan(1,M-1)]).';Mx2 = Mx2(isfinite(Mx2)); Related QuestionWriting multiple Lat, lon points to KML File !Remove or combine longitude and latitude axis label for geoscatter
Best Answer