Range of a matrix

69 visualizaciones (últimos 30 días)
AUWAL ABUBAKAR
AUWAL ABUBAKAR el 25 de Mzo. de 2019
Comentada: Stephan el 25 de Mzo. de 2019
Hi all,
I tried to find 'range' of a matrix but always return error. For example;
Data=rand(10,10)
range(Data,'all') always return the follwing error;
''Error using max
Invalid option. Option must be 'omitnan' or 'includenan'.
Error in range (line 20)
y = max(x,[],dim) - min(x,[],dim);''
Does anyone knows whats the problem please?
thanks

Respuesta aceptada

Stephan
Stephan el 25 de Mzo. de 2019
Editada: Stephan el 25 de Mzo. de 2019
Hi,
the option
'all'
was introduced in R2018b - in earlier releases you can not use this feature. Make sure to look in the documentaion that corresponds to the release you use to avoid this issues.
Best regards
Stephan
  5 comentarios
madhan ravi
madhan ravi el 25 de Mzo. de 2019
So use:
range(Data(:))
AUWAL ABUBAKAR
AUWAL ABUBAKAR el 25 de Mzo. de 2019
Thanks Ravi. That solves my problem.
@ Stephan, that really helps. is not available on 2017b
Thank you all.

Iniciar sesión para comentar.

Más respuestas (1)

AUWAL ABUBAKAR
AUWAL ABUBAKAR el 25 de Mzo. de 2019
Opppsss! my variables is an output coming from a loop.
example; ROI(:,:,1)=rand(10,10)
i tried using
range(ROI(:,:,2)(:)) but it failed.
Any i dea please? THANKS
  1 comentario
Stephan
Stephan el 25 de Mzo. de 2019
% 2D Array
ROI=rand(10,10)
Range1 = range(ROI(:))
% 3D Array
ROI=rand(10,10,3)
Range2 = range(ROI(:))

Iniciar sesión para comentar.

Categorías

Más información sobre Matrix Indexing 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