Alternate code for dragging a rectangle in R2010a Matlab

I plot a rectangle in matlab and now i need to drag the rectangle. I plotted rectangle by using the command
a1=rectangle('Position',[25 1 (20*25.6) 25.6]);
and for dragging the command is
draggable(a1,'CONSTRAINTS','h',[-1000 1000])
I cant drag it. I am using Matlab R2010 a. Any alternate code is there for dragging rectangle. Thank you

4 Comments

If you use an external function, please post a link to it. I guess you mean FEX: draggable. Do you get an error message or can you explain the problem with any details?
a1=rectangle('Position',[25 1 (20*25.6) 25.6]);
draggable(a1,'CONSTRAINTS','h',[-1000 1000]) %I want to drag a1 %rectangle horizontally
The error message I got is
Undefined function 'draggable' for input arguments of type 'double'.
Judging by this and your comment to the answer below you simply need to understand the concept of using the path in Matlab. Any function that you call must be on your path so you should quickly start to recognise that an error of the type:
Undefined function...
simply means you need to add that function to your path.

Sign in to comment.

 Accepted Answer

7 Comments

Undefined function 'moveit2' for input arguments of type 'double'.
moveit2() is also not working. It shows an error message like Undefined function 'moveit2' for input arguments of type 'double'. Same kind of error message came when i used 'draggable' command. Thanking You
@Amal Jose: Matlab can find only functions, which are stored in a folder contained in the path. See:
doc addpath
doc savepath
doc pathtool
So download draggable, unzip it and move the files to a folder in your path, or add the folder to the path.
1. Error using database.odbc.connection/insert (line 268) Out of memory. Type HELP MEMORY for your options. 2. Error in dae (line 25) insert(conn,'Databas',coln,exdata)
2 Errors are coming while connecting to database microsoft access 2013 with matlab 2017a. The same code when connected with matlab 2010a there is no error at all.
conn=database('databas','','');
conn.Message
datea=datestr(clock,0);
Sex='M';
Site='PELVIS';
Name='RAMU';
doc='AA';
phy='phy';
RTNo='16RT1288A';
exdata(1,2) = {Site};
exdata(1,1) = {Name};
exdata(1,6) = {RTNo};
exdata(1,4) = {doc};
exdata(1,3) = {phy};
exdata(1,5) = {datea};
exdata(1,7) = {Sex};
coln={' "Name" ',' "Site" ',' "Physisct" ',' "Doctor" ',' "PlannedTime" ',' "RTNo" ',' "Sex" '};
insert(conn,'Databas',coln,exdata)
CAn u help me to recover from this error

Sign in to comment.

More Answers (1)

Why not imrect() ?

2 Comments

I plot the rectangle by using the command a1=rectangle('Position',[25 1 (20*25.6) 25.6]);. This rectangle i need to drag or move
I would be more enthusiastic about being of assistance if you could explain why it is necessary for you to use rectangle() when there are alternatives such as imrect().

Sign in to comment.

Categories

Tags

Asked:

on 8 May 2017

Commented:

on 3 Jun 2017

Community Treasure Hunt

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

Start Hunting!