Is the anyone can explain this scaling function?

I try to understand this scaling code. Maybe it is simple for you all, but seriously, I did not understand it. Here are the codes.
handles.data.Scale = floor(100/ ...
max(size(handles.data.J,1)/Position(4), ...
size(handles.data.J,2)/Position(3)))/100;
I do not know what is the function of each number.

2 comentarios

Stephen23
Stephen23 el 20 de Mayo de 2018
Azimah Awang's "Answer" moved here:
Thanks to enlighten and give me the idea to find out the solution. can you explain what it should be for no.1 and 2 in the codes?
dpb
dpb el 20 de Mayo de 2018
Editada: dpb el 20 de Mayo de 2018
What is "it" and to what does "no.1 and 2 in the codes" refer to?
If by the latter you mean the arguments to the size function, see
doc size % for the syntax
and if that's new ground for you, I suggest to start with the "Getting Started" section in the documentation and work through the introductory sections on basic Matlab operations and syntax.

Iniciar sesión para comentar.

Respuestas (1)

dpb
dpb el 17 de Mayo de 2018

0 votos

Well, we don't really either without what the handles.data.J are, but one can presume the Position variable is the axes 'Position' property array in which third/fourth elements are axes width and height, respectively so that the computed scale value is computing the ratio of rows to height and columns to width and picking the larger.
Use the debugger and set a breakpoint on the code and observe the calculation inputs and result and then see where/how the result is used and all will probably become clear.

Categorías

Etiquetas

Preguntada:

el 17 de Mayo de 2018

Editada:

dpb
el 20 de Mayo de 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by