Category: Matlab
Category Archives: Matlab
802.11 Beacon Packet recovery failing
Hello Y’all,
I have a NI USRP coupled with a router’s antenna, and I receive 802.11 wifi signals in the 2.4G band. Then I convert that signal to .mat format and filter channel by channel to extract beacon frames and print their info such as ssid, bssid etc. I use Maltab’s WLAN Beacon Receiver Using Software-Defined Radio tutorial to do the beacon extraction, with config=’OFDM, band 2.4′ . I was able to see the router’s ssid from my phone and laptop, like how it is broadcasting in channel 1, 2.4 band (non-HT data) and its mode is 802.11n. I was also able to see regular spikes of energy every 100 ms when i plotted the spectrogram of channel_1 from the .mat file, indicating there is beacon transmission clearly. I am not able to figure out why the matlab code is not able to extract the beacon frames, i just used the standard matlab tutorial attached above, any help in figuring out the bottleneck in my approach would be really appreciated. Let me also attach the actual code in case if it helps (also my matlab version is R2022b)
fileName="C:WiFi_ProjectWiFi Dataextracted data20240626b_0.5seachData_0channel_1.mat";
rxsim.ReceiveOnSDR = false;
config=’OFDM, band 2.4′;
cbw="CBW20";
cfg = wlanNonHTConfig(ChannelBandwidth=cbw);
displayScope = true;
displayAdditionalInfo=false;
retrieveVendorInfo=true;
if rxsim.ReceiveOnSDR
[frequencyBand,bbSampleRate,chanNumber] = getSimParams(config);
rxsim.FrequencyBand = frequencyBand;
rxsim.RadioSampleRate = bbSampleRate;
rxsim.ChannelNumbers = chanNumber;
rxsim.SDRDeviceName = "Pluto"; % SDR for waveform reception
rxsim.RadioGain = 50;
rxsim.ReceiveAntenna = 1; % Configure to work with only a single antenna
rxsim.CaptureTime = milliseconds(102.4); % Value expected to be of type duration
% Derived Parameters
rxsim.CenterFrequencies = wlanChannelFrequency(rxsim.ChannelNumbers,rxsim.FrequencyBand);
else
rx = load(fileName);
[~,bbSampleRate,~] = getSimParams(config);
rxsim.ChannelNumbers = rx.channels;
rxsim.RadioSampleRate = rx.radioSampleRate;
rxsim.FrequencyBand = rx.band;
% Derived Parameters
rxsim.CaptureTime = seconds(size(rx.capturedWaveforms,1)/rxsim.RadioSampleRate);
end
overSampFac = rxsim.RadioSampleRate/bbSampleRate;
if rxsim.ReceiveOnSDR
sdrReceiver = hSDRReceiver(rxsim.SDRDeviceName);
sdrReceiver.SampleRate = rxsim.RadioSampleRate;
sdrReceiver.Gain = rxsim.RadioGain;
sdrReceiver.ChannelMapping = rxsim.ReceiveAntenna;
sdrReceiver.OutputDataType = "single";
end
APs = struct(…
"SSID",[],"BSSID",[],"Vendor",[],"SNR_dB",[],"Beacon_Channel",[], …
"Operating_Channel",[],"Channel_Width_MHz",[],"Band",[],"Mode",[], …
"MAC_Config",wlanMACFrameConfig,"Waveform",[],"Offset",[]);
indexAP = 1;
%Scan and decode for the specified channels.
tic
for i = 1:length(rxsim.ChannelNumbers)
fprintf("<strong>Scanning channel %d on band %.1f.</strong>n",rxsim.ChannelNumbers(i),rxsim.FrequencyBand);
if rxsim.ReceiveOnSDR
sdrReceiver.CenterFrequency = rxsim.CenterFrequencies(i);
capturedData = capture(sdrReceiver,rxsim.CaptureTime);
else
capturedData = double(rx.capturedWaveforms(:,i));
end
% Display spectrum and spectrogram
if displayScope %#ok<*UNRCH>
scope = spectrumAnalyzer(ViewType="spectrum-and-spectrogram",SampleRate=rxsim.RadioSampleRate,…
TimeSpanSource="property",TimeSpan=seconds(rxsim.CaptureTime));
scope.Title = "Band: " + rxsim.FrequencyBand + " Channel: " + rxsim.ChannelNumbers(i);
scope(capturedData);
end
% Resample the captured data to basesband sample rate for beacon processing
if overSampFac ~= 1
capturedData = resample(capturedData,bbSampleRate,rxsim.RadioSampleRate);
end
searchOffset = 0;
while searchOffset<length(capturedData)
capturedData = capturedData(searchOffset+1:end);
if(strcmp(config,’DSSS, band 2.4′))
[decParams, searchOffset, res, bitsData] = recoverDSSS(capturedData);
else
[decParams, searchOffset, res, bitsData] = recoverNonHTOFDM(capturedData,rxsim);
end
if ~isempty(bitsData)
[cfgMAC, ~, decodeStatus] = wlanMPDUDecode(bitsData,cfg …
,SuppressWarnings=false);
% Print additional information on all successfully recovered packets
if ~decodeStatus && displayAdditionalInfo
payloadSize = floor(length(bitsData)/8);
if(strcmp(config,’DSSS, band 2.4′))
fprintf("Payload Size: %d | Modulation: %s | Data Rate: %s n",payloadSize,decParams.modulation,decParams.dataRate);
else
fprintf("Payload Size: %d | Modulation: %s | Code Rate: %s n",payloadSize,decParams.modulation,decParams.coderate);
end
fprintf("Type: %s | Sub-Type: %s",cfgMAC.getType,cfgMAC.getSubtype);
end
% Extract information about channel from the beacon.
if ~decodeStatus && matches(cfgMAC.FrameType,"Beacon")
% Populate the table with information about the beacon.
if isempty(cfgMAC.ManagementConfig.SSID)
APs(indexAP).SSID = "Hidden";
else
APs(indexAP).SSID = string(cfgMAC.ManagementConfig.SSID);
end
APs(indexAP).BSSID = string(cfgMAC.Address3);
if retrieveVendorInfo
APs(indexAP).Vendor = determineVendor(cfgMAC.Address3);
else
APs(indexAP).Vendor = "Skipped";
end
[APs(indexAP).Mode, APs(indexAP).Channel_Width_MHz, operatingChannel,primaryChannel] = …
determineMode(cfgMAC.ManagementConfig.InformationElements);
if isempty(operatingChannel)
% Default to scanning channel if operating channel
% cannot be determined.
operatingChannel = rxsim.ChannelNumbers(i);
end
if(rxsim.ChannelNumbers(i)~=primaryChannel)
% Skip the iteration if the current search channel is
% not the primary channel.
APs = APs(1:indexAP-1);
continue;
end
fprintf("<strong>%s beacon detected on channel %d in band %.1f.</strong>n",APs(indexAP).SSID,rxsim.ChannelNumbers(i),rxsim.FrequencyBand);
APs(indexAP).Beacon_Channel = primaryChannel;
APs(indexAP).Operating_Channel = operatingChannel;
if(~strcmp(config,’DSSS, band 2.4′))
APs(indexAP).SNR_dB = res.LLTFSNR;
end
APs(indexAP).MAC_Config = cfgMAC;
APs(indexAP).Offset = res.PacketOffset;
APs(indexAP).Waveform = capturedData;
indexAP = indexAP + 1;
end
end
end
end
tocHello Y’all,
I have a NI USRP coupled with a router’s antenna, and I receive 802.11 wifi signals in the 2.4G band. Then I convert that signal to .mat format and filter channel by channel to extract beacon frames and print their info such as ssid, bssid etc. I use Maltab’s WLAN Beacon Receiver Using Software-Defined Radio tutorial to do the beacon extraction, with config=’OFDM, band 2.4′ . I was able to see the router’s ssid from my phone and laptop, like how it is broadcasting in channel 1, 2.4 band (non-HT data) and its mode is 802.11n. I was also able to see regular spikes of energy every 100 ms when i plotted the spectrogram of channel_1 from the .mat file, indicating there is beacon transmission clearly. I am not able to figure out why the matlab code is not able to extract the beacon frames, i just used the standard matlab tutorial attached above, any help in figuring out the bottleneck in my approach would be really appreciated. Let me also attach the actual code in case if it helps (also my matlab version is R2022b)
fileName="C:WiFi_ProjectWiFi Dataextracted data20240626b_0.5seachData_0channel_1.mat";
rxsim.ReceiveOnSDR = false;
config=’OFDM, band 2.4′;
cbw="CBW20";
cfg = wlanNonHTConfig(ChannelBandwidth=cbw);
displayScope = true;
displayAdditionalInfo=false;
retrieveVendorInfo=true;
if rxsim.ReceiveOnSDR
[frequencyBand,bbSampleRate,chanNumber] = getSimParams(config);
rxsim.FrequencyBand = frequencyBand;
rxsim.RadioSampleRate = bbSampleRate;
rxsim.ChannelNumbers = chanNumber;
rxsim.SDRDeviceName = "Pluto"; % SDR for waveform reception
rxsim.RadioGain = 50;
rxsim.ReceiveAntenna = 1; % Configure to work with only a single antenna
rxsim.CaptureTime = milliseconds(102.4); % Value expected to be of type duration
% Derived Parameters
rxsim.CenterFrequencies = wlanChannelFrequency(rxsim.ChannelNumbers,rxsim.FrequencyBand);
else
rx = load(fileName);
[~,bbSampleRate,~] = getSimParams(config);
rxsim.ChannelNumbers = rx.channels;
rxsim.RadioSampleRate = rx.radioSampleRate;
rxsim.FrequencyBand = rx.band;
% Derived Parameters
rxsim.CaptureTime = seconds(size(rx.capturedWaveforms,1)/rxsim.RadioSampleRate);
end
overSampFac = rxsim.RadioSampleRate/bbSampleRate;
if rxsim.ReceiveOnSDR
sdrReceiver = hSDRReceiver(rxsim.SDRDeviceName);
sdrReceiver.SampleRate = rxsim.RadioSampleRate;
sdrReceiver.Gain = rxsim.RadioGain;
sdrReceiver.ChannelMapping = rxsim.ReceiveAntenna;
sdrReceiver.OutputDataType = "single";
end
APs = struct(…
"SSID",[],"BSSID",[],"Vendor",[],"SNR_dB",[],"Beacon_Channel",[], …
"Operating_Channel",[],"Channel_Width_MHz",[],"Band",[],"Mode",[], …
"MAC_Config",wlanMACFrameConfig,"Waveform",[],"Offset",[]);
indexAP = 1;
%Scan and decode for the specified channels.
tic
for i = 1:length(rxsim.ChannelNumbers)
fprintf("<strong>Scanning channel %d on band %.1f.</strong>n",rxsim.ChannelNumbers(i),rxsim.FrequencyBand);
if rxsim.ReceiveOnSDR
sdrReceiver.CenterFrequency = rxsim.CenterFrequencies(i);
capturedData = capture(sdrReceiver,rxsim.CaptureTime);
else
capturedData = double(rx.capturedWaveforms(:,i));
end
% Display spectrum and spectrogram
if displayScope %#ok<*UNRCH>
scope = spectrumAnalyzer(ViewType="spectrum-and-spectrogram",SampleRate=rxsim.RadioSampleRate,…
TimeSpanSource="property",TimeSpan=seconds(rxsim.CaptureTime));
scope.Title = "Band: " + rxsim.FrequencyBand + " Channel: " + rxsim.ChannelNumbers(i);
scope(capturedData);
end
% Resample the captured data to basesband sample rate for beacon processing
if overSampFac ~= 1
capturedData = resample(capturedData,bbSampleRate,rxsim.RadioSampleRate);
end
searchOffset = 0;
while searchOffset<length(capturedData)
capturedData = capturedData(searchOffset+1:end);
if(strcmp(config,’DSSS, band 2.4′))
[decParams, searchOffset, res, bitsData] = recoverDSSS(capturedData);
else
[decParams, searchOffset, res, bitsData] = recoverNonHTOFDM(capturedData,rxsim);
end
if ~isempty(bitsData)
[cfgMAC, ~, decodeStatus] = wlanMPDUDecode(bitsData,cfg …
,SuppressWarnings=false);
% Print additional information on all successfully recovered packets
if ~decodeStatus && displayAdditionalInfo
payloadSize = floor(length(bitsData)/8);
if(strcmp(config,’DSSS, band 2.4′))
fprintf("Payload Size: %d | Modulation: %s | Data Rate: %s n",payloadSize,decParams.modulation,decParams.dataRate);
else
fprintf("Payload Size: %d | Modulation: %s | Code Rate: %s n",payloadSize,decParams.modulation,decParams.coderate);
end
fprintf("Type: %s | Sub-Type: %s",cfgMAC.getType,cfgMAC.getSubtype);
end
% Extract information about channel from the beacon.
if ~decodeStatus && matches(cfgMAC.FrameType,"Beacon")
% Populate the table with information about the beacon.
if isempty(cfgMAC.ManagementConfig.SSID)
APs(indexAP).SSID = "Hidden";
else
APs(indexAP).SSID = string(cfgMAC.ManagementConfig.SSID);
end
APs(indexAP).BSSID = string(cfgMAC.Address3);
if retrieveVendorInfo
APs(indexAP).Vendor = determineVendor(cfgMAC.Address3);
else
APs(indexAP).Vendor = "Skipped";
end
[APs(indexAP).Mode, APs(indexAP).Channel_Width_MHz, operatingChannel,primaryChannel] = …
determineMode(cfgMAC.ManagementConfig.InformationElements);
if isempty(operatingChannel)
% Default to scanning channel if operating channel
% cannot be determined.
operatingChannel = rxsim.ChannelNumbers(i);
end
if(rxsim.ChannelNumbers(i)~=primaryChannel)
% Skip the iteration if the current search channel is
% not the primary channel.
APs = APs(1:indexAP-1);
continue;
end
fprintf("<strong>%s beacon detected on channel %d in band %.1f.</strong>n",APs(indexAP).SSID,rxsim.ChannelNumbers(i),rxsim.FrequencyBand);
APs(indexAP).Beacon_Channel = primaryChannel;
APs(indexAP).Operating_Channel = operatingChannel;
if(~strcmp(config,’DSSS, band 2.4′))
APs(indexAP).SNR_dB = res.LLTFSNR;
end
APs(indexAP).MAC_Config = cfgMAC;
APs(indexAP).Offset = res.PacketOffset;
APs(indexAP).Waveform = capturedData;
indexAP = indexAP + 1;
end
end
end
end
toc Hello Y’all,
I have a NI USRP coupled with a router’s antenna, and I receive 802.11 wifi signals in the 2.4G band. Then I convert that signal to .mat format and filter channel by channel to extract beacon frames and print their info such as ssid, bssid etc. I use Maltab’s WLAN Beacon Receiver Using Software-Defined Radio tutorial to do the beacon extraction, with config=’OFDM, band 2.4′ . I was able to see the router’s ssid from my phone and laptop, like how it is broadcasting in channel 1, 2.4 band (non-HT data) and its mode is 802.11n. I was also able to see regular spikes of energy every 100 ms when i plotted the spectrogram of channel_1 from the .mat file, indicating there is beacon transmission clearly. I am not able to figure out why the matlab code is not able to extract the beacon frames, i just used the standard matlab tutorial attached above, any help in figuring out the bottleneck in my approach would be really appreciated. Let me also attach the actual code in case if it helps (also my matlab version is R2022b)
fileName="C:WiFi_ProjectWiFi Dataextracted data20240626b_0.5seachData_0channel_1.mat";
rxsim.ReceiveOnSDR = false;
config=’OFDM, band 2.4′;
cbw="CBW20";
cfg = wlanNonHTConfig(ChannelBandwidth=cbw);
displayScope = true;
displayAdditionalInfo=false;
retrieveVendorInfo=true;
if rxsim.ReceiveOnSDR
[frequencyBand,bbSampleRate,chanNumber] = getSimParams(config);
rxsim.FrequencyBand = frequencyBand;
rxsim.RadioSampleRate = bbSampleRate;
rxsim.ChannelNumbers = chanNumber;
rxsim.SDRDeviceName = "Pluto"; % SDR for waveform reception
rxsim.RadioGain = 50;
rxsim.ReceiveAntenna = 1; % Configure to work with only a single antenna
rxsim.CaptureTime = milliseconds(102.4); % Value expected to be of type duration
% Derived Parameters
rxsim.CenterFrequencies = wlanChannelFrequency(rxsim.ChannelNumbers,rxsim.FrequencyBand);
else
rx = load(fileName);
[~,bbSampleRate,~] = getSimParams(config);
rxsim.ChannelNumbers = rx.channels;
rxsim.RadioSampleRate = rx.radioSampleRate;
rxsim.FrequencyBand = rx.band;
% Derived Parameters
rxsim.CaptureTime = seconds(size(rx.capturedWaveforms,1)/rxsim.RadioSampleRate);
end
overSampFac = rxsim.RadioSampleRate/bbSampleRate;
if rxsim.ReceiveOnSDR
sdrReceiver = hSDRReceiver(rxsim.SDRDeviceName);
sdrReceiver.SampleRate = rxsim.RadioSampleRate;
sdrReceiver.Gain = rxsim.RadioGain;
sdrReceiver.ChannelMapping = rxsim.ReceiveAntenna;
sdrReceiver.OutputDataType = "single";
end
APs = struct(…
"SSID",[],"BSSID",[],"Vendor",[],"SNR_dB",[],"Beacon_Channel",[], …
"Operating_Channel",[],"Channel_Width_MHz",[],"Band",[],"Mode",[], …
"MAC_Config",wlanMACFrameConfig,"Waveform",[],"Offset",[]);
indexAP = 1;
%Scan and decode for the specified channels.
tic
for i = 1:length(rxsim.ChannelNumbers)
fprintf("<strong>Scanning channel %d on band %.1f.</strong>n",rxsim.ChannelNumbers(i),rxsim.FrequencyBand);
if rxsim.ReceiveOnSDR
sdrReceiver.CenterFrequency = rxsim.CenterFrequencies(i);
capturedData = capture(sdrReceiver,rxsim.CaptureTime);
else
capturedData = double(rx.capturedWaveforms(:,i));
end
% Display spectrum and spectrogram
if displayScope %#ok<*UNRCH>
scope = spectrumAnalyzer(ViewType="spectrum-and-spectrogram",SampleRate=rxsim.RadioSampleRate,…
TimeSpanSource="property",TimeSpan=seconds(rxsim.CaptureTime));
scope.Title = "Band: " + rxsim.FrequencyBand + " Channel: " + rxsim.ChannelNumbers(i);
scope(capturedData);
end
% Resample the captured data to basesband sample rate for beacon processing
if overSampFac ~= 1
capturedData = resample(capturedData,bbSampleRate,rxsim.RadioSampleRate);
end
searchOffset = 0;
while searchOffset<length(capturedData)
capturedData = capturedData(searchOffset+1:end);
if(strcmp(config,’DSSS, band 2.4′))
[decParams, searchOffset, res, bitsData] = recoverDSSS(capturedData);
else
[decParams, searchOffset, res, bitsData] = recoverNonHTOFDM(capturedData,rxsim);
end
if ~isempty(bitsData)
[cfgMAC, ~, decodeStatus] = wlanMPDUDecode(bitsData,cfg …
,SuppressWarnings=false);
% Print additional information on all successfully recovered packets
if ~decodeStatus && displayAdditionalInfo
payloadSize = floor(length(bitsData)/8);
if(strcmp(config,’DSSS, band 2.4′))
fprintf("Payload Size: %d | Modulation: %s | Data Rate: %s n",payloadSize,decParams.modulation,decParams.dataRate);
else
fprintf("Payload Size: %d | Modulation: %s | Code Rate: %s n",payloadSize,decParams.modulation,decParams.coderate);
end
fprintf("Type: %s | Sub-Type: %s",cfgMAC.getType,cfgMAC.getSubtype);
end
% Extract information about channel from the beacon.
if ~decodeStatus && matches(cfgMAC.FrameType,"Beacon")
% Populate the table with information about the beacon.
if isempty(cfgMAC.ManagementConfig.SSID)
APs(indexAP).SSID = "Hidden";
else
APs(indexAP).SSID = string(cfgMAC.ManagementConfig.SSID);
end
APs(indexAP).BSSID = string(cfgMAC.Address3);
if retrieveVendorInfo
APs(indexAP).Vendor = determineVendor(cfgMAC.Address3);
else
APs(indexAP).Vendor = "Skipped";
end
[APs(indexAP).Mode, APs(indexAP).Channel_Width_MHz, operatingChannel,primaryChannel] = …
determineMode(cfgMAC.ManagementConfig.InformationElements);
if isempty(operatingChannel)
% Default to scanning channel if operating channel
% cannot be determined.
operatingChannel = rxsim.ChannelNumbers(i);
end
if(rxsim.ChannelNumbers(i)~=primaryChannel)
% Skip the iteration if the current search channel is
% not the primary channel.
APs = APs(1:indexAP-1);
continue;
end
fprintf("<strong>%s beacon detected on channel %d in band %.1f.</strong>n",APs(indexAP).SSID,rxsim.ChannelNumbers(i),rxsim.FrequencyBand);
APs(indexAP).Beacon_Channel = primaryChannel;
APs(indexAP).Operating_Channel = operatingChannel;
if(~strcmp(config,’DSSS, band 2.4′))
APs(indexAP).SNR_dB = res.LLTFSNR;
end
APs(indexAP).MAC_Config = cfgMAC;
APs(indexAP).Offset = res.PacketOffset;
APs(indexAP).Waveform = capturedData;
indexAP = indexAP + 1;
end
end
end
end
toc 802.11 packet extraction, beacon frames extraction MATLAB Answers — New Questions
The following error occurred during deployment to your hardware board: The generated code exceeds the available memory on the processor. It uses 137.9% of available program
The image below shows the error I encounter while trying to Run on board (Monitor & Tune). I am using Arduino Uno R3 board and MG995R servo motor for the test. Nevertheless if I deploy this very simple simulink block to arduino, it will deploy and run perfectly. What could I change?The image below shows the error I encounter while trying to Run on board (Monitor & Tune). I am using Arduino Uno R3 board and MG995R servo motor for the test. Nevertheless if I deploy this very simple simulink block to arduino, it will deploy and run perfectly. What could I change? The image below shows the error I encounter while trying to Run on board (Monitor & Tune). I am using Arduino Uno R3 board and MG995R servo motor for the test. Nevertheless if I deploy this very simple simulink block to arduino, it will deploy and run perfectly. What could I change? arduino, hardware, arduino hardware, simulink MATLAB Answers — New Questions
Intersection condition between two ellipses
I have two ellipse using the ellipse equation. I need to know whether the two ellipses are intersecting or not as a Boolean value. True if intersecting, and False if not intersecting. The usage of Solve function is not working in my matlab version. So please suggest me a numerical way to write this code. I have copied the code I am using for it.
ellipseTwo = ‘((x+0)^2)/2^2 + ((y-5)^2)/4^2 = 1’; ellipseOne = ‘((x+0)^2)/2^2 + (y-5)^2/4^2 = 1’;
ezplot(ellipseOne, [-10, 10, -10, 10]);
hold on
ezplot(ellipseTwo, [-10, 10, -10, 10]);I have two ellipse using the ellipse equation. I need to know whether the two ellipses are intersecting or not as a Boolean value. True if intersecting, and False if not intersecting. The usage of Solve function is not working in my matlab version. So please suggest me a numerical way to write this code. I have copied the code I am using for it.
ellipseTwo = ‘((x+0)^2)/2^2 + ((y-5)^2)/4^2 = 1’; ellipseOne = ‘((x+0)^2)/2^2 + (y-5)^2/4^2 = 1’;
ezplot(ellipseOne, [-10, 10, -10, 10]);
hold on
ezplot(ellipseTwo, [-10, 10, -10, 10]); I have two ellipse using the ellipse equation. I need to know whether the two ellipses are intersecting or not as a Boolean value. True if intersecting, and False if not intersecting. The usage of Solve function is not working in my matlab version. So please suggest me a numerical way to write this code. I have copied the code I am using for it.
ellipseTwo = ‘((x+0)^2)/2^2 + ((y-5)^2)/4^2 = 1’; ellipseOne = ‘((x+0)^2)/2^2 + (y-5)^2/4^2 = 1’;
ezplot(ellipseOne, [-10, 10, -10, 10]);
hold on
ezplot(ellipseTwo, [-10, 10, -10, 10]); ellipse intersection MATLAB Answers — New Questions
Simulink prompts that variables have multiple definitions, with StorageType=’native integer’ in memory
This model ran normally before.
I updated update 9 today. Later, it was discovered that there were multiple definitions for a certain variable in the runtime prompt, ① StorageType=’native integer’ in memory; ② StorageType=’uint8′ in **.sldd
I have modified the name of the variable in SLDD, but it is still the same error.
Restarting the computer and Matlab doesn’t work either.
I don’t know if this is caused by update 9.This model ran normally before.
I updated update 9 today. Later, it was discovered that there were multiple definitions for a certain variable in the runtime prompt, ① StorageType=’native integer’ in memory; ② StorageType=’uint8′ in **.sldd
I have modified the name of the variable in SLDD, but it is still the same error.
Restarting the computer and Matlab doesn’t work either.
I don’t know if this is caused by update 9. This model ran normally before.
I updated update 9 today. Later, it was discovered that there were multiple definitions for a certain variable in the runtime prompt, ① StorageType=’native integer’ in memory; ② StorageType=’uint8′ in **.sldd
I have modified the name of the variable in SLDD, but it is still the same error.
Restarting the computer and Matlab doesn’t work either.
I don’t know if this is caused by update 9. storagetype, multiple definition, sldd, 原生整数 MATLAB Answers — New Questions
Labview Matlb Call Function
What VALUE should be in the Return Type for a Labview DBL in a Labview Matlab Call FunctionWhat VALUE should be in the Return Type for a Labview DBL in a Labview Matlab Call Function What VALUE should be in the Return Type for a Labview DBL in a Labview Matlab Call Function matlab call function MATLAB Answers — New Questions
Why did the parallel computing’s task return the state of failure?
%% para
ttest = struct;
htype = {‘h_gyr’, ‘h_sul’};
dtype = {‘d_gyr’, ‘d_sul’};
ptype = {‘p_gyr’, ‘p_sul’};
ttype = {‘t_gyr’, ‘t_sul’};
ztype = {‘z_gyr’, ‘z_sul’};
Dtype = {‘BD’, ‘MDD’, ‘SCH’};
morp = {‘depth’,’fractaldimension’,’gyrification’,’thickness’};
times = 10000;
load dataedge_rmcov.mat
%% obtain t and p
% disease type
for idtype = 2:length(Dtype)
ttest(idtype).name = Dtype{idtype};
% sites
for isite = 1:length(covariate(idtype).d_gyr(:,1))
for itype = 1:length(dtype) %network type
% obtain value T and value P
% [tmp_t, tmp_p] = gretna_permutation_ttest(covariate(idtype).(dtype{itype}){isite, imor}, …
% covariate(idtype).(htype{itype}){isite, imor}, times); % T-test
% % create parallel task to perform the ttest
% % divide to four parallel task(SD, FD, GI, CT)
clu = parcluster();
job = createJob(clu);
task = createTask(job, @gretna_permutation_ttest,2, { …
{covariate(idtype).(htype{itype}){isite, 1},covariate(idtype).(dtype{itype}){isite, 1},times}, …
{covariate(idtype).(htype{itype}){isite, 2},covariate(idtype).(dtype{itype}){isite, 2},times}, …
{covariate(idtype).(htype{itype}){isite, 3},covariate(idtype).(dtype{itype}){isite, 3},times}, …
{covariate(idtype).(htype{itype}){isite, 4},covariate(idtype).(dtype{itype}){isite, 4},times} …
});
submit(job);
wait(job);
res = fetchOutputs(job); % result of four morphological networks for one site of G-G or S-S network’s edges
for imor = 1:length(morp) % save data to each morphological network
% save t and p
ttest(idtype).(ttype{itype}){isite, imor} = res{imor,1}.real;
ttest(idtype).(ptype{itype}){isite, imor} = res{imor,2};
% p->z
for i = 1:length(ttest(idtype).p_gyr{isite, imor}(1,:))
p = ttest(idtype).(ptype{itype}){isite, imor}(:, i);
z = icdf(‘Normal’, 1-(p/2), 0, 1);
t = ttest(idtype).(ttype{itype}){isite, imor}(:, i);
Z(:, i) = z * sign(t);
end
ttest(idtype).(ztype{itype}){isite, imor} = Z;
end
end %network type(G-G and S-S)
% fprintf("%s site_%d %s process overn", Dtype{idtype}, isite, mor_index{imor});
end %site
end % disease type
save dataedge_ttest2.mat ttest
When I use parallen task to perform the `gretna_permutation_ttest` function,the first dataset run properly, but the second dataset get fault whose task’s state is failure. Why is this happening?
Result returned exactly
Result returned by exception%% para
ttest = struct;
htype = {‘h_gyr’, ‘h_sul’};
dtype = {‘d_gyr’, ‘d_sul’};
ptype = {‘p_gyr’, ‘p_sul’};
ttype = {‘t_gyr’, ‘t_sul’};
ztype = {‘z_gyr’, ‘z_sul’};
Dtype = {‘BD’, ‘MDD’, ‘SCH’};
morp = {‘depth’,’fractaldimension’,’gyrification’,’thickness’};
times = 10000;
load dataedge_rmcov.mat
%% obtain t and p
% disease type
for idtype = 2:length(Dtype)
ttest(idtype).name = Dtype{idtype};
% sites
for isite = 1:length(covariate(idtype).d_gyr(:,1))
for itype = 1:length(dtype) %network type
% obtain value T and value P
% [tmp_t, tmp_p] = gretna_permutation_ttest(covariate(idtype).(dtype{itype}){isite, imor}, …
% covariate(idtype).(htype{itype}){isite, imor}, times); % T-test
% % create parallel task to perform the ttest
% % divide to four parallel task(SD, FD, GI, CT)
clu = parcluster();
job = createJob(clu);
task = createTask(job, @gretna_permutation_ttest,2, { …
{covariate(idtype).(htype{itype}){isite, 1},covariate(idtype).(dtype{itype}){isite, 1},times}, …
{covariate(idtype).(htype{itype}){isite, 2},covariate(idtype).(dtype{itype}){isite, 2},times}, …
{covariate(idtype).(htype{itype}){isite, 3},covariate(idtype).(dtype{itype}){isite, 3},times}, …
{covariate(idtype).(htype{itype}){isite, 4},covariate(idtype).(dtype{itype}){isite, 4},times} …
});
submit(job);
wait(job);
res = fetchOutputs(job); % result of four morphological networks for one site of G-G or S-S network’s edges
for imor = 1:length(morp) % save data to each morphological network
% save t and p
ttest(idtype).(ttype{itype}){isite, imor} = res{imor,1}.real;
ttest(idtype).(ptype{itype}){isite, imor} = res{imor,2};
% p->z
for i = 1:length(ttest(idtype).p_gyr{isite, imor}(1,:))
p = ttest(idtype).(ptype{itype}){isite, imor}(:, i);
z = icdf(‘Normal’, 1-(p/2), 0, 1);
t = ttest(idtype).(ttype{itype}){isite, imor}(:, i);
Z(:, i) = z * sign(t);
end
ttest(idtype).(ztype{itype}){isite, imor} = Z;
end
end %network type(G-G and S-S)
% fprintf("%s site_%d %s process overn", Dtype{idtype}, isite, mor_index{imor});
end %site
end % disease type
save dataedge_ttest2.mat ttest
When I use parallen task to perform the `gretna_permutation_ttest` function,the first dataset run properly, but the second dataset get fault whose task’s state is failure. Why is this happening?
Result returned exactly
Result returned by exception %% para
ttest = struct;
htype = {‘h_gyr’, ‘h_sul’};
dtype = {‘d_gyr’, ‘d_sul’};
ptype = {‘p_gyr’, ‘p_sul’};
ttype = {‘t_gyr’, ‘t_sul’};
ztype = {‘z_gyr’, ‘z_sul’};
Dtype = {‘BD’, ‘MDD’, ‘SCH’};
morp = {‘depth’,’fractaldimension’,’gyrification’,’thickness’};
times = 10000;
load dataedge_rmcov.mat
%% obtain t and p
% disease type
for idtype = 2:length(Dtype)
ttest(idtype).name = Dtype{idtype};
% sites
for isite = 1:length(covariate(idtype).d_gyr(:,1))
for itype = 1:length(dtype) %network type
% obtain value T and value P
% [tmp_t, tmp_p] = gretna_permutation_ttest(covariate(idtype).(dtype{itype}){isite, imor}, …
% covariate(idtype).(htype{itype}){isite, imor}, times); % T-test
% % create parallel task to perform the ttest
% % divide to four parallel task(SD, FD, GI, CT)
clu = parcluster();
job = createJob(clu);
task = createTask(job, @gretna_permutation_ttest,2, { …
{covariate(idtype).(htype{itype}){isite, 1},covariate(idtype).(dtype{itype}){isite, 1},times}, …
{covariate(idtype).(htype{itype}){isite, 2},covariate(idtype).(dtype{itype}){isite, 2},times}, …
{covariate(idtype).(htype{itype}){isite, 3},covariate(idtype).(dtype{itype}){isite, 3},times}, …
{covariate(idtype).(htype{itype}){isite, 4},covariate(idtype).(dtype{itype}){isite, 4},times} …
});
submit(job);
wait(job);
res = fetchOutputs(job); % result of four morphological networks for one site of G-G or S-S network’s edges
for imor = 1:length(morp) % save data to each morphological network
% save t and p
ttest(idtype).(ttype{itype}){isite, imor} = res{imor,1}.real;
ttest(idtype).(ptype{itype}){isite, imor} = res{imor,2};
% p->z
for i = 1:length(ttest(idtype).p_gyr{isite, imor}(1,:))
p = ttest(idtype).(ptype{itype}){isite, imor}(:, i);
z = icdf(‘Normal’, 1-(p/2), 0, 1);
t = ttest(idtype).(ttype{itype}){isite, imor}(:, i);
Z(:, i) = z * sign(t);
end
ttest(idtype).(ztype{itype}){isite, imor} = Z;
end
end %network type(G-G and S-S)
% fprintf("%s site_%d %s process overn", Dtype{idtype}, isite, mor_index{imor});
end %site
end % disease type
save dataedge_ttest2.mat ttest
When I use parallen task to perform the `gretna_permutation_ttest` function,the first dataset run properly, but the second dataset get fault whose task’s state is failure. Why is this happening?
Result returned exactly
Result returned by exception parallel computing MATLAB Answers — New Questions
Random numbers from randsample suddenly repeating
Hey,
I have a problem with my random numbers that suddenly start to repeat.
Unfortunately I cant chare my code that generates the problem. I scaled it down to something that actually does the same, but somehow the problem does not appear…
But maybe someone can still figure out whats my problem is…
So here is my example code that visuallizes whats going on.
x=-10:0.2:10;
[x1,x2]=meshgrid([-10:0.2:10],[-10:0.2:10]);
close all
figure
xlim([-10 10])
ylim([-10 10])
for i=1:400
y=pdf(‘Normal’,x,0,0.3+0.05*sqrt(i));
Nuc_id=[randsample( [1:numel(P)] , 16, true, P(:))]’;
[row,col]=ind2sub(size(P),Nuc_id);
P=f*y.*y’;
hold off
imagesc(P)
hold on
scatter(row,col,10,’r’,’filled’)
pbaspect([1 1 1])
pause(0.1)
end
I have a probability function P that changes over time depending on multiple conditions. In the example code I just changed sigma with the rising index, that should do just fine compared that the original way of calculating P.
Then I take random values from P, based on the probability of P itsself. In this case its 16 random indices.
here, as in my originla Code it works just fine, but in my originla code, after multiple iterations, these 16 rnd indices suddenly stop changing, from one iteration to the next. its like 16 rnd numbers for 200 iterations and suddenly its the same 16 rdn numbers 5 times in a row, sometimes only 15/16 are the same and the one that is different differs just by one, like index 567 instead of 568 or so. Then after 5 times repeating those rnd numbers, all 16 rnd numbers are changed to 16 new rnd numbers, but those also repeat a few times. And after doing this 2 to 4 times, the behaviour stops as sudden as it startet and the rnd numbers are perfectly random again…
I can run the code and visually see when it happens, when I breakpoint the code after "randsample" I can show that the rand number did not change compared to the previous iteration, but then when i manually copy the randsample line inthe command window while the code is paused, the rand numbers are rnd again…
So i realy cant trace back where the problem is comming from, but maybe somebody has an idea.
PS: Not sure if related th this post:
https://de.mathworks.com/matlabcentral/answers/1680149-why-do-the-random-numbers-repeat-in-each-run?s_tid=prof_contriblnk
But I do not have a problem when some numbers or the whole 16 numbers would repeat somewhere or sometimes, but not 5 times in a row out of nothing…
Many thanks in advance
Best regardsHey,
I have a problem with my random numbers that suddenly start to repeat.
Unfortunately I cant chare my code that generates the problem. I scaled it down to something that actually does the same, but somehow the problem does not appear…
But maybe someone can still figure out whats my problem is…
So here is my example code that visuallizes whats going on.
x=-10:0.2:10;
[x1,x2]=meshgrid([-10:0.2:10],[-10:0.2:10]);
close all
figure
xlim([-10 10])
ylim([-10 10])
for i=1:400
y=pdf(‘Normal’,x,0,0.3+0.05*sqrt(i));
Nuc_id=[randsample( [1:numel(P)] , 16, true, P(:))]’;
[row,col]=ind2sub(size(P),Nuc_id);
P=f*y.*y’;
hold off
imagesc(P)
hold on
scatter(row,col,10,’r’,’filled’)
pbaspect([1 1 1])
pause(0.1)
end
I have a probability function P that changes over time depending on multiple conditions. In the example code I just changed sigma with the rising index, that should do just fine compared that the original way of calculating P.
Then I take random values from P, based on the probability of P itsself. In this case its 16 random indices.
here, as in my originla Code it works just fine, but in my originla code, after multiple iterations, these 16 rnd indices suddenly stop changing, from one iteration to the next. its like 16 rnd numbers for 200 iterations and suddenly its the same 16 rdn numbers 5 times in a row, sometimes only 15/16 are the same and the one that is different differs just by one, like index 567 instead of 568 or so. Then after 5 times repeating those rnd numbers, all 16 rnd numbers are changed to 16 new rnd numbers, but those also repeat a few times. And after doing this 2 to 4 times, the behaviour stops as sudden as it startet and the rnd numbers are perfectly random again…
I can run the code and visually see when it happens, when I breakpoint the code after "randsample" I can show that the rand number did not change compared to the previous iteration, but then when i manually copy the randsample line inthe command window while the code is paused, the rand numbers are rnd again…
So i realy cant trace back where the problem is comming from, but maybe somebody has an idea.
PS: Not sure if related th this post:
https://de.mathworks.com/matlabcentral/answers/1680149-why-do-the-random-numbers-repeat-in-each-run?s_tid=prof_contriblnk
But I do not have a problem when some numbers or the whole 16 numbers would repeat somewhere or sometimes, but not 5 times in a row out of nothing…
Many thanks in advance
Best regards Hey,
I have a problem with my random numbers that suddenly start to repeat.
Unfortunately I cant chare my code that generates the problem. I scaled it down to something that actually does the same, but somehow the problem does not appear…
But maybe someone can still figure out whats my problem is…
So here is my example code that visuallizes whats going on.
x=-10:0.2:10;
[x1,x2]=meshgrid([-10:0.2:10],[-10:0.2:10]);
close all
figure
xlim([-10 10])
ylim([-10 10])
for i=1:400
y=pdf(‘Normal’,x,0,0.3+0.05*sqrt(i));
Nuc_id=[randsample( [1:numel(P)] , 16, true, P(:))]’;
[row,col]=ind2sub(size(P),Nuc_id);
P=f*y.*y’;
hold off
imagesc(P)
hold on
scatter(row,col,10,’r’,’filled’)
pbaspect([1 1 1])
pause(0.1)
end
I have a probability function P that changes over time depending on multiple conditions. In the example code I just changed sigma with the rising index, that should do just fine compared that the original way of calculating P.
Then I take random values from P, based on the probability of P itsself. In this case its 16 random indices.
here, as in my originla Code it works just fine, but in my originla code, after multiple iterations, these 16 rnd indices suddenly stop changing, from one iteration to the next. its like 16 rnd numbers for 200 iterations and suddenly its the same 16 rdn numbers 5 times in a row, sometimes only 15/16 are the same and the one that is different differs just by one, like index 567 instead of 568 or so. Then after 5 times repeating those rnd numbers, all 16 rnd numbers are changed to 16 new rnd numbers, but those also repeat a few times. And after doing this 2 to 4 times, the behaviour stops as sudden as it startet and the rnd numbers are perfectly random again…
I can run the code and visually see when it happens, when I breakpoint the code after "randsample" I can show that the rand number did not change compared to the previous iteration, but then when i manually copy the randsample line inthe command window while the code is paused, the rand numbers are rnd again…
So i realy cant trace back where the problem is comming from, but maybe somebody has an idea.
PS: Not sure if related th this post:
https://de.mathworks.com/matlabcentral/answers/1680149-why-do-the-random-numbers-repeat-in-each-run?s_tid=prof_contriblnk
But I do not have a problem when some numbers or the whole 16 numbers would repeat somewhere or sometimes, but not 5 times in a row out of nothing…
Many thanks in advance
Best regards randsample, random, not random, repeat MATLAB Answers — New Questions
why my esp8266 push data to ThingSpeak will always hit -301 response code
why my esp8266 push data to ThingSpeak will always hit -301 response codewhy my esp8266 push data to ThingSpeak will always hit -301 response code why my esp8266 push data to ThingSpeak will always hit -301 response code thingspeak MATLAB Answers — New Questions
Code-snippets in Live Scripts?
Hello,
in my Live Scripts I have some lines of codes which I use very frequently. One example is
set(get(gca, ‘ylabel’), ‘Rotation’, 0, ‘HorizontalAlignment’, ‘right’, ‘VerticalAlignment’, ‘middle’)
to rotate the y-axis label.
In other progarmming environments it is possible to define code snippets to insert code, which is used often.
What I do not want: defining a function for such lines, as I distrubute the Live Scripts to students, and using support function leads to difficulties.
Are there any recommendations how to introduce code sippets?
MichaelHello,
in my Live Scripts I have some lines of codes which I use very frequently. One example is
set(get(gca, ‘ylabel’), ‘Rotation’, 0, ‘HorizontalAlignment’, ‘right’, ‘VerticalAlignment’, ‘middle’)
to rotate the y-axis label.
In other progarmming environments it is possible to define code snippets to insert code, which is used often.
What I do not want: defining a function for such lines, as I distrubute the Live Scripts to students, and using support function leads to difficulties.
Are there any recommendations how to introduce code sippets?
Michael Hello,
in my Live Scripts I have some lines of codes which I use very frequently. One example is
set(get(gca, ‘ylabel’), ‘Rotation’, 0, ‘HorizontalAlignment’, ‘right’, ‘VerticalAlignment’, ‘middle’)
to rotate the y-axis label.
In other progarmming environments it is possible to define code snippets to insert code, which is used often.
What I do not want: defining a function for such lines, as I distrubute the Live Scripts to students, and using support function leads to difficulties.
Are there any recommendations how to introduce code sippets?
Michael code snippet MATLAB Answers — New Questions
Matlab not starting (Ubuntu 22.04) – hangs with CPU 100% and no error messages
Hi,
My R2019 was working perfectly just a few weeks ago, but today it does not start (-nojvm -nodesktop does not help). It just outputs "MATLAB is selecting SOFTWARE rendering." and the Matlab prompt never opens. I checked and it still uses CPU, but nothing happens even after 20 minutes.
I even installed a later version (R2024a), but the same problem persists.
My system: 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/LinuxHi,
My R2019 was working perfectly just a few weeks ago, but today it does not start (-nojvm -nodesktop does not help). It just outputs "MATLAB is selecting SOFTWARE rendering." and the Matlab prompt never opens. I checked and it still uses CPU, but nothing happens even after 20 minutes.
I even installed a later version (R2024a), but the same problem persists.
My system: 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux Hi,
My R2019 was working perfectly just a few weeks ago, but today it does not start (-nojvm -nodesktop does not help). It just outputs "MATLAB is selecting SOFTWARE rendering." and the Matlab prompt never opens. I checked and it still uses CPU, but nothing happens even after 20 minutes.
I even installed a later version (R2024a), but the same problem persists.
My system: 5.15.0-112-generic #122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux starting matlab MATLAB Answers — New Questions
What does the following error mean “Internal error while creating code interface description file: codeInfo.mat. Aborting code generation.”
Codegen is throwing the following error when doing code generation
"Internal error while creating code interface description file: codeInfo.mat. Aborting code generation.
Caused by:
Index exceeds the number of array elements. Index must not exceed 0. "
The error doesn’t give any more information and hence cannot figure out what is the problem. Using ert based target file.Codegen is throwing the following error when doing code generation
"Internal error while creating code interface description file: codeInfo.mat. Aborting code generation.
Caused by:
Index exceeds the number of array elements. Index must not exceed 0. "
The error doesn’t give any more information and hence cannot figure out what is the problem. Using ert based target file. Codegen is throwing the following error when doing code generation
"Internal error while creating code interface description file: codeInfo.mat. Aborting code generation.
Caused by:
Index exceeds the number of array elements. Index must not exceed 0. "
The error doesn’t give any more information and hence cannot figure out what is the problem. Using ert based target file. internal error MATLAB Answers — New Questions
How to deal with timing error when using Timer Function?
Hi everyone,
I am currently writing a code using Timer function to record mouse path with 1kHz rate (i.e. I want to record the position of the mouse every 0.001s). I discovered that the Timer function does not have the precision under 50ms. I also found that the matlab time outputs did not add up to the total trial running time (i.e. if I add up the time tracked by the Timer function, the value is always less than the actual running time of the mouse path). I think if the error in timing comes from the accumulation of excution time of the Timer function, in theory the value should be greater than the actual running time. I am hoping if anyone could take a look at my code and give me some suggestion, and am also wondering if people have encountered similar issue. The following is the Timer Function that I used:
timerObj = timer(‘TimerFcn’, @recordMousePos, ‘Period’, 0.001, ‘ExecutionMode’, ‘fixedRate’);
Thank you!Hi everyone,
I am currently writing a code using Timer function to record mouse path with 1kHz rate (i.e. I want to record the position of the mouse every 0.001s). I discovered that the Timer function does not have the precision under 50ms. I also found that the matlab time outputs did not add up to the total trial running time (i.e. if I add up the time tracked by the Timer function, the value is always less than the actual running time of the mouse path). I think if the error in timing comes from the accumulation of excution time of the Timer function, in theory the value should be greater than the actual running time. I am hoping if anyone could take a look at my code and give me some suggestion, and am also wondering if people have encountered similar issue. The following is the Timer Function that I used:
timerObj = timer(‘TimerFcn’, @recordMousePos, ‘Period’, 0.001, ‘ExecutionMode’, ‘fixedRate’);
Thank you! Hi everyone,
I am currently writing a code using Timer function to record mouse path with 1kHz rate (i.e. I want to record the position of the mouse every 0.001s). I discovered that the Timer function does not have the precision under 50ms. I also found that the matlab time outputs did not add up to the total trial running time (i.e. if I add up the time tracked by the Timer function, the value is always less than the actual running time of the mouse path). I think if the error in timing comes from the accumulation of excution time of the Timer function, in theory the value should be greater than the actual running time. I am hoping if anyone could take a look at my code and give me some suggestion, and am also wondering if people have encountered similar issue. The following is the Timer Function that I used:
timerObj = timer(‘TimerFcn’, @recordMousePos, ‘Period’, 0.001, ‘ExecutionMode’, ‘fixedRate’);
Thank you! timerfcn, timer MATLAB Answers — New Questions
How to generate simulink model from multiple verilog codes?
I am trying to generate simulink model from almost 175 verilog files. Using importhdl it always shows some error whether i try using folder, subfolder, path or filenames. Is there any way to fix it?I am trying to generate simulink model from almost 175 verilog files. Using importhdl it always shows some error whether i try using folder, subfolder, path or filenames. Is there any way to fix it? I am trying to generate simulink model from almost 175 verilog files. Using importhdl it always shows some error whether i try using folder, subfolder, path or filenames. Is there any way to fix it? simulink model, hdl, simulink generation MATLAB Answers — New Questions
How to export RegressionEnsemble to ONNX.
exportONNXNetwork only works on neural nets. However ONNX has support for regression models as demonstrated here: https://onnx.ai/sklearn-onnx/auto_examples/plot_convert_model.html
Anyone have any ideas on a workflow to get our model(s) out of matlab for use in Triton? There will probably need to be an intermediary format.exportONNXNetwork only works on neural nets. However ONNX has support for regression models as demonstrated here: https://onnx.ai/sklearn-onnx/auto_examples/plot_convert_model.html
Anyone have any ideas on a workflow to get our model(s) out of matlab for use in Triton? There will probably need to be an intermediary format. exportONNXNetwork only works on neural nets. However ONNX has support for regression models as demonstrated here: https://onnx.ai/sklearn-onnx/auto_examples/plot_convert_model.html
Anyone have any ideas on a workflow to get our model(s) out of matlab for use in Triton? There will probably need to be an intermediary format. machine learning, export, python, onnx, regression MATLAB Answers — New Questions
issue in IP core generation
Failed ‘C:Usersaijaz_22011140OneDrive – Universiti Teknologi PETRONASDesktop’ contains white space in project path. Please try by removing white space from working directory.
this is the issue in my laptop trying to solve it but unable.Failed ‘C:Usersaijaz_22011140OneDrive – Universiti Teknologi PETRONASDesktop’ contains white space in project path. Please try by removing white space from working directory.
this is the issue in my laptop trying to solve it but unable. Failed ‘C:Usersaijaz_22011140OneDrive – Universiti Teknologi PETRONASDesktop’ contains white space in project path. Please try by removing white space from working directory.
this is the issue in my laptop trying to solve it but unable. matlab, fpga, xilinx, pid, controller MATLAB Answers — New Questions
The problem of real-time continuous generation of simulated vehicles in the RoadRunner Scenario
Hello
I have a problem with the RoadRunner Scenario.
Can I use relevant API to control RoadRunner Scenario in matlab to generate simulation vehicles in real time by myself?Hello
I have a problem with the RoadRunner Scenario.
Can I use relevant API to control RoadRunner Scenario in matlab to generate simulation vehicles in real time by myself? Hello
I have a problem with the RoadRunner Scenario.
Can I use relevant API to control RoadRunner Scenario in matlab to generate simulation vehicles in real time by myself? roadrunner scenario MATLAB Answers — New Questions
Undefined function or method ‘…’ for input arguments of type ‘double’.
I’m getting the following error when I try to run some function m-files:
??? Undefined function or method ‘[name of function]’ for input arguments of type ‘double’.
I know this usually happens when the file isn’t in the working directory, but that’s not the case here.
When I was running these m-files in a different directory on my computer, it worked fine. I moved them to another directory on my laptop, and they’re still fine, but I get this error on two of my desktops.
Thank you.I’m getting the following error when I try to run some function m-files:
??? Undefined function or method ‘[name of function]’ for input arguments of type ‘double’.
I know this usually happens when the file isn’t in the working directory, but that’s not the case here.
When I was running these m-files in a different directory on my computer, it worked fine. I moved them to another directory on my laptop, and they’re still fine, but I get this error on two of my desktops.
Thank you. I’m getting the following error when I try to run some function m-files:
??? Undefined function or method ‘[name of function]’ for input arguments of type ‘double’.
I know this usually happens when the file isn’t in the working directory, but that’s not the case here.
When I was running these m-files in a different directory on my computer, it worked fine. I moved them to another directory on my laptop, and they’re still fine, but I get this error on two of my desktops.
Thank you. undefined function or method, function m-files, overcoming obstacles MATLAB Answers — New Questions
How to get an expression for a Hypergeometric function with symbiotic variable
I want to calculate the inverse Laplace transform of ,
where G(r)= , s is the variable.
My code can’t compute a Hypergeometric function function with symbolic variable, and it can’t get a concrete inverse Laplace transformation.
here is my code
phi=4;alpha=2.2;beta=4.7e-05;rho=25;r1=500;r2=400;lambda=4.0e-05;
syms s r t
G_r=0.5*r^2*(hypergeom([phi,-2/alpha],(alpha-2)/alpha,-r^(-alpha)*beta*rho*s )-1);
L_IBd00_s=exp(2*pi*lambda*( vpa(subs(G_r,r,r1),5) -vpa(subs(G_r,r,r2),5) ));
L_IBd00_inv=ilaplace(1/s*L_IBd00_s);
the result is
>> vpa(subs(G_r,r,radius),5)
ans =
125000.0*hypergeom([-0.90909, 4.0], 0.090909, -1.342e-9*s) – 125000.0
>> vpa(L_IBd00_inv,5)
ans =
0.000012253*heaviside(t)*ilaplace(exp(10.0*pi*hypergeom([-0.90909, 4.0], 0.090909, -1.342e-9*s) – 6.4*pi*hypergeom([-0.90909, 4.0], 0.090909, -2.1926e-9*s))/s, s, t)
So how can i get an expression of L_IBd00_inv with respect to the variable t?I want to calculate the inverse Laplace transform of ,
where G(r)= , s is the variable.
My code can’t compute a Hypergeometric function function with symbolic variable, and it can’t get a concrete inverse Laplace transformation.
here is my code
phi=4;alpha=2.2;beta=4.7e-05;rho=25;r1=500;r2=400;lambda=4.0e-05;
syms s r t
G_r=0.5*r^2*(hypergeom([phi,-2/alpha],(alpha-2)/alpha,-r^(-alpha)*beta*rho*s )-1);
L_IBd00_s=exp(2*pi*lambda*( vpa(subs(G_r,r,r1),5) -vpa(subs(G_r,r,r2),5) ));
L_IBd00_inv=ilaplace(1/s*L_IBd00_s);
the result is
>> vpa(subs(G_r,r,radius),5)
ans =
125000.0*hypergeom([-0.90909, 4.0], 0.090909, -1.342e-9*s) – 125000.0
>> vpa(L_IBd00_inv,5)
ans =
0.000012253*heaviside(t)*ilaplace(exp(10.0*pi*hypergeom([-0.90909, 4.0], 0.090909, -1.342e-9*s) – 6.4*pi*hypergeom([-0.90909, 4.0], 0.090909, -2.1926e-9*s))/s, s, t)
So how can i get an expression of L_IBd00_inv with respect to the variable t? I want to calculate the inverse Laplace transform of ,
where G(r)= , s is the variable.
My code can’t compute a Hypergeometric function function with symbolic variable, and it can’t get a concrete inverse Laplace transformation.
here is my code
phi=4;alpha=2.2;beta=4.7e-05;rho=25;r1=500;r2=400;lambda=4.0e-05;
syms s r t
G_r=0.5*r^2*(hypergeom([phi,-2/alpha],(alpha-2)/alpha,-r^(-alpha)*beta*rho*s )-1);
L_IBd00_s=exp(2*pi*lambda*( vpa(subs(G_r,r,r1),5) -vpa(subs(G_r,r,r2),5) ));
L_IBd00_inv=ilaplace(1/s*L_IBd00_s);
the result is
>> vpa(subs(G_r,r,radius),5)
ans =
125000.0*hypergeom([-0.90909, 4.0], 0.090909, -1.342e-9*s) – 125000.0
>> vpa(L_IBd00_inv,5)
ans =
0.000012253*heaviside(t)*ilaplace(exp(10.0*pi*hypergeom([-0.90909, 4.0], 0.090909, -1.342e-9*s) – 6.4*pi*hypergeom([-0.90909, 4.0], 0.090909, -2.1926e-9*s))/s, s, t)
So how can i get an expression of L_IBd00_inv with respect to the variable t? hypergeometric, matlab, laplace MATLAB Answers — New Questions
echo is off issue in matlab
Task "Vivado IP Packager" unsuccessful. See log for details.
Generated logfile:
ECHO is off.
ECHO is off.
while generating the HDL code in the matlab it gives me the option is the Echo is off.Task "Vivado IP Packager" unsuccessful. See log for details.
Generated logfile:
ECHO is off.
ECHO is off.
while generating the HDL code in the matlab it gives me the option is the Echo is off. Task "Vivado IP Packager" unsuccessful. See log for details.
Generated logfile:
ECHO is off.
ECHO is off.
while generating the HDL code in the matlab it gives me the option is the Echo is off. fpga, xilinx, matlab coder MATLAB Answers — New Questions
Is there an ideal voltage source block that can change the voltage based on the command voltage value without using PWM in simscape electrical?
I am simulating the control of a BLDC motor (PMSM) with simscape, but when I try to reproduce PWM control at the microcontroller level and control the voltage, the sampling time needs to be very small to achieve sufficient voltage resolution, which increases the calculation time.
Therefore, we would like to replace the PWM generator, gate driver, inverter, and stabilizing power supply that apply the command voltage to the BLDC with an ideal voltage source block that can vary the voltage based on the input command voltage.
Is there such an ideal voltage source block at simscape electrical?
Also, if you know of a method to speed up the computation of BLDC control that does not involve such an approach, please let me know.
We are considering using an equivalent simplified model, but would like to find a better alternative.
Thank you in advance.I am simulating the control of a BLDC motor (PMSM) with simscape, but when I try to reproduce PWM control at the microcontroller level and control the voltage, the sampling time needs to be very small to achieve sufficient voltage resolution, which increases the calculation time.
Therefore, we would like to replace the PWM generator, gate driver, inverter, and stabilizing power supply that apply the command voltage to the BLDC with an ideal voltage source block that can vary the voltage based on the input command voltage.
Is there such an ideal voltage source block at simscape electrical?
Also, if you know of a method to speed up the computation of BLDC control that does not involve such an approach, please let me know.
We are considering using an equivalent simplified model, but would like to find a better alternative.
Thank you in advance. I am simulating the control of a BLDC motor (PMSM) with simscape, but when I try to reproduce PWM control at the microcontroller level and control the voltage, the sampling time needs to be very small to achieve sufficient voltage resolution, which increases the calculation time.
Therefore, we would like to replace the PWM generator, gate driver, inverter, and stabilizing power supply that apply the command voltage to the BLDC with an ideal voltage source block that can vary the voltage based on the input command voltage.
Is there such an ideal voltage source block at simscape electrical?
Also, if you know of a method to speed up the computation of BLDC control that does not involve such an approach, please let me know.
We are considering using an equivalent simplified model, but would like to find a better alternative.
Thank you in advance. bldc, simulink, simscape, electric_motor_control, pmsm, pwm MATLAB Answers — New Questions