simulink error about the model sl_ibvs in the vision-4.3 toolbox

313 views
Skip to first unread message

lixian...@gmail.com

unread,
Apr 16, 2018, 10:29:28 PM4/16/18
to Robotics & Machine Vision Toolboxes
Hi, 

      When i simulate the model sl_ibvs in the vision-4.3 toolbox, the model suggests the following error:Error in port widths or dimensions. Output port 1 of 'sl_ibvs/camera' is a [28x1] matrix. What can i do for this? Thank you for your consideration.

Peter Corke

unread,
Apr 16, 2018, 10:41:49 PM4/16/18
to Robotics & Machine Vision Toolboxes
which version of Simulink and MATLAB?

Matti Kaupenjohann

unread,
Apr 17, 2018, 6:08:15 AM4/17/18
to Robotics & Machine Vision Toolboxes
This is a standard matlab-error that ur simulinkmodell got a not expected signal width or Dimension.

A classical example is Matrix multiply. If u have a signal Vektor with a length of 6 and try to multiply with a 6x6 Matrix, it will not work because the multiply block expects a 6x1 Vektor.

To enable signal dimensions you have to check Display -->signal & ports -->signal dimensions

Jin

unread,
Apr 18, 2018, 6:01:13 AM4/18/18
to Robotics & Machine Vision Toolboxes

I meet the same problem, and my MATLAB version is 2017b.

Peter Corke

unread,
Apr 21, 2018, 6:49:40 PM4/21/18
to Robotics & Machine Vision Toolboxes
Thanks both for pointing this out.  It seems there's a missing function which is attached.  Drop it into a folder somewhere on your path.  It's called by the "MATLAB Fcn block", but it's odd that Simulink doesn't complain about the missing function, just passes the input directly to the output.

Let me know how it goes.

peter
slcamera.m

Jin

unread,
Apr 23, 2018, 8:19:56 AM4/23/18
to Robotics & Machine Vision Toolboxes

Thank you ! The problem is solved and the simulink model runs well now !  But I find there is a new error. When I plot the image-plane coordinates on output port 1, the function plot2() get an error. What can I do for this?

Peter Corke

unread,
Apr 28, 2018, 8:58:27 PM4/28/18
to Robotics & Machine Vision Toolboxes
This is an error in the book, sorry.

p is 2x4x501, the first index is u or v, the second index is the corner, and the third index is the time index.  plot2 cannot handle a matrix with 3 dimensions so we need to choose a particular corner to plot

>> plot2(squeeze(p(:,1,:))')

will plot the path of corner 1.

To plot the paths of all corners you need to use a loop like
>> for i=1:4
hold on
plot2(squeeze(p(:,i,:))')
end

Jin

unread,
May 21, 2018, 7:52:36 AM5/21/18
to Robotics & Machine Vision Toolboxes
Thank you so much, it works now!

lq jiang

unread,
Oct 27, 2018, 8:11:06 PM10/27/18
to Robotics & Machine Vision Toolboxes
你好,我也遇到了同样的问题,请问一下你是怎么解决的,下载做了作者的m文件也无法连接上

在 2018年5月21日星期一 UTC+8下午7:52:36,Jin写道:
Reply all
Reply to author
Forward
0 new messages