MATLAB Answers

Translated by

이 페이지의 내용은 영어에서 자동 번역되었습니다. 자동 번역 기능을 해제하려면 "<a class="turn_off_mt" href="#" onclick="window._kiq.push(['set', { 'event': 'Turn off MT' }]);">여기</a>"를 클릭하십시오.

0

"index exceeds matrix dimensions" when I connect my Raspberry Pi model B to Matlab2013b.

Asked by Aditya G Manjunath on 24 Aug 2014
Latest activity Commented on by Ahmed Abdelmohssen on 22 Feb 2016
Could please someone help me with this error?

  3 Comments

Please provide some additional details. 'Index exceeds matrix dimensions' is an error that occurs when the indices of a matrix reference a value that is more than the actual number of elements in the row or column of a matrix. e.g. a=[1 1]; a(3)=0;
I get a similar issue trying to install the Simulink-to-RaspPi (a prerequisite it seems for the Matlab-to-RaspPi package). I'm at the 'Connect the Raspberry Pi hardware' step, everything's plugged in and my RaspPi B is up, and rebooted to the desired host name. I hit 'next' and I get 'Error: Connect the Raspberry pi hardware' window that just says 'In an assignment A(:) = B, the number of elements in A and B must be the same.' Normally it gives a code line reference, but this one doesn't, as if its running a compiled mex function.
I'm running in Matlab 2014a.
Anybody seen that before? I've tried running through all the steps repeatedly. Would it have to do with having 2 Raspberry Pi's on the network at once? I unplugged the other one, repeated all the steps, and I still get the same 'helpful' error message. What am I missing?
Could it have to do with my Apple Time Machine routers? RaspPi wakes up with a weird IP address, like 10.0.0.7. Should I manually force it to something similar to my PC to get it on the same subnet?
Are there things I can be doing on the RaspPi terminal that would help? The Matlab command window just sits idle, no debug info there either.
I'm stumped. Anybody?

Sign in to comment.

1 Answers

Answer by Murat Belge on 10 Dec 2014

Robert:
You can install MATLAB Support Package for Raspberry Pi without the Simulink Support package. Just uncheck Simulink support package in the installer GUI.
What network configuration did you choose when connecting your Raspberry Pi to the network (in the "Configure network" window)?
Work-around: If you created the SD card for the Raspberry Pi, just skip the "Connect the Raspberry Pi Hardware" GUI by clicking "Cancel" button. Then on the MATLAB command line execute:
>> raspi.internal.discoverIpAddress
ans =
Hostname: 'raspberrypi-RqgddnxxMD'
IpAddress: 'xxx.xxx.xx.xx'
The command above should display the IP address of your Raspberry Pi. Using this IP address, execute the following:
>> rpi = raspi('<IP address of your Raspberry Pi>')
Once you can establish the connection, you should be able to run Simulink or MATLAB examples for Raspberry Pi.

  2 Comments

I have the same problem. I have tried both 2014a and 2015a. I am trying to install on a machine on a company network so as to enable Simulink code generation to the pi target via company network. The workaround above did not work for me. I need it to run in Simulink. If cancel is selected then the Simulink raspberry pi support package appears not installed, and none of the options for running the raspberry pi target become visible. At his point, no capability for interacting with the connected pi appears to be possible. I have installed successfully many times on other machines not connected to company network without issues.
Further experimentation reveals that it is only when the pi is found on the network that this error appears. If the pi is disconnected from the network, then the Raspberry Pi detection process times out without event.

Sign in to comment.



Translated by