How to write the MATLAB code for AFM data?

9 visualizaciones (últimos 30 días)
Abhijeet Das
Abhijeet Das el 20 de Jul. de 2019
Editada: Star Strider el 24 de En. de 2024
I am a research scholar and have a paper that analyse the AFM data. I have the AFM data in ASCII xyz format. I have to calculate the parameters given in the journal paper. I have attached herewith the paper and the data file.
Please help.
I shall be grateful to you.

Respuestas (1)

Star Strider
Star Strider el 22 de Jul. de 2019
Editada: Star Strider el 24 de En. de 2024
I will defer to you to do the analysis, however getting the data as matrices is not obvious. I can help with that.
Your data are gridded so use reshape to create matrices from them:
A = dlmread('Figure 3(a).txt', '\t', 4, 0);
rs = mean(diff(find(A(:,1) == 0)));
X = reshape(A, rs, rs, []);
figure
meshc(X(:,:,1), X(:,:,2), X(:,:,3))
xlabel('X (Å)')
ylabel('Y (Å)')
zlabel('Z (nm)')
I leave the rest to you.
EDIT — (24 Jan 2024 at 14:21)
Using the ability to run this here that was not available when this originally posted (and adding a few tweaks) —
T1 = readtable('Figure 3(a).txt', 'VariableNamingRule','preserve', 'Delimiter',{' ','\t'}, 'MultipleDelimsAsOne',true, 'HeaderLines',2, 'EmptyLineRule','skip')
T1 = 65536×3 table
X[Å] Y[Å] Z[nm] ______ ____ ______ 0 0 65.582 413.38 0 73.069 826.76 0 85.213 1240.1 0 94.007 1653.5 0 100.76 2066.9 0 97.298 2480.3 0 76.108 2893.7 0 83.187 3307 0 84.546 3720.4 0 66.053 4133.8 0 63.409 4547.2 0 58.314 4960.6 0 52.484 5373.9 0 45.347 5787.3 0 31.428 6200.7 0 55.909
VN = T1.Properties.VariableNames;
A = table2array(T1);
rs = mean(diff(find(A(:,1) == 0)));
X = reshape(A, rs, rs, []);
SizeX = size(X)
SizeX = 1×3
256 256 3
figure(3)
hmc = meshc(X(:,:,1), X(:,:,2), X(:,:,3));
hmc(1).EdgeColor = 'interp';
hmc(1).FaceColor = 'interp';
colormap(turbo)
xlabel(VN{1})
ylabel(VN{2})
zlabel(VN{3})
title('Figure 3(a)')
The code uses reshape to transform ‘A’ (65536 x 3) to ‘X’ (256 x 256 x 3) and then plots it as a surf plot.
.
  2 comentarios
Somsubhra Saha
Somsubhra Saha el 12 de Abr. de 2020
sorry, I cant understand. Can you please tell me in detail as I am new in this field.
Somsubhra Saha
Somsubhra Saha el 12 de Abr. de 2020
How to write a matlab code for MFDFA for a set of XYZ data of AFM iamge??

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by