Is the anyone can explain this scaling function?
Show older comments
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 Comments
Stephen23
on 20 May 2018
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?
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.
Answers (1)
dpb
on 17 May 2018
0 votes
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.
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!