Borrar filtros
Borrar filtros

Hi, I want to transmit an image using Simulink and USRP. I have the following code. But when I run this code, MATLAB produces following error. How can ı fix this problem?

1 visualización (últimos 30 días)
function msg = genMsg %#codegen persistent imgmatRows imgmatCols imgvec msgBin msgBinRows msgBinCols msgTmp;
coder.extrinsic('imread'); % count; if isempty(imgvec) %count = 0; imgmat = imread('cameraman.tif'); [imgmatRows, imgmatCols] = size(imgmat); imgvec = reshape(imgmat, 1, imgmatRows * imgmatCols); msgBin = de2bi(int8(imgvec), 7, 'left-msb'); [msgBinRows, msgBinCols] = size(msgBin); msgTmp = reshape(double(msgBin).', msgBinRows*msgBinCols, 1); end
msg = msgTmp; Error message: "Function output 'y' cannot be an mxArray in this context. Consider preinitializing the output variable with a known type."

Respuestas (0)

Categorías

Más información sobre Communications Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by