06 December 2019 2 8K Report

Hello.

the below code calculates the eta2. The aim of this code is showing the micro structure by imagesc in Matlab. I attached the m.file and it contains the values of etas. I'd like to set custom color for each of grains and display colorful grains. I tried colormap, but it just changes the color of all grains. they have same colors by using colormap option. Also, i attached the related code. I'd be appreciated to develop this.

%%%%code

Nx=64;

Ny=Nx;

eta2 = zeros(64,64);

% original code

load storeEtas

for igrain=1:25

ncount=0;

for i=1:64

for j=1:64

ii =(i-1)*Nx+j;

eta2(i,j) =eta2(i,j)+etas(ii,igrain)^2;

if(etas(ii,igrain) >= 0.5)

ncount=ncount+1;

end

%

ncount=ncount/(Nx*Ny);

end

end

end

figure

imagesc(eta2);

More Amir Torabi's questions See All
Similar questions and discussions