Matlab class property specification
Mostrar comentarios más antiguos
classdef MAtWarning
properties
P@uint8=uint8(1); % undocumented way
% P(1,1)uint8=uint8(1); % R2021b style
end
methods(Static=true)
function Test
clear;clc;
Instance=MAtWarning;
aa=Instance.P;
fprintf(2,'%u...\n',aa(1));
end
end
end
I'm migrating a project from R2016a to R2021b. Many classes use the undocumented way to specify properties.
The undocumented way gets warning in R2021b, and the R2021b style is obviously better, but I need time to see if all the code works fine at R2021b, so I hope there is a way for the code to work fine both in R2016a & R2021b, so that I could switch the MCR whenever I want.
Suppress the warning does not seems like a perfect solution to me.
warning('off','MATLAB:class:PropUsingAtSyntax');
Hope someone can help me.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Function Creation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!