How to write a function that performs the same as the build-in function isequal?
Afficher commentaires plus anciens
How to write a function that performs the same as the build-in function isequal?
1 commentaire
Steven Lord
le 20 Fév 2022
Why not just use the built-in function?
Réponses (1)
Image Analyst
le 20 Fév 2022
function theSame = myEqual(ver1, var2)
theSame = isequal(var1, var2);
If that's not acceptable then you'd have to write cases for all kinds of variables. You'd have to check the variable type of each, and if they're not the same, immediately return false. If they are the same, like they're both matrices you'd have to check things like the number of elements or number of rows and columns.
1 commentaire
Stephen23
le 21 Fév 2022
Also it will likely require some recursive local function to handle container types.
Catégories
En savoir plus sur Spline Postprocessing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!