Verification of loaded and copied data

3 visualizaciones (últimos 30 días)
Jamie Williamson
Jamie Williamson el 15 de Sept. de 2021
Respondida: Image Analyst el 15 de Sept. de 2021
I have Data points, one using the load function and another just copied. How can I verify the tolerance between is within an acceptable range using an if > array comp > else loop??
DATA
The 1st,15th and last rows of the copied data are:
0.0000 -0.2086
1.7500 0.0443
5.0000 2.2534
The 1st,15th and last rows of the loaded data are:
0.0000 -0.2086
1.7500 0.0443
5.0000 2.2534

Respuesta aceptada

Image Analyst
Image Analyst el 15 de Sept. de 2021
Not sure what you want but try subtracting and looking at absolute value of the difference
diffMatrix = abs(m1 - m2); % Difference of your two matrices.
tolerance = 0.01; % Whatever.
if any(diffMatrix(:) > tolerance)
maxDiff = max(diffMatrix(:))
warningMessage = sprintf('Warning : some elements differ by more than %f (up to %f).', ...
tolerance, maxDiff);
uiwait(warndlg(warningMessage));
end
Adapt as needed.

Más respuestas (0)

Categorías

Más información sobre Oceanography and Hydrology en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by