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 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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."
1 Kommentar
Antworten (0)
Siehe auch
Kategorien
Mehr zu Communications Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!