range isn't working
Mostrar comentarios más antiguos
Just got the R2021b version and some of my code isn't working :(
The basic function "range" initialy offered me to calculate some wave propogation parameters, I solved this by removing the Communications Toolbox, but now it's not working at all!
Here is an example of the error:
a=[1 2 3]
>> range(a)
'range' requires one of the following:
Antenna Toolbox
Communications Toolbox
Fixed-Point Designer
Statistics and Machine Learning Toolbox
>> range(a,'all')
'range' requires one of the following:
Antenna Toolbox
Communications Toolbox
Fixed-Point Designer
Statistics and Machine Learning Toolbox
Very frustrating
Respuesta aceptada
Más respuestas (3)
If you don't need to use a dimension input:
A = [1 2 3; 4 5 6; 7 8 9];
range = @(x) max(x) - min(x);
range(A)
range(A(:))
If you want to use dimension input
range = @(x,dim) max(x,[],dim) - min(x,[],dim);
range(A,2)
Image Analyst
el 30 de Oct. de 2021
What about the built-in bounds() function:
v = 4:99;
[minv, maxv] = bounds(v)
minv =
4
maxv =
99
Evgeny Hahamovich
el 30 de Oct. de 2021
0 votos
Categorías
Más información sobre Cloud Integrations 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!