Tag Archives: matlab
Is it possible to connect a UE to a nrGNB in both download and upload links at the same time?
Hello all.
Is it possible to connect a UE to a nrGNB in both download and upload links at the same time?
In my scenario, I have to simulate UE connecting in both links at the same gNB or in different ones simultaneously, depending on some current evaluations.
In "NR Intercell Interference Modeling" and "Connect UEs to gNB" examples, I could see how to do this separately. But couldn’t understand if and, if possible, how to do it.
Any clue?
[]’s.Hello all.
Is it possible to connect a UE to a nrGNB in both download and upload links at the same time?
In my scenario, I have to simulate UE connecting in both links at the same gNB or in different ones simultaneously, depending on some current evaluations.
In "NR Intercell Interference Modeling" and "Connect UEs to gNB" examples, I could see how to do this separately. But couldn’t understand if and, if possible, how to do it.
Any clue?
[]’s. Hello all.
Is it possible to connect a UE to a nrGNB in both download and upload links at the same time?
In my scenario, I have to simulate UE connecting in both links at the same gNB or in different ones simultaneously, depending on some current evaluations.
In "NR Intercell Interference Modeling" and "Connect UEs to gNB" examples, I could see how to do this separately. But couldn’t understand if and, if possible, how to do it.
Any clue?
[]’s. 5g, sub-6 ghz, nrgnb, ue, connection MATLAB Answers — New Questions
Read the dates in the excel sheet
In the attached excel sheet, how to read the dates of the first and latest occurence 15 days before the CP (checkpoint) and 15 days after CP. The output sheet should be an excel sheet. It should again contain multiple sheets categorising the error status. Inside the excel sheet, sheet1 should contain only enabled states, sheet 2 should contain only disabled states and sheet three should contain locked states. Consider the date 10/15/2024 12:45, from checkpoint first it should read the dates 15 days before CP and 15 days after CP. First enable error states dates should be categorised. If enabled state is not there it should search for locked error state, if it is available it should categorise 15 days before and after CP. Also highlight the checkpoint.
How to proceed with this? as there is date inconsistency.
How to create a model and execute? When it is executed Excel sheet should be the output.In the attached excel sheet, how to read the dates of the first and latest occurence 15 days before the CP (checkpoint) and 15 days after CP. The output sheet should be an excel sheet. It should again contain multiple sheets categorising the error status. Inside the excel sheet, sheet1 should contain only enabled states, sheet 2 should contain only disabled states and sheet three should contain locked states. Consider the date 10/15/2024 12:45, from checkpoint first it should read the dates 15 days before CP and 15 days after CP. First enable error states dates should be categorised. If enabled state is not there it should search for locked error state, if it is available it should categorise 15 days before and after CP. Also highlight the checkpoint.
How to proceed with this? as there is date inconsistency.
How to create a model and execute? When it is executed Excel sheet should be the output. In the attached excel sheet, how to read the dates of the first and latest occurence 15 days before the CP (checkpoint) and 15 days after CP. The output sheet should be an excel sheet. It should again contain multiple sheets categorising the error status. Inside the excel sheet, sheet1 should contain only enabled states, sheet 2 should contain only disabled states and sheet three should contain locked states. Consider the date 10/15/2024 12:45, from checkpoint first it should read the dates 15 days before CP and 15 days after CP. First enable error states dates should be categorised. If enabled state is not there it should search for locked error state, if it is available it should categorise 15 days before and after CP. Also highlight the checkpoint.
How to proceed with this? as there is date inconsistency.
How to create a model and execute? When it is executed Excel sheet should be the output. reading inconsistent date formats. MATLAB Answers — New Questions
How to open help doc in a Window rather than browser?
Matlab 2024b。
I have installed help doc and rebooted Matlab.
However, whether I choose to open in a small window or in the help browser, it will only open in the browser.
Like this:Matlab 2024b。
I have installed help doc and rebooted Matlab.
However, whether I choose to open in a small window or in the help browser, it will only open in the browser.
Like this: Matlab 2024b。
I have installed help doc and rebooted Matlab.
However, whether I choose to open in a small window or in the help browser, it will only open in the browser.
Like this: help doc MATLAB Answers — New Questions
Please help me to solve this problem!. I have to design four images flickering at different frequencies and spacing between images are 2.5cm.
S = imread(‘rose.jpeg’); % read the image from files
A = imresize(S,[183,275]); % resize image
subplot(221); % to make 2 by 2 matrix of pictures
imshow(A); % display the image
B = imread(‘lotus.jpeg’);
subplot(222);
imshow(B);
T = imread(‘lily.jpeg’) ;
C = imresize(T,[183,275]);
subplot(223);
imshow(C);
D = imread(‘orchid.jpeg’);
subplot(224);
imshow(D);
% imfinfo("Lily.jpeg")
% imfinfo("rose.jpeg")
% imfinfo("lotus.jpeg")
% imfinfo("orchid.jpeg")S = imread(‘rose.jpeg’); % read the image from files
A = imresize(S,[183,275]); % resize image
subplot(221); % to make 2 by 2 matrix of pictures
imshow(A); % display the image
B = imread(‘lotus.jpeg’);
subplot(222);
imshow(B);
T = imread(‘lily.jpeg’) ;
C = imresize(T,[183,275]);
subplot(223);
imshow(C);
D = imread(‘orchid.jpeg’);
subplot(224);
imshow(D);
% imfinfo("Lily.jpeg")
% imfinfo("rose.jpeg")
% imfinfo("lotus.jpeg")
% imfinfo("orchid.jpeg") S = imread(‘rose.jpeg’); % read the image from files
A = imresize(S,[183,275]); % resize image
subplot(221); % to make 2 by 2 matrix of pictures
imshow(A); % display the image
B = imread(‘lotus.jpeg’);
subplot(222);
imshow(B);
T = imread(‘lily.jpeg’) ;
C = imresize(T,[183,275]);
subplot(223);
imshow(C);
D = imread(‘orchid.jpeg’);
subplot(224);
imshow(D);
% imfinfo("Lily.jpeg")
% imfinfo("rose.jpeg")
% imfinfo("lotus.jpeg")
% imfinfo("orchid.jpeg") image processing, frequency MATLAB Answers — New Questions
Why am I getting the error “ODBC Driver Error: Specified driver could not be loaded due to system error 1114: A dynamic link library (DLL) initialization routine failed.”
I have written MATLAB code to connect to an Oracle Database using ODBC. I have the ODBC driver installed, and the MATLAB code runs successfully in MATLAB. However, I need to compile the code for deployment as a standalone application, and the executable throws the following error when I run it:
"ODBC Driver Error: Specified driver could not be loaded due to system error 1114: A dynamic link library (DLL) initialization routine failed. (Oracle in instantclient_19_18_64, C:oracleora19c-64instantclient_19_18_64SQORA32.dll)."
I have confirmed that the ODBC Driver (ex. C:oracleora19c-64instantclient_19_18_64SQORA32.dll) exists on the machine where the application is being executed.I have written MATLAB code to connect to an Oracle Database using ODBC. I have the ODBC driver installed, and the MATLAB code runs successfully in MATLAB. However, I need to compile the code for deployment as a standalone application, and the executable throws the following error when I run it:
"ODBC Driver Error: Specified driver could not be loaded due to system error 1114: A dynamic link library (DLL) initialization routine failed. (Oracle in instantclient_19_18_64, C:oracleora19c-64instantclient_19_18_64SQORA32.dll)."
I have confirmed that the ODBC Driver (ex. C:oracleora19c-64instantclient_19_18_64SQORA32.dll) exists on the machine where the application is being executed. I have written MATLAB code to connect to an Oracle Database using ODBC. I have the ODBC driver installed, and the MATLAB code runs successfully in MATLAB. However, I need to compile the code for deployment as a standalone application, and the executable throws the following error when I run it:
"ODBC Driver Error: Specified driver could not be loaded due to system error 1114: A dynamic link library (DLL) initialization routine failed. (Oracle in instantclient_19_18_64, C:oracleora19c-64instantclient_19_18_64SQORA32.dll)."
I have confirmed that the ODBC Driver (ex. C:oracleora19c-64instantclient_19_18_64SQORA32.dll) exists on the machine where the application is being executed. database, oracle, odbc, deployed, standalone, application, compiler, driver MATLAB Answers — New Questions
Why am I unable to load a Python module that requires a certain CUDA version in MATLAB after calling a MATLAB function that uses CUDA enabled GPU?
I am using the Deep Learning Toolbox and GPU computation in MATLAB R2021b with the function "predict".
After calling this function, I wish to load the Python module PyTorch into MATLAB. My PyTorch version is 2.1.2+cu121, which means it comes with and uses CUDA version 12.1.
However, when I run the command to import PyTorch in MATLAB, the following error is thrown.
Error using __init__><module> (line 130)
Python Error: OSError: [WinError 127] The specified procedure could not be
found. Error loading "D:Program
FilesPythonPython39libsite-packagestorchlibcudnn_adv_infer64_8.dll" or
one of its dependencies.
Error in <frozen importlib>_call_with_frames_removed (line 228)
Error in <frozen importlib>exec_module (line 850)
Error in <frozen importlib>_load_unlocked (line 680)
Error in <frozen importlib>_find_and_load_unlocked (line 986)
Error in <frozen importlib>_find_and_load (line 1007)
Error in <frozen importlib>_gcd_import (line 1030)
Error in __init__>import_module (line 127)
Why is this error happening and how can I load PyTorch?
Additionally, if I try to load PyTorch before calling "predict", the output of "predict" is different than the output is if I never load "PyTorch". This difference in output is also a concern for me.I am using the Deep Learning Toolbox and GPU computation in MATLAB R2021b with the function "predict".
After calling this function, I wish to load the Python module PyTorch into MATLAB. My PyTorch version is 2.1.2+cu121, which means it comes with and uses CUDA version 12.1.
However, when I run the command to import PyTorch in MATLAB, the following error is thrown.
Error using __init__><module> (line 130)
Python Error: OSError: [WinError 127] The specified procedure could not be
found. Error loading "D:Program
FilesPythonPython39libsite-packagestorchlibcudnn_adv_infer64_8.dll" or
one of its dependencies.
Error in <frozen importlib>_call_with_frames_removed (line 228)
Error in <frozen importlib>exec_module (line 850)
Error in <frozen importlib>_load_unlocked (line 680)
Error in <frozen importlib>_find_and_load_unlocked (line 986)
Error in <frozen importlib>_find_and_load (line 1007)
Error in <frozen importlib>_gcd_import (line 1030)
Error in __init__>import_module (line 127)
Why is this error happening and how can I load PyTorch?
Additionally, if I try to load PyTorch before calling "predict", the output of "predict" is different than the output is if I never load "PyTorch". This difference in output is also a concern for me. I am using the Deep Learning Toolbox and GPU computation in MATLAB R2021b with the function "predict".
After calling this function, I wish to load the Python module PyTorch into MATLAB. My PyTorch version is 2.1.2+cu121, which means it comes with and uses CUDA version 12.1.
However, when I run the command to import PyTorch in MATLAB, the following error is thrown.
Error using __init__><module> (line 130)
Python Error: OSError: [WinError 127] The specified procedure could not be
found. Error loading "D:Program
FilesPythonPython39libsite-packagestorchlibcudnn_adv_infer64_8.dll" or
one of its dependencies.
Error in <frozen importlib>_call_with_frames_removed (line 228)
Error in <frozen importlib>exec_module (line 850)
Error in <frozen importlib>_load_unlocked (line 680)
Error in <frozen importlib>_find_and_load_unlocked (line 986)
Error in <frozen importlib>_find_and_load (line 1007)
Error in <frozen importlib>_gcd_import (line 1030)
Error in __init__>import_module (line 127)
Why is this error happening and how can I load PyTorch?
Additionally, if I try to load PyTorch before calling "predict", the output of "predict" is different than the output is if I never load "PyTorch". This difference in output is also a concern for me. deeplearningtoolbox, python, cuda, version, predict, cudnn MATLAB Answers — New Questions
Statically Inderteminant Beam Using Finite Difference Method
Dear all
I am trying to code for the displacements of statically Inderterminant beam using the finite difference method. It appears that I am not that far off from achieving this, however, in one of the points that I have discretized I am getting an incorrect result.
Here, is the graph that comes from the software and what I am trying to replicate:
Here is the graph in MATAB:
As can been seen there is an anomaly at x = 4.1m at which the vertical result is zero. The displacement should only be zero at x = 0m, 5m and 8m.
I don’t know if there is an error in my code, but I can’t seem to find anything myself.
Here is my code:
clear, clc, close all
% Structural Properties
E = 2.1E+08 % Modulus of elasticity
I = 18890/100^4 % Second moment of area
EI = E*I % Flexural Rigidity
L = 8 % Beam Length
N = 161 % Number of points
x = linspace(0,L,N) % Discretise the beam
h = L/(N-1) % Step size
q = 8 % Load intensity
% Set up matrix using fourth order finite difference
mat1 = diag(ones(1,N)*6) ;
mat2 = diag(ones(1,N-1)*-4, 1);
mat3 = diag(ones(1,N-1)*-4, -1);
mat4 = diag(ones(1,N-2)*1, 2);
mat5 = diag(ones(1,N-2)*1, -2);
Mat = [mat1 + mat2 + mat3 + mat4 + mat5]
% Add boundary conditions. Slope = 0 at x = 0 – Use first order finite difference
mat6 = zeros(1,N);
mat6(1,1) = -3;
mat6(1,2) = 4;
mat6(1,3) = -1;
Mat(2,:) = mat6
% Add boundary conditions. Moment = 0 at x = L – using second order finite difference method
mat7 = zeros(1,N);
mat7(1,N-3) = 2
mat7(1,N-2) = -5;
mat7(1,N-1) = 4;
mat7(1,N) = -1
Mat(N-1,:) = mat7
% Remove rows and columns where displacement is zero
% Displacement equals zero at x = 0, x = L and x = 5/8 of beam length
Mat(:,[1,N,(N-1)*5/8]) = [];
Mat([1,N,(N-1)*5/8],:) = []
% Set up right-hand side
RHS = ones(1,N)*q*h^4/EI;
RHS(2) = 0;
RHS(N-1) = 0
% Remove rows and columns where displacement is zero
% Displacement equals zero at x = 0, x = L and x = 5/8 of beam length
RHS([1,N,(N-1)*5/8]) = []
% Solve for displacement
v = (inv(Mat)*RHS’)*1000
% Make new vector with displacements that equal zero
V = [0;v(1:(N+1)/2);0;v(((N+1)/2)+1:end);0]’
% Plot the displacement against beam length
plot(x,-V)
grid on
xlabel(‘Distance (m)’)
ylabel(‘Displacement (mm)’)
title(‘Local Displacements’)
In terms of the code, can anybody see what might be causing this anomaly?
Many thanks in advance!Dear all
I am trying to code for the displacements of statically Inderterminant beam using the finite difference method. It appears that I am not that far off from achieving this, however, in one of the points that I have discretized I am getting an incorrect result.
Here, is the graph that comes from the software and what I am trying to replicate:
Here is the graph in MATAB:
As can been seen there is an anomaly at x = 4.1m at which the vertical result is zero. The displacement should only be zero at x = 0m, 5m and 8m.
I don’t know if there is an error in my code, but I can’t seem to find anything myself.
Here is my code:
clear, clc, close all
% Structural Properties
E = 2.1E+08 % Modulus of elasticity
I = 18890/100^4 % Second moment of area
EI = E*I % Flexural Rigidity
L = 8 % Beam Length
N = 161 % Number of points
x = linspace(0,L,N) % Discretise the beam
h = L/(N-1) % Step size
q = 8 % Load intensity
% Set up matrix using fourth order finite difference
mat1 = diag(ones(1,N)*6) ;
mat2 = diag(ones(1,N-1)*-4, 1);
mat3 = diag(ones(1,N-1)*-4, -1);
mat4 = diag(ones(1,N-2)*1, 2);
mat5 = diag(ones(1,N-2)*1, -2);
Mat = [mat1 + mat2 + mat3 + mat4 + mat5]
% Add boundary conditions. Slope = 0 at x = 0 – Use first order finite difference
mat6 = zeros(1,N);
mat6(1,1) = -3;
mat6(1,2) = 4;
mat6(1,3) = -1;
Mat(2,:) = mat6
% Add boundary conditions. Moment = 0 at x = L – using second order finite difference method
mat7 = zeros(1,N);
mat7(1,N-3) = 2
mat7(1,N-2) = -5;
mat7(1,N-1) = 4;
mat7(1,N) = -1
Mat(N-1,:) = mat7
% Remove rows and columns where displacement is zero
% Displacement equals zero at x = 0, x = L and x = 5/8 of beam length
Mat(:,[1,N,(N-1)*5/8]) = [];
Mat([1,N,(N-1)*5/8],:) = []
% Set up right-hand side
RHS = ones(1,N)*q*h^4/EI;
RHS(2) = 0;
RHS(N-1) = 0
% Remove rows and columns where displacement is zero
% Displacement equals zero at x = 0, x = L and x = 5/8 of beam length
RHS([1,N,(N-1)*5/8]) = []
% Solve for displacement
v = (inv(Mat)*RHS’)*1000
% Make new vector with displacements that equal zero
V = [0;v(1:(N+1)/2);0;v(((N+1)/2)+1:end);0]’
% Plot the displacement against beam length
plot(x,-V)
grid on
xlabel(‘Distance (m)’)
ylabel(‘Displacement (mm)’)
title(‘Local Displacements’)
In terms of the code, can anybody see what might be causing this anomaly?
Many thanks in advance! Dear all
I am trying to code for the displacements of statically Inderterminant beam using the finite difference method. It appears that I am not that far off from achieving this, however, in one of the points that I have discretized I am getting an incorrect result.
Here, is the graph that comes from the software and what I am trying to replicate:
Here is the graph in MATAB:
As can been seen there is an anomaly at x = 4.1m at which the vertical result is zero. The displacement should only be zero at x = 0m, 5m and 8m.
I don’t know if there is an error in my code, but I can’t seem to find anything myself.
Here is my code:
clear, clc, close all
% Structural Properties
E = 2.1E+08 % Modulus of elasticity
I = 18890/100^4 % Second moment of area
EI = E*I % Flexural Rigidity
L = 8 % Beam Length
N = 161 % Number of points
x = linspace(0,L,N) % Discretise the beam
h = L/(N-1) % Step size
q = 8 % Load intensity
% Set up matrix using fourth order finite difference
mat1 = diag(ones(1,N)*6) ;
mat2 = diag(ones(1,N-1)*-4, 1);
mat3 = diag(ones(1,N-1)*-4, -1);
mat4 = diag(ones(1,N-2)*1, 2);
mat5 = diag(ones(1,N-2)*1, -2);
Mat = [mat1 + mat2 + mat3 + mat4 + mat5]
% Add boundary conditions. Slope = 0 at x = 0 – Use first order finite difference
mat6 = zeros(1,N);
mat6(1,1) = -3;
mat6(1,2) = 4;
mat6(1,3) = -1;
Mat(2,:) = mat6
% Add boundary conditions. Moment = 0 at x = L – using second order finite difference method
mat7 = zeros(1,N);
mat7(1,N-3) = 2
mat7(1,N-2) = -5;
mat7(1,N-1) = 4;
mat7(1,N) = -1
Mat(N-1,:) = mat7
% Remove rows and columns where displacement is zero
% Displacement equals zero at x = 0, x = L and x = 5/8 of beam length
Mat(:,[1,N,(N-1)*5/8]) = [];
Mat([1,N,(N-1)*5/8],:) = []
% Set up right-hand side
RHS = ones(1,N)*q*h^4/EI;
RHS(2) = 0;
RHS(N-1) = 0
% Remove rows and columns where displacement is zero
% Displacement equals zero at x = 0, x = L and x = 5/8 of beam length
RHS([1,N,(N-1)*5/8]) = []
% Solve for displacement
v = (inv(Mat)*RHS’)*1000
% Make new vector with displacements that equal zero
V = [0;v(1:(N+1)/2);0;v(((N+1)/2)+1:end);0]’
% Plot the displacement against beam length
plot(x,-V)
grid on
xlabel(‘Distance (m)’)
ylabel(‘Displacement (mm)’)
title(‘Local Displacements’)
In terms of the code, can anybody see what might be causing this anomaly?
Many thanks in advance! matrices, finite diffference method, boundary value problems MATLAB Answers — New Questions
How can I change my role and department on MathWorks?
When I was creating my profile I chose the wrong role description and department and would like to know how to change those two (2) things immediately.When I was creating my profile I chose the wrong role description and department and would like to know how to change those two (2) things immediately. When I was creating my profile I chose the wrong role description and department and would like to know how to change those two (2) things immediately. role, department, profile, creating MATLAB Answers — New Questions
Retraining YAMNet for audio classification returns channel mismatch error in “deep.internal.train.Trainer/train”
I am retraining YAMNet for a binary classification task, operating on spectrograms of audio signals. My training audio has two classes, positive and negative. Audio is preprocessed & features extracted using yamnetPreprocess(). When training the network, trainnet() produces the following error:
Error using deep.internal.train.Trainer/train (line 74)
Number of channels in predictions (2) must match the number of
channels in the targets (3).
Error in deep.internal.train.ParallelTrainer>iTrainWithSplitCommunicator (line 227)
remoteNetwork = train(remoteTrainer, remoteNetwork, workerMbq);
Error in deep.internal.train.ParallelTrainer/computeTraining (line 127)
spmd
Error in deep.internal.train.Trainer/train (line 59)
net = computeTraining(trainer, net, mbq);
Error in deep.internal.train.trainnet (line 54)
net = train(trainer, net, mbq);
Error in trainnet (line 42)
[net,info] = deep.internal.train.trainnet(mbq, net, loss, options, …
Error in train_DenseNet_detector_from_semi_synthetic_dataset (line 192)
[trained_network, train_info] = trainnet(trainFeatures, trainLabels’, net, "crossentropy", options);
My understanding of this error is that it indicates a mismatch between the number of classes the network expects, and the number of classes in the dataset. I do not see how this can be possible, considering the number of classes in the network is explicitly set by the number of classes in the datastore:
classNames = unique(ads.Labels);
numClasses = numel(classNames);
net = audioPretrainedNetwork("yamnet", NumClasses=numClasses);
My script is based on this MATLAB tutorial: audioPretrainedNetwork and there are no functional differences in the way I’m building datastores or preprocessing the data. The training options and the call to trainnet() are configured as follows:
options = trainingOptions(‘adam’, …
InitialLearnRate = initial_learn_rate, …
MaxEpochs = max_epochs, …
MiniBatchSize = mini_batch_size, …
Shuffle = "every-epoch", …
Plots = "training-progress", …
Metrics = "accuracy", …
Verbose = 1, …
ValidationData = {single(validationFeatures), validationLabels’}, …
ValidationFrequency = validationFrequency,…
ExecutionEnvironment="parallel-auto");
[trained_network, train_info] = trainnet(trainFeatures, trainLabels’, net, "crossentropy", options);
Relevant variable dimensions are as follows:
>> unique(ads.Labels)
ans =
2×1 categorical array
negative
positiveNoisy
>> size(trainLabels)
ans =
1 16240
>> size(trainFeatures)
ans =
96 64 1 16240
>> size(validationLabels)
ans =
1 6960
>> size(validationFeatures)
ans =
96 64 1 6960
The only real differences between my script and the MATLAB tutorial are that I’m using parallel execution in the training solver, and the datastore outputEnvironment is set to "gpu" . If I set ExecutionEnvironment = "auto" instead of "parallel-auto" and set ads.OutputEnvironment = ‘cpu’ the error stack is shorter, but the problem is the same:
Error using trainnet (line 46)
Number of channels in predictions (2) must match the number of channels in
the targets (3).
Error in train_DenseNet_detector_from_semi_synthetic_dataset (line 189)
[trained_network, train_info] = trainnet(trainFeatures, trainLabels’, net, "crossentropy", options);
Please could someone give me some advice? The root cause of this is buried in the deep learning toolbox, and it’s a little beyond me right now.
Thanks,
BenI am retraining YAMNet for a binary classification task, operating on spectrograms of audio signals. My training audio has two classes, positive and negative. Audio is preprocessed & features extracted using yamnetPreprocess(). When training the network, trainnet() produces the following error:
Error using deep.internal.train.Trainer/train (line 74)
Number of channels in predictions (2) must match the number of
channels in the targets (3).
Error in deep.internal.train.ParallelTrainer>iTrainWithSplitCommunicator (line 227)
remoteNetwork = train(remoteTrainer, remoteNetwork, workerMbq);
Error in deep.internal.train.ParallelTrainer/computeTraining (line 127)
spmd
Error in deep.internal.train.Trainer/train (line 59)
net = computeTraining(trainer, net, mbq);
Error in deep.internal.train.trainnet (line 54)
net = train(trainer, net, mbq);
Error in trainnet (line 42)
[net,info] = deep.internal.train.trainnet(mbq, net, loss, options, …
Error in train_DenseNet_detector_from_semi_synthetic_dataset (line 192)
[trained_network, train_info] = trainnet(trainFeatures, trainLabels’, net, "crossentropy", options);
My understanding of this error is that it indicates a mismatch between the number of classes the network expects, and the number of classes in the dataset. I do not see how this can be possible, considering the number of classes in the network is explicitly set by the number of classes in the datastore:
classNames = unique(ads.Labels);
numClasses = numel(classNames);
net = audioPretrainedNetwork("yamnet", NumClasses=numClasses);
My script is based on this MATLAB tutorial: audioPretrainedNetwork and there are no functional differences in the way I’m building datastores or preprocessing the data. The training options and the call to trainnet() are configured as follows:
options = trainingOptions(‘adam’, …
InitialLearnRate = initial_learn_rate, …
MaxEpochs = max_epochs, …
MiniBatchSize = mini_batch_size, …
Shuffle = "every-epoch", …
Plots = "training-progress", …
Metrics = "accuracy", …
Verbose = 1, …
ValidationData = {single(validationFeatures), validationLabels’}, …
ValidationFrequency = validationFrequency,…
ExecutionEnvironment="parallel-auto");
[trained_network, train_info] = trainnet(trainFeatures, trainLabels’, net, "crossentropy", options);
Relevant variable dimensions are as follows:
>> unique(ads.Labels)
ans =
2×1 categorical array
negative
positiveNoisy
>> size(trainLabels)
ans =
1 16240
>> size(trainFeatures)
ans =
96 64 1 16240
>> size(validationLabels)
ans =
1 6960
>> size(validationFeatures)
ans =
96 64 1 6960
The only real differences between my script and the MATLAB tutorial are that I’m using parallel execution in the training solver, and the datastore outputEnvironment is set to "gpu" . If I set ExecutionEnvironment = "auto" instead of "parallel-auto" and set ads.OutputEnvironment = ‘cpu’ the error stack is shorter, but the problem is the same:
Error using trainnet (line 46)
Number of channels in predictions (2) must match the number of channels in
the targets (3).
Error in train_DenseNet_detector_from_semi_synthetic_dataset (line 189)
[trained_network, train_info] = trainnet(trainFeatures, trainLabels’, net, "crossentropy", options);
Please could someone give me some advice? The root cause of this is buried in the deep learning toolbox, and it’s a little beyond me right now.
Thanks,
Ben I am retraining YAMNet for a binary classification task, operating on spectrograms of audio signals. My training audio has two classes, positive and negative. Audio is preprocessed & features extracted using yamnetPreprocess(). When training the network, trainnet() produces the following error:
Error using deep.internal.train.Trainer/train (line 74)
Number of channels in predictions (2) must match the number of
channels in the targets (3).
Error in deep.internal.train.ParallelTrainer>iTrainWithSplitCommunicator (line 227)
remoteNetwork = train(remoteTrainer, remoteNetwork, workerMbq);
Error in deep.internal.train.ParallelTrainer/computeTraining (line 127)
spmd
Error in deep.internal.train.Trainer/train (line 59)
net = computeTraining(trainer, net, mbq);
Error in deep.internal.train.trainnet (line 54)
net = train(trainer, net, mbq);
Error in trainnet (line 42)
[net,info] = deep.internal.train.trainnet(mbq, net, loss, options, …
Error in train_DenseNet_detector_from_semi_synthetic_dataset (line 192)
[trained_network, train_info] = trainnet(trainFeatures, trainLabels’, net, "crossentropy", options);
My understanding of this error is that it indicates a mismatch between the number of classes the network expects, and the number of classes in the dataset. I do not see how this can be possible, considering the number of classes in the network is explicitly set by the number of classes in the datastore:
classNames = unique(ads.Labels);
numClasses = numel(classNames);
net = audioPretrainedNetwork("yamnet", NumClasses=numClasses);
My script is based on this MATLAB tutorial: audioPretrainedNetwork and there are no functional differences in the way I’m building datastores or preprocessing the data. The training options and the call to trainnet() are configured as follows:
options = trainingOptions(‘adam’, …
InitialLearnRate = initial_learn_rate, …
MaxEpochs = max_epochs, …
MiniBatchSize = mini_batch_size, …
Shuffle = "every-epoch", …
Plots = "training-progress", …
Metrics = "accuracy", …
Verbose = 1, …
ValidationData = {single(validationFeatures), validationLabels’}, …
ValidationFrequency = validationFrequency,…
ExecutionEnvironment="parallel-auto");
[trained_network, train_info] = trainnet(trainFeatures, trainLabels’, net, "crossentropy", options);
Relevant variable dimensions are as follows:
>> unique(ads.Labels)
ans =
2×1 categorical array
negative
positiveNoisy
>> size(trainLabels)
ans =
1 16240
>> size(trainFeatures)
ans =
96 64 1 16240
>> size(validationLabels)
ans =
1 6960
>> size(validationFeatures)
ans =
96 64 1 6960
The only real differences between my script and the MATLAB tutorial are that I’m using parallel execution in the training solver, and the datastore outputEnvironment is set to "gpu" . If I set ExecutionEnvironment = "auto" instead of "parallel-auto" and set ads.OutputEnvironment = ‘cpu’ the error stack is shorter, but the problem is the same:
Error using trainnet (line 46)
Number of channels in predictions (2) must match the number of channels in
the targets (3).
Error in train_DenseNet_detector_from_semi_synthetic_dataset (line 189)
[trained_network, train_info] = trainnet(trainFeatures, trainLabels’, net, "crossentropy", options);
Please could someone give me some advice? The root cause of this is buried in the deep learning toolbox, and it’s a little beyond me right now.
Thanks,
Ben yammnet, audio, deep learning, trainnet, classification, signal processing, machine learning, image processing MATLAB Answers — New Questions
What is license validation and how does validation work?
What is license validation? What do I do when it says that validation is overdue?What is license validation? What do I do when it says that validation is overdue? What is license validation? What do I do when it says that validation is overdue? MATLAB Answers — New Questions
How to identify Gaussian type maxima in an image
I need to identify the correct maximum in a 2D image, which may not may not be a global maxima and is a kind of gaussian or asymmetric type.
Some example are attached.
A method other than imregionalmax or findpeaks is needed
Any suggestion
ThanksI need to identify the correct maximum in a 2D image, which may not may not be a global maxima and is a kind of gaussian or asymmetric type.
Some example are attached.
A method other than imregionalmax or findpeaks is needed
Any suggestion
Thanks I need to identify the correct maximum in a 2D image, which may not may not be a global maxima and is a kind of gaussian or asymmetric type.
Some example are attached.
A method other than imregionalmax or findpeaks is needed
Any suggestion
Thanks gaussian, mamima MATLAB Answers — New Questions
Make an offset on a stl file like with the multicuboid function
Hello eveyrone,
I have this stl file below and I would like to do a layer of a different material as with the offset of the multicuboid function.
I don’t know if it is possible to do it with an stl file.
I also made a canteliver with the multicuboid function with a layer on top of a different material but I don’t succeed to make "holes" to reproduce this structure. I tried with the addVoid function but it doesn’t work.
Here is the beginning of the code with the multicuboid function :
clc
clear vars
close all
% Create a PDE model for a modal analysis
modelModal_TP2 = createpde("structural","modal-solid");
% Dimensions of the canteliver
L = 75e-6;
l = 9e-6;
h = 1.2e-6;
% Geometry of the canteliver
gm1 = multicuboid(L,l,h);
% Geometry to do the hole in the first geometry
gm2 = multicuboid(45e-6,3e-6,h);
translate(gm2,[-15e-6 0 0]);
% g3 = addVoid(gm,gm1);
figure;
pdegplot(gm1)
hold on
pdegplot(gm2)
% figure;
% pdegplot(g3,"FaceLabels","on")
Thank you in advanceHello eveyrone,
I have this stl file below and I would like to do a layer of a different material as with the offset of the multicuboid function.
I don’t know if it is possible to do it with an stl file.
I also made a canteliver with the multicuboid function with a layer on top of a different material but I don’t succeed to make "holes" to reproduce this structure. I tried with the addVoid function but it doesn’t work.
Here is the beginning of the code with the multicuboid function :
clc
clear vars
close all
% Create a PDE model for a modal analysis
modelModal_TP2 = createpde("structural","modal-solid");
% Dimensions of the canteliver
L = 75e-6;
l = 9e-6;
h = 1.2e-6;
% Geometry of the canteliver
gm1 = multicuboid(L,l,h);
% Geometry to do the hole in the first geometry
gm2 = multicuboid(45e-6,3e-6,h);
translate(gm2,[-15e-6 0 0]);
% g3 = addVoid(gm,gm1);
figure;
pdegplot(gm1)
hold on
pdegplot(gm2)
% figure;
% pdegplot(g3,"FaceLabels","on")
Thank you in advance Hello eveyrone,
I have this stl file below and I would like to do a layer of a different material as with the offset of the multicuboid function.
I don’t know if it is possible to do it with an stl file.
I also made a canteliver with the multicuboid function with a layer on top of a different material but I don’t succeed to make "holes" to reproduce this structure. I tried with the addVoid function but it doesn’t work.
Here is the beginning of the code with the multicuboid function :
clc
clear vars
close all
% Create a PDE model for a modal analysis
modelModal_TP2 = createpde("structural","modal-solid");
% Dimensions of the canteliver
L = 75e-6;
l = 9e-6;
h = 1.2e-6;
% Geometry of the canteliver
gm1 = multicuboid(L,l,h);
% Geometry to do the hole in the first geometry
gm2 = multicuboid(45e-6,3e-6,h);
translate(gm2,[-15e-6 0 0]);
% g3 = addVoid(gm,gm1);
figure;
pdegplot(gm1)
hold on
pdegplot(gm2)
% figure;
% pdegplot(g3,"FaceLabels","on")
Thank you in advance pde toolboox, pde, toolbox, geometry, holes, void MATLAB Answers — New Questions
Variables Window – Table / TimeTable Wrap, no horizontal scroll Option?
As you can see from a screen shot below, if you make a time table (or table) that has a high number of rows and columbs and open that table in the variales window it is very difficult to read due to Matlab wrapping the columbs.
I havn’t been able to find anywhere in the settings where I can enable/disable this wapping feature from happening, where when disabled there the variables window would show a horizontal scroll when a table was opened with more columbs that could be displayed in the window.
Just imagine for a min if you had a table with 100+ columbs, and 1000+ rows, that would be near imposible to read using Matlab’s built in variables window, you would need to save it off to view it in excel. This doesn’t seem very friendly for debugging.
A second note, I found that the tables will only show a limited number of rows. In this example the variables window only goes up to the 54th row. Is there a way to view a table in the matlab variables window, and be able to scrow down through all the rows. The only way I can think to see what is in the table visually is by creating a new table with only 54 user selected rows (doesn’t seem very clean).
If there is any existing features that would adress some of these issues which I am missing, please let me know.As you can see from a screen shot below, if you make a time table (or table) that has a high number of rows and columbs and open that table in the variales window it is very difficult to read due to Matlab wrapping the columbs.
I havn’t been able to find anywhere in the settings where I can enable/disable this wapping feature from happening, where when disabled there the variables window would show a horizontal scroll when a table was opened with more columbs that could be displayed in the window.
Just imagine for a min if you had a table with 100+ columbs, and 1000+ rows, that would be near imposible to read using Matlab’s built in variables window, you would need to save it off to view it in excel. This doesn’t seem very friendly for debugging.
A second note, I found that the tables will only show a limited number of rows. In this example the variables window only goes up to the 54th row. Is there a way to view a table in the matlab variables window, and be able to scrow down through all the rows. The only way I can think to see what is in the table visually is by creating a new table with only 54 user selected rows (doesn’t seem very clean).
If there is any existing features that would adress some of these issues which I am missing, please let me know. As you can see from a screen shot below, if you make a time table (or table) that has a high number of rows and columbs and open that table in the variales window it is very difficult to read due to Matlab wrapping the columbs.
I havn’t been able to find anywhere in the settings where I can enable/disable this wapping feature from happening, where when disabled there the variables window would show a horizontal scroll when a table was opened with more columbs that could be displayed in the window.
Just imagine for a min if you had a table with 100+ columbs, and 1000+ rows, that would be near imposible to read using Matlab’s built in variables window, you would need to save it off to view it in excel. This doesn’t seem very friendly for debugging.
A second note, I found that the tables will only show a limited number of rows. In this example the variables window only goes up to the 54th row. Is there a way to view a table in the matlab variables window, and be able to scrow down through all the rows. The only way I can think to see what is in the table visually is by creating a new table with only 54 user selected rows (doesn’t seem very clean).
If there is any existing features that would adress some of these issues which I am missing, please let me know. table, timetable MATLAB Answers — New Questions
Convert cell array of structures to numeric vector
Suppose I have
ale{1}.a = 0;
ale{2}.a = 1;
ale{3}.a = 1.5
ale_vec = NaN(length(ale),1);
for ii=1:length(ale)
ale_vec(ii) = ale{ii}.a;
end
disp(ale_vec)
I would like to generate
%ale_vec = [0,1,1.5]
Is there a quick way to do this without using a loop?
Thanks!Suppose I have
ale{1}.a = 0;
ale{2}.a = 1;
ale{3}.a = 1.5
ale_vec = NaN(length(ale),1);
for ii=1:length(ale)
ale_vec(ii) = ale{ii}.a;
end
disp(ale_vec)
I would like to generate
%ale_vec = [0,1,1.5]
Is there a quick way to do this without using a loop?
Thanks! Suppose I have
ale{1}.a = 0;
ale{2}.a = 1;
ale{3}.a = 1.5
ale_vec = NaN(length(ale),1);
for ii=1:length(ale)
ale_vec(ii) = ale{ii}.a;
end
disp(ale_vec)
I would like to generate
%ale_vec = [0,1,1.5]
Is there a quick way to do this without using a loop?
Thanks! cell array, structures, vector MATLAB Answers — New Questions
Converting symbolic ODE solution to function … Warnings
I am trying to find symbolic solution of specific non-linear ODE and then convert it to the matlab function via flowing code:
syms y(x) f(x)
syms x x0 y0 a b c d real
eqn = diff(y,x) == f/(a+b*y+c*y^2+d*y^3);
cond = y(x0)==y0;
S(x) = dsolve(eqn,cond);
sS(x) =simplify(S)
matlabFunction(sS,"File","myfunc.m");
where
a,b,c,d are scalar real constants
f(x) is known external real function
x0,y0 define initial condition of ODE problem
During matlab code conversion I always get a several Warnings:
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FunctionNotVerifiedToBeValid∦Function ‘f’ not verified to be a valid MATLAB function.∦
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FunctionNotVerifiedToBeValid∦Function ‘f’ not verified to be a valid MATLAB function.∦
Warning: symbolic:generate:FunctionNotVerifiedToBeValid∦Function ‘f’ not verified to be a valid MATLAB function.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘(t4 + a*y0)/a’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘t14*(t6 + t20)’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a – (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a + (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
and the following matlab code:
function sS = BURh103(x,a,b,c,d,x0,y0)
%BURh103
% sS = BURh103(X,A,B,C,D,X0,Y0)
% This function was generated by the Symbolic Math Toolbox version 24.2.
% 03-Oct-2024 15:16:31
t0 = roots([d.*-3.0,c.*-4.0,b.*-6.0,a.*-1.2e+1,a.*y0.*1.2e+1+b.*y0.^2.*6.0+c.*y0.^3.*4.0+d.*y0.^4.*3.0+integral(@(u)f(u),x0,x).*1.2e+1]);
t2 = t0(1);
t0 = roots([c.*-4.0,b.*-6.0,a.*-1.2e+1,a.*y0.*1.2e+1+b.*y0.^2.*6.0+c.*y0.^3.*4.0+integral(@(u)f(u),x0,x).*1.2e+1]);
t3 = t0(1);
t4 = integral(@(u)f(u),x0,x);
t5 = b.*t4;
t6 = b.*y0;
t7 = a.^2;
t9 = (b ~= 0.0);
t10 = (c == 0.0);
t11 = (d == 0.0);
t14 = 1.0./b;
t15 = sqrt(2.0);
t13 = t5.*2.0;
t16 = a.*t6.*2.0;
t17 = a+t6;
t18 = sqrt(t5);
t19 = t6.^2;
t20 = t15.*t18;
if ~all(cellfun(@isscalar,{b,c,d,t10,t11,t17,t9}))
error(message(‘symbolic:sym:matlabFunction:ConditionsMustBeScalar’));
end
if (d ~= 0.0)
sS = t2;
elseif (t11 & (c ~= 0.0))
sS = t3;
elseif ((t10 & t11) & (b == 0.0))
sS = (t4+a.*y0)./a;
elseif (((t9 & t10) & t11) & (t17 == 0.0))
sS = t14.*(t6+t20);
elseif (((t9 & t10) & t11) & (0.0 < t17))
sS = -t14.*(a-sqrt(t7+t13+t16+t19));
elseif (((t9 & t10) & t11) & (t17 < 0.0))
sS = -t14.*(a+sqrt(t7+t13+t16+t19));
else
sS = NaN;
end
end
I did not understand the following warning messages:
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘(t4 + a*y0)/a’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘t14*(t6 + t20)’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a – (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a + (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
What exactly these messages are trying to say?
Moreover, the matlab code is far from optimal or effective code. The auxilliary variable txx are precomputed, but the same integral(@(u)f(u),x0,x) is computed three times?!I am trying to find symbolic solution of specific non-linear ODE and then convert it to the matlab function via flowing code:
syms y(x) f(x)
syms x x0 y0 a b c d real
eqn = diff(y,x) == f/(a+b*y+c*y^2+d*y^3);
cond = y(x0)==y0;
S(x) = dsolve(eqn,cond);
sS(x) =simplify(S)
matlabFunction(sS,"File","myfunc.m");
where
a,b,c,d are scalar real constants
f(x) is known external real function
x0,y0 define initial condition of ODE problem
During matlab code conversion I always get a several Warnings:
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FunctionNotVerifiedToBeValid∦Function ‘f’ not verified to be a valid MATLAB function.∦
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FunctionNotVerifiedToBeValid∦Function ‘f’ not verified to be a valid MATLAB function.∦
Warning: symbolic:generate:FunctionNotVerifiedToBeValid∦Function ‘f’ not verified to be a valid MATLAB function.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘(t4 + a*y0)/a’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘t14*(t6 + t20)’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a – (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a + (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
and the following matlab code:
function sS = BURh103(x,a,b,c,d,x0,y0)
%BURh103
% sS = BURh103(X,A,B,C,D,X0,Y0)
% This function was generated by the Symbolic Math Toolbox version 24.2.
% 03-Oct-2024 15:16:31
t0 = roots([d.*-3.0,c.*-4.0,b.*-6.0,a.*-1.2e+1,a.*y0.*1.2e+1+b.*y0.^2.*6.0+c.*y0.^3.*4.0+d.*y0.^4.*3.0+integral(@(u)f(u),x0,x).*1.2e+1]);
t2 = t0(1);
t0 = roots([c.*-4.0,b.*-6.0,a.*-1.2e+1,a.*y0.*1.2e+1+b.*y0.^2.*6.0+c.*y0.^3.*4.0+integral(@(u)f(u),x0,x).*1.2e+1]);
t3 = t0(1);
t4 = integral(@(u)f(u),x0,x);
t5 = b.*t4;
t6 = b.*y0;
t7 = a.^2;
t9 = (b ~= 0.0);
t10 = (c == 0.0);
t11 = (d == 0.0);
t14 = 1.0./b;
t15 = sqrt(2.0);
t13 = t5.*2.0;
t16 = a.*t6.*2.0;
t17 = a+t6;
t18 = sqrt(t5);
t19 = t6.^2;
t20 = t15.*t18;
if ~all(cellfun(@isscalar,{b,c,d,t10,t11,t17,t9}))
error(message(‘symbolic:sym:matlabFunction:ConditionsMustBeScalar’));
end
if (d ~= 0.0)
sS = t2;
elseif (t11 & (c ~= 0.0))
sS = t3;
elseif ((t10 & t11) & (b == 0.0))
sS = (t4+a.*y0)./a;
elseif (((t9 & t10) & t11) & (t17 == 0.0))
sS = t14.*(t6+t20);
elseif (((t9 & t10) & t11) & (0.0 < t17))
sS = -t14.*(a-sqrt(t7+t13+t16+t19));
elseif (((t9 & t10) & t11) & (t17 < 0.0))
sS = -t14.*(a+sqrt(t7+t13+t16+t19));
else
sS = NaN;
end
end
I did not understand the following warning messages:
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘(t4 + a*y0)/a’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘t14*(t6 + t20)’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a – (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a + (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
What exactly these messages are trying to say?
Moreover, the matlab code is far from optimal or effective code. The auxilliary variable txx are precomputed, but the same integral(@(u)f(u),x0,x) is computed three times?! I am trying to find symbolic solution of specific non-linear ODE and then convert it to the matlab function via flowing code:
syms y(x) f(x)
syms x x0 y0 a b c d real
eqn = diff(y,x) == f/(a+b*y+c*y^2+d*y^3);
cond = y(x0)==y0;
S(x) = dsolve(eqn,cond);
sS(x) =simplify(S)
matlabFunction(sS,"File","myfunc.m");
where
a,b,c,d are scalar real constants
f(x) is known external real function
x0,y0 define initial condition of ODE problem
During matlab code conversion I always get a several Warnings:
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FunctionNotVerifiedToBeValid∦Function ‘f’ not verified to be a valid MATLAB function.∦
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FunctionNotVerifiedToBeValid∦Function ‘f’ not verified to be a valid MATLAB function.∦
Warning: symbolic:generate:FunctionNotVerifiedToBeValid∦Function ‘f’ not verified to be a valid MATLAB function.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘(t4 + a*y0)/a’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘t14*(t6 + t20)’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a – (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a + (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
and the following matlab code:
function sS = BURh103(x,a,b,c,d,x0,y0)
%BURh103
% sS = BURh103(X,A,B,C,D,X0,Y0)
% This function was generated by the Symbolic Math Toolbox version 24.2.
% 03-Oct-2024 15:16:31
t0 = roots([d.*-3.0,c.*-4.0,b.*-6.0,a.*-1.2e+1,a.*y0.*1.2e+1+b.*y0.^2.*6.0+c.*y0.^3.*4.0+d.*y0.^4.*3.0+integral(@(u)f(u),x0,x).*1.2e+1]);
t2 = t0(1);
t0 = roots([c.*-4.0,b.*-6.0,a.*-1.2e+1,a.*y0.*1.2e+1+b.*y0.^2.*6.0+c.*y0.^3.*4.0+integral(@(u)f(u),x0,x).*1.2e+1]);
t3 = t0(1);
t4 = integral(@(u)f(u),x0,x);
t5 = b.*t4;
t6 = b.*y0;
t7 = a.^2;
t9 = (b ~= 0.0);
t10 = (c == 0.0);
t11 = (d == 0.0);
t14 = 1.0./b;
t15 = sqrt(2.0);
t13 = t5.*2.0;
t16 = a.*t6.*2.0;
t17 = a+t6;
t18 = sqrt(t5);
t19 = t6.^2;
t20 = t15.*t18;
if ~all(cellfun(@isscalar,{b,c,d,t10,t11,t17,t9}))
error(message(‘symbolic:sym:matlabFunction:ConditionsMustBeScalar’));
end
if (d ~= 0.0)
sS = t2;
elseif (t11 & (c ~= 0.0))
sS = t3;
elseif ((t10 & t11) & (b == 0.0))
sS = (t4+a.*y0)./a;
elseif (((t9 & t10) & t11) & (t17 == 0.0))
sS = t14.*(t6+t20);
elseif (((t9 & t10) & t11) & (0.0 < t17))
sS = -t14.*(a-sqrt(t7+t13+t16+t19));
elseif (((t9 & t10) & t11) & (t17 < 0.0))
sS = -t14.*(a+sqrt(t7+t13+t16+t19));
else
sS = NaN;
end
end
I did not understand the following warning messages:
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FiniteSetsRootNotSupported∦’root’ without index not supported. Using index ‘1’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘(t4 + a*y0)/a’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘t14*(t6 + t20)’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a – (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
Warning: symbolic:generate:FiniteSetsNotSupported∦Finite sets (‘DOM_SET’) not supported. Using element ‘-t14*(a + (t7 + t13 + t16 + t19)^(1/2))’ instead.∦
What exactly these messages are trying to say?
Moreover, the matlab code is far from optimal or effective code. The auxilliary variable txx are precomputed, but the same integral(@(u)f(u),x0,x) is computed three times?! matlabfunction, warnings MATLAB Answers — New Questions
Connecting Simulink with Carla Simulator through ROS2 toolbox
This is my block from Simulink. The issue is that the enabling autopilot block is working fine but it seems that ROS2 toolbox isn’t able to read data from the topics. In this case, I’m trying to read an image from one of the camera sensors that the Carla Simulator has. The read image block returns "errorCode =1" which means that the codification of the image isn’t correct. I’ve checked several times and the image codification is bgra8, so that’s the configuration that I have in the block and it still doesn’t work. Also, I’ve readed the data from rviz2 and it works fine. It shows all the sensor data and the images that are being recorded in real time
Anyone knows what could be causing this?This is my block from Simulink. The issue is that the enabling autopilot block is working fine but it seems that ROS2 toolbox isn’t able to read data from the topics. In this case, I’m trying to read an image from one of the camera sensors that the Carla Simulator has. The read image block returns "errorCode =1" which means that the codification of the image isn’t correct. I’ve checked several times and the image codification is bgra8, so that’s the configuration that I have in the block and it still doesn’t work. Also, I’ve readed the data from rviz2 and it works fine. It shows all the sensor data and the images that are being recorded in real time
Anyone knows what could be causing this? This is my block from Simulink. The issue is that the enabling autopilot block is working fine but it seems that ROS2 toolbox isn’t able to read data from the topics. In this case, I’m trying to read an image from one of the camera sensors that the Carla Simulator has. The read image block returns "errorCode =1" which means that the codification of the image isn’t correct. I’ve checked several times and the image codification is bgra8, so that’s the configuration that I have in the block and it still doesn’t work. Also, I’ve readed the data from rviz2 and it works fine. It shows all the sensor data and the images that are being recorded in real time
Anyone knows what could be causing this? ros2 MATLAB Answers — New Questions
water filling_cvx
I have this code in my matlab but it has an error as:
Incorrect number or types of inputs or outputs for function vec.
I would really appreciate it if you could help me to solve it.
I should emphasize that I installed cvx on my matla.
Np = 4;
Nsc= 4;
mu_l_n = [1.56247628361161e-06;
1.59519914659906e-06;
1.27498226759933e-06;
1.03143933197703e-05];
tilde_P1_tot = 1000;
sigma2_dBm = -104;
sigma2 = 10^(sigma2_dBm / 10 – 3);
cvx_begin quiet
variable p1_l_n(Np) % Power allocation vector, column vector
term = (mu_l_n.^2 .* p1_l_n) / sigma2; % Define term for clarity
maximize(sum(log(1 + term))) % Objective function to maximize sum rates
subject to
sum(p1_l_n) == tilde_P1_tot / Nsc; % Total power constraint across subcarriers
p1_l_n >= 0; % Power must be non-negative
cvx_end
% Display the optimal power allocation
disp(‘Optimal power allocation:’);
disp(p1_l_n);I have this code in my matlab but it has an error as:
Incorrect number or types of inputs or outputs for function vec.
I would really appreciate it if you could help me to solve it.
I should emphasize that I installed cvx on my matla.
Np = 4;
Nsc= 4;
mu_l_n = [1.56247628361161e-06;
1.59519914659906e-06;
1.27498226759933e-06;
1.03143933197703e-05];
tilde_P1_tot = 1000;
sigma2_dBm = -104;
sigma2 = 10^(sigma2_dBm / 10 – 3);
cvx_begin quiet
variable p1_l_n(Np) % Power allocation vector, column vector
term = (mu_l_n.^2 .* p1_l_n) / sigma2; % Define term for clarity
maximize(sum(log(1 + term))) % Objective function to maximize sum rates
subject to
sum(p1_l_n) == tilde_P1_tot / Nsc; % Total power constraint across subcarriers
p1_l_n >= 0; % Power must be non-negative
cvx_end
% Display the optimal power allocation
disp(‘Optimal power allocation:’);
disp(p1_l_n); I have this code in my matlab but it has an error as:
Incorrect number or types of inputs or outputs for function vec.
I would really appreciate it if you could help me to solve it.
I should emphasize that I installed cvx on my matla.
Np = 4;
Nsc= 4;
mu_l_n = [1.56247628361161e-06;
1.59519914659906e-06;
1.27498226759933e-06;
1.03143933197703e-05];
tilde_P1_tot = 1000;
sigma2_dBm = -104;
sigma2 = 10^(sigma2_dBm / 10 – 3);
cvx_begin quiet
variable p1_l_n(Np) % Power allocation vector, column vector
term = (mu_l_n.^2 .* p1_l_n) / sigma2; % Define term for clarity
maximize(sum(log(1 + term))) % Objective function to maximize sum rates
subject to
sum(p1_l_n) == tilde_P1_tot / Nsc; % Total power constraint across subcarriers
p1_l_n >= 0; % Power must be non-negative
cvx_end
% Display the optimal power allocation
disp(‘Optimal power allocation:’);
disp(p1_l_n); power_allocation, water_filling, optimization, cvx MATLAB Answers — New Questions
Can you please help to plot the following ODE ?
<</matlabcentral/answers/uploaded_files/1783230/IMG_0192.jpeg>><</matlabcentral/answers/uploaded_files/1783230/IMG_0192.jpeg>> <</matlabcentral/answers/uploaded_files/1783230/IMG_0192.jpeg>> help MATLAB Answers — New Questions
How to use a solver function to solve matrix?
So I have an equation that goes something like N.*P + S.*P + E.*P + W.*P = Q
N S E and W are coefficients, P is pressure changing with time. In terms of [A]*[x]=[b] its supposedly [coefficients]*[Pressure]=[Q]. How would I use a solver to translate the equation into these matrix terms?So I have an equation that goes something like N.*P + S.*P + E.*P + W.*P = Q
N S E and W are coefficients, P is pressure changing with time. In terms of [A]*[x]=[b] its supposedly [coefficients]*[Pressure]=[Q]. How would I use a solver to translate the equation into these matrix terms? So I have an equation that goes something like N.*P + S.*P + E.*P + W.*P = Q
N S E and W are coefficients, P is pressure changing with time. In terms of [A]*[x]=[b] its supposedly [coefficients]*[Pressure]=[Q]. How would I use a solver to translate the equation into these matrix terms? gmres, solver MATLAB Answers — New Questions
Error using mex No supported compiler was found. MATLAB2018b Windows10
Hi all,
I am trying to use compiler using mex code,
so I installed following
・Microsoft Visual C++ 2015-2019 x64 Redistributable
・Windows 10 SDK
and I got following error
>> mex -v -setup
Verbose mode is on.
… Looking for compiler ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER15’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER16’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER17’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2017 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER17’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2017 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER18’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2017 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER18’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2017 (C)’.
… Looking for compiler ‘MinGW64 Compiler (C)’ …
… Looking for environment variable ‘MW_MINGW64_LOC’ …No.
Did not find installed compiler ‘MinGW64 Compiler (C)’.
… Looking for compiler ‘Microsoft Visual C++ 2013 (C)’ …
… Looking for registry setting ‘HKLMSOFTWAREMicrosoftVisualStudioSxSVS7’ 12.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREMicrosoftVisualStudioSxSVS7’ 12.0 …No.
… Looking for registry setting ‘HKLMSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 12.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 12.0 …No.
Did not find installed compiler ‘Microsoft Visual C++ 2013 (C)’.
… Looking for compiler ‘Microsoft Visual C++ 2015 (C)’ …
… Looking for registry setting ‘HKLMSOFTWAREMicrosoftVisualStudioSxSVC7’ 14.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREMicrosoftVisualStudioSxSVC7’ 14.0 …No.
… Looking for registry setting ‘HKLMSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVC7’ 14.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVC7’ 14.0 …No.
Did not find installed compiler ‘Microsoft Visual C++ 2015 (C)’.
… Looking for compiler ‘Microsoft Visual C++ 2017 (C)’ …
… Looking for registry setting ‘HKLMSOFTWAREMicrosoftVisualStudioSxSVS7’ 15.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREMicrosoftVisualStudioSxSVS7’ 15.0 …No.
… Looking for registry setting ‘HKLMSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 15.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 15.0 …No.
Did not find installed compiler ‘Microsoft Visual C++ 2017 (C)’.
Error using mex
No supported compiler was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64 Compiler. For more options, visit
https://www.mathworks.com/support/compilers.
>> mbuild -setup -v
‘mbuild’ requires MATLAB Compiler SDK.
I installed windows 10 SDK first and then installed Microsoft Visual C++ 2015-2019 x64 Redistributable
what am I missing?Hi all,
I am trying to use compiler using mex code,
so I installed following
・Microsoft Visual C++ 2015-2019 x64 Redistributable
・Windows 10 SDK
and I got following error
>> mex -v -setup
Verbose mode is on.
… Looking for compiler ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER15’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER16’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER17’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2017 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER17’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2017 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER18’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2017 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER18’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2017 (C)’.
… Looking for compiler ‘MinGW64 Compiler (C)’ …
… Looking for environment variable ‘MW_MINGW64_LOC’ …No.
Did not find installed compiler ‘MinGW64 Compiler (C)’.
… Looking for compiler ‘Microsoft Visual C++ 2013 (C)’ …
… Looking for registry setting ‘HKLMSOFTWAREMicrosoftVisualStudioSxSVS7’ 12.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREMicrosoftVisualStudioSxSVS7’ 12.0 …No.
… Looking for registry setting ‘HKLMSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 12.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 12.0 …No.
Did not find installed compiler ‘Microsoft Visual C++ 2013 (C)’.
… Looking for compiler ‘Microsoft Visual C++ 2015 (C)’ …
… Looking for registry setting ‘HKLMSOFTWAREMicrosoftVisualStudioSxSVC7’ 14.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREMicrosoftVisualStudioSxSVC7’ 14.0 …No.
… Looking for registry setting ‘HKLMSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVC7’ 14.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVC7’ 14.0 …No.
Did not find installed compiler ‘Microsoft Visual C++ 2015 (C)’.
… Looking for compiler ‘Microsoft Visual C++ 2017 (C)’ …
… Looking for registry setting ‘HKLMSOFTWAREMicrosoftVisualStudioSxSVS7’ 15.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREMicrosoftVisualStudioSxSVS7’ 15.0 …No.
… Looking for registry setting ‘HKLMSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 15.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 15.0 …No.
Did not find installed compiler ‘Microsoft Visual C++ 2017 (C)’.
Error using mex
No supported compiler was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64 Compiler. For more options, visit
https://www.mathworks.com/support/compilers.
>> mbuild -setup -v
‘mbuild’ requires MATLAB Compiler SDK.
I installed windows 10 SDK first and then installed Microsoft Visual C++ 2015-2019 x64 Redistributable
what am I missing? Hi all,
I am trying to use compiler using mex code,
so I installed following
・Microsoft Visual C++ 2015-2019 x64 Redistributable
・Windows 10 SDK
and I got following error
>> mex -v -setup
Verbose mode is on.
… Looking for compiler ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER15’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2015 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER16’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2016 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER17’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2017 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER17’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2017 with Microsoft Visual Studio 2017 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2015 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER18’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2015 (C)’.
… Looking for compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2017 (C)’ …
… Looking for environment variable ‘ICPP_COMPILER18’ …No.
Did not find installed compiler ‘Intel Parallel Studio XE 2018 with Microsoft Visual Studio 2017 (C)’.
… Looking for compiler ‘MinGW64 Compiler (C)’ …
… Looking for environment variable ‘MW_MINGW64_LOC’ …No.
Did not find installed compiler ‘MinGW64 Compiler (C)’.
… Looking for compiler ‘Microsoft Visual C++ 2013 (C)’ …
… Looking for registry setting ‘HKLMSOFTWAREMicrosoftVisualStudioSxSVS7’ 12.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREMicrosoftVisualStudioSxSVS7’ 12.0 …No.
… Looking for registry setting ‘HKLMSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 12.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 12.0 …No.
Did not find installed compiler ‘Microsoft Visual C++ 2013 (C)’.
… Looking for compiler ‘Microsoft Visual C++ 2015 (C)’ …
… Looking for registry setting ‘HKLMSOFTWAREMicrosoftVisualStudioSxSVC7’ 14.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREMicrosoftVisualStudioSxSVC7’ 14.0 …No.
… Looking for registry setting ‘HKLMSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVC7’ 14.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVC7’ 14.0 …No.
Did not find installed compiler ‘Microsoft Visual C++ 2015 (C)’.
… Looking for compiler ‘Microsoft Visual C++ 2017 (C)’ …
… Looking for registry setting ‘HKLMSOFTWAREMicrosoftVisualStudioSxSVS7’ 15.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREMicrosoftVisualStudioSxSVS7’ 15.0 …No.
… Looking for registry setting ‘HKLMSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 15.0 …No.
… Looking for registry setting ‘HKCUSOFTWAREWow6432NodeMicrosoftVisualStudioSxSVS7’ 15.0 …No.
Did not find installed compiler ‘Microsoft Visual C++ 2017 (C)’.
Error using mex
No supported compiler was found. You can install the freely available MinGW-w64 C/C++ compiler; see Install MinGW-w64 Compiler. For more options, visit
https://www.mathworks.com/support/compilers.
>> mbuild -setup -v
‘mbuild’ requires MATLAB Compiler SDK.
I installed windows 10 SDK first and then installed Microsoft Visual C++ 2015-2019 x64 Redistributable
what am I missing? mex, compiler, sdk, windows10 sdk MATLAB Answers — New Questions