Tag Archives: matlab error

[Solved] matlab Error: CUDA_ERROR_SYSTEM_NOT_READY

Error when using matlab:

>> gpuDevice
Error using gpuDevice
Failed to initialize graphics driver for computation. The CUDA error was: CUDA_ERROR_SYSTEM_NOT_READY

Check out the official NVIDIA documentation: https://docs.nvidia.com/gpudirect-storage/troubleshooting-guide/index.html

Install nvidia-fabricmanager:

# yum-config-manager --add-repo https: // developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo 
# yum install -y nvidia-fabric-manager- 515.65 . 01 - 1 
Note: 515. 65 .01 here is the version number of your graphics card driver, which can be viewed through nvidia-smi

Start the service:

# /usr/bin/nv-fabricmanager -c /usr/share/nvidia/nvswitch/fabricmanager.cfg

[Solved] matlab Error: `Using exist to check

matlab Error: `Using exist to check

matlab Error: Using exist to check for a variable in the transparent workspace is not supported. To check for a function, folder, file, or class, specify the appropriate second input argument to exist: 'builtin', 'class', 'dir' or 'file'.

 

Solution:
Modify exist(savepath) to exist(savepath, ‘file’) (if it is to detect the existence of a file fill in file, otherwise replace file with one of ‘builtin’, ‘class’, ‘dir’ or ‘file’)

[Solved] matlab Error: Error in port widths or dimensions. ‘Output Port 1‘ of ‘sl_arm_ibvs/camera‘

When running the Manipulator Simulation in MATLAB visual servo toolbox, the following problems are encountered: error in port widths or dimensions. ‘ Output Port 1’ of ‘sl_ arm_ ibvs/camera’ is a [28×1] matrix.

The problem is caused by the wrong input vector dimension at the red circle dimension in the figure below.

Here the p for the camera pixel coordinate system under the coordinate value, should be 2 * 4 vectors.

Solution: The new version of Machine Vision Toolbox for MATLAB toolbox lacks the module “slcamera.m”, open the camera module in simulate.

Double click the MATLAB FCN module, and you will be prompted that “slcamera” cannot be found. Select new:

Type the following code:

function p = slcamera(cam, u)
    %if all(u == 0)
     if (u(1:16,:)==0)
        % Simulink is probing for the dimensions
        np = (length(u)-16)/3;
        p = zeros(2, np);
    else
        p = zeros(2, 4);
        P = reshape(u(17:end), 3, []);
        Tcam = reshape(u(1:16), 4, 4);
        p = cam.plot(P, 'pose', Tcam, 'drawnow');
        
    end

Run simulate again, you can see the error report and disappear, then you should encounter the following error.

Error in ‘sl_arm_ibvs/camera/MATLAB Fcn’. Evaluation of expression resulted in an invalid output.
Only finite double vector or matrix outputs are supported

I am also working on a solution for this error, so please stay tuned.

[Solved] MATLAB Error: Wrong use of commLTETurboDecoder/step

Incorrect use of commlteturbodecoder/step solution

When learning Chapter 4 of “comprehensive and detailed explanation of LTE: MATLAB modeling, simulation and implementation”, run chap4_ex04_performanceBER.m. Matlab reports the following errors:

Wrong use of commLTETurboDecoder/step
Method 'stepImpl' is not defined for class 'commLTETurboDecoder', or the method has been removed from MATLAB's search path.

Error TurboDecoder_crc (line 10)
[y, flag, iters] = step(TurboCrc, u, intrlvrIndices);

Error chap4_ex05_rate (line 28)
    [y, ~, iters] = TurboDecoder_crc(-r2, Indices); % Turbo Deocder

Error chap4_ex05_performanceBER (line 13)
    ber_third(n)=chap4_ex05_rate(EbNo, maxNumErrs, maxNumBits, CodingRate);

unction commLTETurboDecoder used in “Understanding LTE with Matlab” is missing

Reason: Because the version of matlab is too high, the official matlab has abandoned the commLTETurboDecoder function after the 2016 version, so it will report an error when running this program.

Solution: Install communications system toolbox 6.1 in matlab2015b, and find the function under this path

/Applications/MATLAB_R2015b.app/toolbox/comm/commdemos/commLTETurboDecoder.m

After downloading and installing MATLAB_R2015b software, find the commLTETurboDecoder.m file under the corresponding path, place it under the current folder, and it will run normally.

In addition, this function also has a defect, the following error will be reported in the run: change snr to snr6 in the zVisualize_ex05.m file, as shown in the figure.

Wrong use of snr (line 87)
Insufficient number of input parameters.

Error zVisualize_ex05 (line 3)
semilogy(snr,ber6,'ob')

Error chap4_ex05_performanceBER (line 28)
zVisualize_ex05(snr, ber_third,  ber_half);

Solution: Change the snr in the zVisualize_ex05.m file to snr6, as shown in the figure.

Modify the above two places to operate normally and draw the image, as shown in the figure:

[Solved] matlab error: try to write SCRIPT vl_sift is executed as a function

Cause of problem:

1. The function name is the same as the file name

2. Missing \vlfeat-0.9.21\toolbox\mex\mexw64.

File directory:

\vlfeat-0.9.21\toolbox\sift\vl_sift.m

Error: function Directory:

[ kp1,ds1 ] = vl_sift(single(rgb2gray(img1)),'PeakThresh', 0,'edgethresh',3);

Solution:

1. Rename vl_sift.m to vl_sift1.m to solve it perfectly.

2. Copy the mex folder from other projects to \vlfeat-0.9.21\toolbox directory

vlfeat-0.9.21 version may have this problem. vlfeat-0.9.14 version mex is basically compiled. So there is no such problem.