Discussion:
Getting Position of Simulink Blocks
(too old to reply)
Smitan Brahmbhatt
2010-10-22 05:47:05 UTC
Permalink
How do we know Position of simulink block via .m script?

for the program below:

a=find_system(gcs,'LoadFullyIfNeeded','off','BlockType','Logic')
b=length(a)

for i=1:b
c=get_param(a(i),'Operator')
p=get_param(a(i),'Position')
end

P is returning answer as [1x4 double]. But how do can we find exact digits in this array?

and what exactly those digit indicates? Are they indicates co-ordinates of diagonal points?
Navan Ruthramoorthy
2010-10-22 13:57:04 UTC
Permalink
Post by Smitan Brahmbhatt
How do we know Position of simulink block via .m script?
a=find_system(gcs,'LoadFullyIfNeeded','off','BlockType','Logic')
b=length(a)
for i=1:b
c=get_param(a(i),'Operator')
p=get_param(a(i),'Position')
end
P is returning answer as [1x4 double]. But how do can we find exact digits in this array?
and what exactly those digit indicates? Are they indicates co-ordinates of diagonal points?
Hi,

Yes. They are co-ordinates of diagonal points.

From the doc at

http://www.mathworks.com/help/toolbox/simulink/slref/f23-7517.html

Position returns a "vector of coordinates (in pixels) not enclosed in quotation marks: [left top right bottom]". Note: The origin is located in the upper left corner of the model window. The maximum value for a coordinate is 32767.

Navan
Steven_Lord
2010-10-22 14:21:48 UTC
Permalink
Post by Smitan Brahmbhatt
How do we know Position of simulink block via .m script?
a=find_system(gcs,'LoadFullyIfNeeded','off','BlockType','Logic')
b=length(a)
for i=1:b
c=get_param(a(i),'Operator')
p=get_param(a(i),'Position')
end
P is returning answer as [1x4 double]. But how do can we find exact digits in this array?
Read the entry for Position in the table on this page. It describes what
each of the elements in that vector represents.

http://www.mathworks.com/help/toolbox/simulink/slref/f23-7517.html
--
Steve Lord
***@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
Loading...