How about matlab size function ?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Why is the size of matrix b different from the size of matrix a?
Please, any suggestions? How to fix it
________________________
a = testSizeFunction
[M,N] = size(a)
b = rand(size(a))
0 Commenti
Risposta accettata
Matt J
il 4 Mar 2023
Modificato: Matt J
il 4 Mar 2023
You have not overloaded the size method appropriately for the case where nargout=1:
a = testSizeFunction;
siz=size(a)
Try this instead:
function varargout = size(obj,varargin)
[varargout{1:nargout}] = builtin('size', obj.s, varargin{:}); % call builtin size function
end
6 Commenti
Voss
il 5 Mar 2023
@Mohamed Gharbi: Please click the "Accept This Answer" button on Matt J's answer.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Operating on Diagonal Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!