I understand that you are experiencing difficulties when attempting to connect an external camera using the CSI port.
To help you resolve this issue, I suggest following the steps provided below:
- Ensure that you have enabled the legacy camera. Please note that non-legacy cameras are currently not supported.
To enable the legacy mode open Raspberry Pi terminal,
- execute the following command:
$ sudo raspi-config
- Go to interface options and enable Legacy camera
Refer the following MathWorks Documentation for detail
- https://www.mathworks.com/hardware-support/system-requirements.html
- https://www.mathworks.com/hardware-support/matlab-webcam.html
2. In addition to the webcam workflow, you can utilize Raspberry Pi system commands to capture images in MATLAB. Here are a few commands you can try:
r = raspi;% Use system commands to capture images
r.system('raspistill -o new.jpg');
% Get the captured image in MATLAB's current working directory
r.getFile('/home/pi/new.jpg');
% Read the image in MATLAB
img = imread('new.jpg');
imshow(img);
You can also refer to the following link for information on using webcams in Raspberry Pi SPKG:
I hope this helps.