Tag Archives: matlab
Live script: Error Loading
Hi
I have created a matlab livescript file, and saved it as .mlx . When i now try to open the file i get the error:
Error Loading "path to file"
I have tried opening it in a text editor, but it is just empty, though the file is 219 kb.
What can I do?Hi
I have created a matlab livescript file, and saved it as .mlx . When i now try to open the file i get the error:
Error Loading "path to file"
I have tried opening it in a text editor, but it is just empty, though the file is 219 kb.
What can I do? Hi
I have created a matlab livescript file, and saved it as .mlx . When i now try to open the file i get the error:
Error Loading "path to file"
I have tried opening it in a text editor, but it is just empty, though the file is 219 kb.
What can I do? error, live script MATLAB Answers — New Questions
How to modify my MATLAB code to train a neural network with images from different directions?
I am working on a project to estimate the weight of pears using their RGB and Depth images in MATLAB. Initially, I used only front-facing images for training, but now I want to improve the accuracy by including images taken from approximately 90 degrees to the left or right of the pear, in addition to the Depth images.
I tried modifying the code to accommodate these new images, but I’m facing some issues.
I would like to change the following points.
・The pear image uses the front, an image moved approximately 90 degrees to the left or right from the front, and a Depth image.
・I want to put all my data in a datastore.
Currently, the code listed is the code that I have modified, but in this state an error occurs and it is impossible to predict.Please lend me your strength.
cd ‘RGB front file path’
folder_name = pwd;
XImageTrainFront = imageDatastore(folder_name);
cd ‘RGB side file path’
folder_name = pwd;
XImageTrainSide = imageDatastore(folder_name);
cd ‘Depth file path’
folder_name = pwd;
XDispTrain = imageDatastore(folder_name);
YTrain = [ data ]; % weight labels
YTrain = arrayDatastore(YTrain);
% Combine datasets
ds = combine(XImageTrainFront, XImageTrainSide, XDispTrain, YTrain);
dsrand = shuffle(ds);
dsVali = partition(dsrand, 10, 1);
dsTest = partition(dsrand, 10, 2);
ds1=partition(dsrand,10,3);
ds2=partition(dsrand,10,4);
ds3=partition(dsrand,10,5);
ds4=partition(dsrand,10,6);
ds5=partition(dsrand,10,7);
ds6=partition(dsrand,10,8);
ds7=partition(dsrand,10,9);
ds8=partition(dsrand,10,10);
dsTrain=combine(ds1,ds2,ds3,ds4,ds5,ds6,ds7,ds8,ReadOrder="sequential");
YTest = readall(dsTest);
YTest = YTest(:,4);
YTest = cell2mat(YTest);
cd ‘path to googlenet300400_multiple.mat’
load googlenet300400_multiple.mat
miniBatchSize = 16;
options = trainingOptions(‘sgdm’, …
‘MiniBatchSize’, miniBatchSize, …
‘MaxEpochs’, 300, …
‘InitialLearnRate’, 1e-7, …
‘LearnRateSchedule’, ‘piecewise’, …
‘LearnRateDropFactor’, 0.1, …
‘LearnRateDropPeriod’, 30, …
‘Shuffle’, ‘every-epoch’, …
‘ValidationData’, dsVali, …
‘ValidationFrequency’, 50, …
‘Plots’, ‘training-progress’, …
‘Verbose’, true);
net = trainNetwork(dsTrain, lgraph_2, options);
YPredicted = predict(net, dsTest);
predictionError = YTest – YPredicted;
squares = predictionError.^2;
rmse = sqrt(mean(squares));
figure
scatter(YPredicted, YTest, ‘+’);
xlabel("Predicted Value");
ylabel("True Value");
hold on;
plot([100 550], [100 550], ‘r–‘);
Error message that occurred during modification.
Please respond to the following error. Error using: trainNetwork (line 191)
Invalid training data. The output size of the last layer ([1 1 1]) is the response size ([1 1 360000])
does not match.
Error: newcord2 (line 93)
net = trainNetwork(dsTrain, lgraph_2, options);
Error using: nnet.cnn.LayerGraph/replaceLayer (line 300)
Layer ‘finalLayerName’ does not exist.
Error: newcord2 (line 85)
lgraph_2 = replaceLayer(lgraph_2, ‘finalLayerName’, finalLayer);I am working on a project to estimate the weight of pears using their RGB and Depth images in MATLAB. Initially, I used only front-facing images for training, but now I want to improve the accuracy by including images taken from approximately 90 degrees to the left or right of the pear, in addition to the Depth images.
I tried modifying the code to accommodate these new images, but I’m facing some issues.
I would like to change the following points.
・The pear image uses the front, an image moved approximately 90 degrees to the left or right from the front, and a Depth image.
・I want to put all my data in a datastore.
Currently, the code listed is the code that I have modified, but in this state an error occurs and it is impossible to predict.Please lend me your strength.
cd ‘RGB front file path’
folder_name = pwd;
XImageTrainFront = imageDatastore(folder_name);
cd ‘RGB side file path’
folder_name = pwd;
XImageTrainSide = imageDatastore(folder_name);
cd ‘Depth file path’
folder_name = pwd;
XDispTrain = imageDatastore(folder_name);
YTrain = [ data ]; % weight labels
YTrain = arrayDatastore(YTrain);
% Combine datasets
ds = combine(XImageTrainFront, XImageTrainSide, XDispTrain, YTrain);
dsrand = shuffle(ds);
dsVali = partition(dsrand, 10, 1);
dsTest = partition(dsrand, 10, 2);
ds1=partition(dsrand,10,3);
ds2=partition(dsrand,10,4);
ds3=partition(dsrand,10,5);
ds4=partition(dsrand,10,6);
ds5=partition(dsrand,10,7);
ds6=partition(dsrand,10,8);
ds7=partition(dsrand,10,9);
ds8=partition(dsrand,10,10);
dsTrain=combine(ds1,ds2,ds3,ds4,ds5,ds6,ds7,ds8,ReadOrder="sequential");
YTest = readall(dsTest);
YTest = YTest(:,4);
YTest = cell2mat(YTest);
cd ‘path to googlenet300400_multiple.mat’
load googlenet300400_multiple.mat
miniBatchSize = 16;
options = trainingOptions(‘sgdm’, …
‘MiniBatchSize’, miniBatchSize, …
‘MaxEpochs’, 300, …
‘InitialLearnRate’, 1e-7, …
‘LearnRateSchedule’, ‘piecewise’, …
‘LearnRateDropFactor’, 0.1, …
‘LearnRateDropPeriod’, 30, …
‘Shuffle’, ‘every-epoch’, …
‘ValidationData’, dsVali, …
‘ValidationFrequency’, 50, …
‘Plots’, ‘training-progress’, …
‘Verbose’, true);
net = trainNetwork(dsTrain, lgraph_2, options);
YPredicted = predict(net, dsTest);
predictionError = YTest – YPredicted;
squares = predictionError.^2;
rmse = sqrt(mean(squares));
figure
scatter(YPredicted, YTest, ‘+’);
xlabel("Predicted Value");
ylabel("True Value");
hold on;
plot([100 550], [100 550], ‘r–‘);
Error message that occurred during modification.
Please respond to the following error. Error using: trainNetwork (line 191)
Invalid training data. The output size of the last layer ([1 1 1]) is the response size ([1 1 360000])
does not match.
Error: newcord2 (line 93)
net = trainNetwork(dsTrain, lgraph_2, options);
Error using: nnet.cnn.LayerGraph/replaceLayer (line 300)
Layer ‘finalLayerName’ does not exist.
Error: newcord2 (line 85)
lgraph_2 = replaceLayer(lgraph_2, ‘finalLayerName’, finalLayer); I am working on a project to estimate the weight of pears using their RGB and Depth images in MATLAB. Initially, I used only front-facing images for training, but now I want to improve the accuracy by including images taken from approximately 90 degrees to the left or right of the pear, in addition to the Depth images.
I tried modifying the code to accommodate these new images, but I’m facing some issues.
I would like to change the following points.
・The pear image uses the front, an image moved approximately 90 degrees to the left or right from the front, and a Depth image.
・I want to put all my data in a datastore.
Currently, the code listed is the code that I have modified, but in this state an error occurs and it is impossible to predict.Please lend me your strength.
cd ‘RGB front file path’
folder_name = pwd;
XImageTrainFront = imageDatastore(folder_name);
cd ‘RGB side file path’
folder_name = pwd;
XImageTrainSide = imageDatastore(folder_name);
cd ‘Depth file path’
folder_name = pwd;
XDispTrain = imageDatastore(folder_name);
YTrain = [ data ]; % weight labels
YTrain = arrayDatastore(YTrain);
% Combine datasets
ds = combine(XImageTrainFront, XImageTrainSide, XDispTrain, YTrain);
dsrand = shuffle(ds);
dsVali = partition(dsrand, 10, 1);
dsTest = partition(dsrand, 10, 2);
ds1=partition(dsrand,10,3);
ds2=partition(dsrand,10,4);
ds3=partition(dsrand,10,5);
ds4=partition(dsrand,10,6);
ds5=partition(dsrand,10,7);
ds6=partition(dsrand,10,8);
ds7=partition(dsrand,10,9);
ds8=partition(dsrand,10,10);
dsTrain=combine(ds1,ds2,ds3,ds4,ds5,ds6,ds7,ds8,ReadOrder="sequential");
YTest = readall(dsTest);
YTest = YTest(:,4);
YTest = cell2mat(YTest);
cd ‘path to googlenet300400_multiple.mat’
load googlenet300400_multiple.mat
miniBatchSize = 16;
options = trainingOptions(‘sgdm’, …
‘MiniBatchSize’, miniBatchSize, …
‘MaxEpochs’, 300, …
‘InitialLearnRate’, 1e-7, …
‘LearnRateSchedule’, ‘piecewise’, …
‘LearnRateDropFactor’, 0.1, …
‘LearnRateDropPeriod’, 30, …
‘Shuffle’, ‘every-epoch’, …
‘ValidationData’, dsVali, …
‘ValidationFrequency’, 50, …
‘Plots’, ‘training-progress’, …
‘Verbose’, true);
net = trainNetwork(dsTrain, lgraph_2, options);
YPredicted = predict(net, dsTest);
predictionError = YTest – YPredicted;
squares = predictionError.^2;
rmse = sqrt(mean(squares));
figure
scatter(YPredicted, YTest, ‘+’);
xlabel("Predicted Value");
ylabel("True Value");
hold on;
plot([100 550], [100 550], ‘r–‘);
Error message that occurred during modification.
Please respond to the following error. Error using: trainNetwork (line 191)
Invalid training data. The output size of the last layer ([1 1 1]) is the response size ([1 1 360000])
does not match.
Error: newcord2 (line 93)
net = trainNetwork(dsTrain, lgraph_2, options);
Error using: nnet.cnn.LayerGraph/replaceLayer (line 300)
Layer ‘finalLayerName’ does not exist.
Error: newcord2 (line 85)
lgraph_2 = replaceLayer(lgraph_2, ‘finalLayerName’, finalLayer); prediction, multi-input network, 予測, 多入力ネットワーク MATLAB Answers — New Questions
Trouble with for loop to determine the discrete wavelet transform (DWT)
Hi, I need assistance plotting the approximation (A) and detail (D) coefficients separately for all sheets in an Excel file over a given time frame. Currently, the existing code generates the transform only for the final sheet (Sheet 8). I am uncertain how to modify the code to plot A1 and D1 separately for all sheets. I would be grateful for any guidance you may provide. Thank you for your time and help.
clc
close all
clear all
filename = ‘s.xlsx’;
% Get the sheet names
[~, sheetNames] = xlsfinfo(filename);
for i = 1:numel(sheetNames)
% Read the data from the sheet
data = xlsread(filename, i);
% Extract the time and signal columns
t(:,i) = data(:, 1);
sig (:,i) = data(:, 2);
N = length(sig);
dt = t(3) – t(2); % sampling time
fs = 1/dt; % freq
signal = sig (:,i);
wname = ‘bior6.8’;
% Discrete Wavelet, DWT
[CA1,CD1] = dwt(signal,wname);
A1 = idwt(CA1,[],wname,N);
D1 = idwt([],CD1,wname,N);
t (:,i) = linspace(0,N,N)*(1/fs);
subplot(1,2,1);
plot (t,A1,’k’,’LineWidth’,1.5);
title(sprintf(‘Approximation for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
subplot(1,2,2);
plot (t,D1,’k’,’LineWidth’,1.5);
title(sprintf(‘Detail for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
endHi, I need assistance plotting the approximation (A) and detail (D) coefficients separately for all sheets in an Excel file over a given time frame. Currently, the existing code generates the transform only for the final sheet (Sheet 8). I am uncertain how to modify the code to plot A1 and D1 separately for all sheets. I would be grateful for any guidance you may provide. Thank you for your time and help.
clc
close all
clear all
filename = ‘s.xlsx’;
% Get the sheet names
[~, sheetNames] = xlsfinfo(filename);
for i = 1:numel(sheetNames)
% Read the data from the sheet
data = xlsread(filename, i);
% Extract the time and signal columns
t(:,i) = data(:, 1);
sig (:,i) = data(:, 2);
N = length(sig);
dt = t(3) – t(2); % sampling time
fs = 1/dt; % freq
signal = sig (:,i);
wname = ‘bior6.8’;
% Discrete Wavelet, DWT
[CA1,CD1] = dwt(signal,wname);
A1 = idwt(CA1,[],wname,N);
D1 = idwt([],CD1,wname,N);
t (:,i) = linspace(0,N,N)*(1/fs);
subplot(1,2,1);
plot (t,A1,’k’,’LineWidth’,1.5);
title(sprintf(‘Approximation for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
subplot(1,2,2);
plot (t,D1,’k’,’LineWidth’,1.5);
title(sprintf(‘Detail for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
end Hi, I need assistance plotting the approximation (A) and detail (D) coefficients separately for all sheets in an Excel file over a given time frame. Currently, the existing code generates the transform only for the final sheet (Sheet 8). I am uncertain how to modify the code to plot A1 and D1 separately for all sheets. I would be grateful for any guidance you may provide. Thank you for your time and help.
clc
close all
clear all
filename = ‘s.xlsx’;
% Get the sheet names
[~, sheetNames] = xlsfinfo(filename);
for i = 1:numel(sheetNames)
% Read the data from the sheet
data = xlsread(filename, i);
% Extract the time and signal columns
t(:,i) = data(:, 1);
sig (:,i) = data(:, 2);
N = length(sig);
dt = t(3) – t(2); % sampling time
fs = 1/dt; % freq
signal = sig (:,i);
wname = ‘bior6.8’;
% Discrete Wavelet, DWT
[CA1,CD1] = dwt(signal,wname);
A1 = idwt(CA1,[],wname,N);
D1 = idwt([],CD1,wname,N);
t (:,i) = linspace(0,N,N)*(1/fs);
subplot(1,2,1);
plot (t,A1,’k’,’LineWidth’,1.5);
title(sprintf(‘Approximation for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
subplot(1,2,2);
plot (t,D1,’k’,’LineWidth’,1.5);
title(sprintf(‘Detail for sheet%d’, i));
set(gca,’fontname’,’Times New Roman’,’FontSize’,10)
xlabel(‘Time (secs)’)
ylabel(‘Amplitude’)
grid on
end dwt, plot, for loop MATLAB Answers — New Questions
Set up a native connection from Matlab to MySQL with SSL
I’m trying to use the native mysql interface to connect to a MySql 8.0.37 database on Azure. This database was previously deployed to a test server which didn’t require SSL and I was able to connect to it without issue. I’m also able to connect to the new Azure MySql database using DBeaver and the MySql Workbench from the same client computer, but I get the following error when I try to connect with Matlab’s mysql connector:
Error using mysql (line 49)
Connections using insecure transport are prohibited while –require_secure_transport=ON..
My connection code is as follows (where aosDbSettings is a struct containing the connection details):
conn = mysql( …
aosDbSettings.UserName, aosDbSettings.UserPassword, …
‘Server’, aosDbSettings.Server, …
‘DatabaseName’, aosDbSettings.DatabaseName, …
‘PortNumber’, aosDbSettings.PortNumber …
);
Having reviewed the documentation for the Native MySql Interface (specifically the mysql function), I don’t see any options related to SSL. Are there any undocumented options available to make this work? I find it surprising that there’s no mention of security options in the documentation. Am I missing something?I’m trying to use the native mysql interface to connect to a MySql 8.0.37 database on Azure. This database was previously deployed to a test server which didn’t require SSL and I was able to connect to it without issue. I’m also able to connect to the new Azure MySql database using DBeaver and the MySql Workbench from the same client computer, but I get the following error when I try to connect with Matlab’s mysql connector:
Error using mysql (line 49)
Connections using insecure transport are prohibited while –require_secure_transport=ON..
My connection code is as follows (where aosDbSettings is a struct containing the connection details):
conn = mysql( …
aosDbSettings.UserName, aosDbSettings.UserPassword, …
‘Server’, aosDbSettings.Server, …
‘DatabaseName’, aosDbSettings.DatabaseName, …
‘PortNumber’, aosDbSettings.PortNumber …
);
Having reviewed the documentation for the Native MySql Interface (specifically the mysql function), I don’t see any options related to SSL. Are there any undocumented options available to make this work? I find it surprising that there’s no mention of security options in the documentation. Am I missing something? I’m trying to use the native mysql interface to connect to a MySql 8.0.37 database on Azure. This database was previously deployed to a test server which didn’t require SSL and I was able to connect to it without issue. I’m also able to connect to the new Azure MySql database using DBeaver and the MySql Workbench from the same client computer, but I get the following error when I try to connect with Matlab’s mysql connector:
Error using mysql (line 49)
Connections using insecure transport are prohibited while –require_secure_transport=ON..
My connection code is as follows (where aosDbSettings is a struct containing the connection details):
conn = mysql( …
aosDbSettings.UserName, aosDbSettings.UserPassword, …
‘Server’, aosDbSettings.Server, …
‘DatabaseName’, aosDbSettings.DatabaseName, …
‘PortNumber’, aosDbSettings.PortNumber …
);
Having reviewed the documentation for the Native MySql Interface (specifically the mysql function), I don’t see any options related to SSL. Are there any undocumented options available to make this work? I find it surprising that there’s no mention of security options in the documentation. Am I missing something? mysql, ssl, database toolbox MATLAB Answers — New Questions
How to Curve the Lane
I want to show the straight and curved lanes on the roadrunner.
Is there a way to turn a straight lane into a curved lane?
Or is there a document or link to refer to?I want to show the straight and curved lanes on the roadrunner.
Is there a way to turn a straight lane into a curved lane?
Or is there a document or link to refer to? I want to show the straight and curved lanes on the roadrunner.
Is there a way to turn a straight lane into a curved lane?
Or is there a document or link to refer to? curve, roadrunner MATLAB Answers — New Questions
Failed to load a mesh from gptoolbox. I am missing something, what is it?
% 1. Load a Mesh
[V, F] = readOFF(‘D:Conferences and WorkshopsSG SummerMFC – Scodesgptoolbox-mastergptoolbox-mastermesh.off’);
% 2. Display the Mesh
figure;
trisurf(F, V(:,1), V(:,2), V(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘Original Mesh’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% Define the number of iterations and timestep for smoothing
num_iterations = 100;
time_step = 0.01;
% 3. Mean Curvature Flow (MCF) – Explicit Method
V_explicit = V; % Copy the vertices for the explicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator and mean curvature normal
L = cotmatrix(V_explicit, F);
HN = -L * V_explicit;
% Update vertex positions
V_explicit = V_explicit + time_step * HN;
end
% Display the smoothed mesh – Explicit Method
figure;
trisurf(F, V_explicit(:,1), V_explicit(:,2), V_explicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Explicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% 3. Mean Curvature Flow (MCF) – Semi-Implicit Method
V_implicit = V; % Copy the vertices for the implicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator
L = cotmatrix(V_implicit, F);
% Solve (I – time_step * L) * V_new = V_old
V_implicit = (speye(size(V_implicit, 1)) – time_step * L) V_implicit;
end
% Display the smoothed mesh – Semi-Implicit Method
figure;
trisurf(F, V_implicit(:,1), V_implicit(:,2), V_implicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Semi-Implicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
here is the link to loadmesh function: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/load_mesh.m
and the readOFF: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/readOFF.m% 1. Load a Mesh
[V, F] = readOFF(‘D:Conferences and WorkshopsSG SummerMFC – Scodesgptoolbox-mastergptoolbox-mastermesh.off’);
% 2. Display the Mesh
figure;
trisurf(F, V(:,1), V(:,2), V(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘Original Mesh’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% Define the number of iterations and timestep for smoothing
num_iterations = 100;
time_step = 0.01;
% 3. Mean Curvature Flow (MCF) – Explicit Method
V_explicit = V; % Copy the vertices for the explicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator and mean curvature normal
L = cotmatrix(V_explicit, F);
HN = -L * V_explicit;
% Update vertex positions
V_explicit = V_explicit + time_step * HN;
end
% Display the smoothed mesh – Explicit Method
figure;
trisurf(F, V_explicit(:,1), V_explicit(:,2), V_explicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Explicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% 3. Mean Curvature Flow (MCF) – Semi-Implicit Method
V_implicit = V; % Copy the vertices for the implicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator
L = cotmatrix(V_implicit, F);
% Solve (I – time_step * L) * V_new = V_old
V_implicit = (speye(size(V_implicit, 1)) – time_step * L) V_implicit;
end
% Display the smoothed mesh – Semi-Implicit Method
figure;
trisurf(F, V_implicit(:,1), V_implicit(:,2), V_implicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Semi-Implicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
here is the link to loadmesh function: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/load_mesh.m
and the readOFF: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/readOFF.m % 1. Load a Mesh
[V, F] = readOFF(‘D:Conferences and WorkshopsSG SummerMFC – Scodesgptoolbox-mastergptoolbox-mastermesh.off’);
% 2. Display the Mesh
figure;
trisurf(F, V(:,1), V(:,2), V(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘Original Mesh’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% Define the number of iterations and timestep for smoothing
num_iterations = 100;
time_step = 0.01;
% 3. Mean Curvature Flow (MCF) – Explicit Method
V_explicit = V; % Copy the vertices for the explicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator and mean curvature normal
L = cotmatrix(V_explicit, F);
HN = -L * V_explicit;
% Update vertex positions
V_explicit = V_explicit + time_step * HN;
end
% Display the smoothed mesh – Explicit Method
figure;
trisurf(F, V_explicit(:,1), V_explicit(:,2), V_explicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Explicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
% 3. Mean Curvature Flow (MCF) – Semi-Implicit Method
V_implicit = V; % Copy the vertices for the implicit method
for iter = 1:num_iterations
% Compute the Laplace-Beltrami operator
L = cotmatrix(V_implicit, F);
% Solve (I – time_step * L) * V_new = V_old
V_implicit = (speye(size(V_implicit, 1)) – time_step * L) V_implicit;
end
% Display the smoothed mesh – Semi-Implicit Method
figure;
trisurf(F, V_implicit(:,1), V_implicit(:,2), V_implicit(:,3), ‘FaceColor’, ‘cyan’, ‘EdgeColor’, ‘none’);
axis equal;
lighting gouraud;
camlight;
title(‘MCF – Semi-Implicit Method’);
xlabel(‘X’);
ylabel(‘Y’);
zlabel(‘Z’);
here is the link to loadmesh function: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/load_mesh.m
and the readOFF: https://github.com/geometry-processing/gptoolbox/blob/master/mesh/readOFF.m gpu, gp, image processing, mesh MATLAB Answers — New Questions
Can’t connect branch with block in simulink
Hello.
I made a circuit for superposition theorem in simulink with dc voltage source and the measured current is connected to the scope as an output so i can see the value.My next task is to simulate the work of this circuit. When i try to drag & connect the branch with the input of the current measurement block then it is showing red dashed line which means that i cannot connect it to my circuit.
Please someone help me solve this problem, it is a bit urgent.
Thank you!Hello.
I made a circuit for superposition theorem in simulink with dc voltage source and the measured current is connected to the scope as an output so i can see the value.My next task is to simulate the work of this circuit. When i try to drag & connect the branch with the input of the current measurement block then it is showing red dashed line which means that i cannot connect it to my circuit.
Please someone help me solve this problem, it is a bit urgent.
Thank you! Hello.
I made a circuit for superposition theorem in simulink with dc voltage source and the measured current is connected to the scope as an output so i can see the value.My next task is to simulate the work of this circuit. When i try to drag & connect the branch with the input of the current measurement block then it is showing red dashed line which means that i cannot connect it to my circuit.
Please someone help me solve this problem, it is a bit urgent.
Thank you! superposition theorem, block connection MATLAB Answers — New Questions
Criteria for the final SINR, CQI computation in 5G NR CSI Reporting
In 5G toolbox, specifically NR Downlink CSI Reporting Example, SINR is being calculated for all layers. I have a question, for a two-layer scenario, if SINR values vary considerably, what should be the criteria for the final SINR, CQI computation? The lowest SINR, the mean or something between? In other words, which one of these criteria should we choose, as each comes with pros and cons.
Go with lowest SINR.
Go with higher SINR and rank1.
Go between lower SINR and average SINR.
ThanksIn 5G toolbox, specifically NR Downlink CSI Reporting Example, SINR is being calculated for all layers. I have a question, for a two-layer scenario, if SINR values vary considerably, what should be the criteria for the final SINR, CQI computation? The lowest SINR, the mean or something between? In other words, which one of these criteria should we choose, as each comes with pros and cons.
Go with lowest SINR.
Go with higher SINR and rank1.
Go between lower SINR and average SINR.
Thanks In 5G toolbox, specifically NR Downlink CSI Reporting Example, SINR is being calculated for all layers. I have a question, for a two-layer scenario, if SINR values vary considerably, what should be the criteria for the final SINR, CQI computation? The lowest SINR, the mean or something between? In other words, which one of these criteria should we choose, as each comes with pros and cons.
Go with lowest SINR.
Go with higher SINR and rank1.
Go between lower SINR and average SINR.
Thanks csirs, 5g, nr, sinr MATLAB Answers — New Questions
Finding the “center” of an extended ring
I have been experimenting with the image processing toolbox’s function "imfindcircles", and it works well. However, there is one issue: I have an extended big ring in the image where I want to recognise its "center" instead of the outer end of the ring (see attached figure, where the outer end is plotted with viscircles and the center and radius found by imfindcircles).
This is also mirrored in the data itself: both the inner and outer end of the big ring have a lower intensity than its center. Is there a way to force "imfindcircles" to use the ring of maximum intensity? (Note that I have applied a thresholding to my image, otherwise the gradient at the ring ends would not be as harsh, and imfindcircles would struggle to differentiate between the ring and artifacts neighbouring the ring.)
Or is there maybe an alternative that includes a second step? After all, the circle center is properly recognised, so I can maybe vary the radius slightly? Maybe I could add up all the values of pixels that would lie on the circle, and see where that reaches its maximum. Is there an easy way to do something like that?
openfig findcircle-test.figI have been experimenting with the image processing toolbox’s function "imfindcircles", and it works well. However, there is one issue: I have an extended big ring in the image where I want to recognise its "center" instead of the outer end of the ring (see attached figure, where the outer end is plotted with viscircles and the center and radius found by imfindcircles).
This is also mirrored in the data itself: both the inner and outer end of the big ring have a lower intensity than its center. Is there a way to force "imfindcircles" to use the ring of maximum intensity? (Note that I have applied a thresholding to my image, otherwise the gradient at the ring ends would not be as harsh, and imfindcircles would struggle to differentiate between the ring and artifacts neighbouring the ring.)
Or is there maybe an alternative that includes a second step? After all, the circle center is properly recognised, so I can maybe vary the radius slightly? Maybe I could add up all the values of pixels that would lie on the circle, and see where that reaches its maximum. Is there an easy way to do something like that?
openfig findcircle-test.fig I have been experimenting with the image processing toolbox’s function "imfindcircles", and it works well. However, there is one issue: I have an extended big ring in the image where I want to recognise its "center" instead of the outer end of the ring (see attached figure, where the outer end is plotted with viscircles and the center and radius found by imfindcircles).
This is also mirrored in the data itself: both the inner and outer end of the big ring have a lower intensity than its center. Is there a way to force "imfindcircles" to use the ring of maximum intensity? (Note that I have applied a thresholding to my image, otherwise the gradient at the ring ends would not be as harsh, and imfindcircles would struggle to differentiate between the ring and artifacts neighbouring the ring.)
Or is there maybe an alternative that includes a second step? After all, the circle center is properly recognised, so I can maybe vary the radius slightly? Maybe I could add up all the values of pixels that would lie on the circle, and see where that reaches its maximum. Is there an easy way to do something like that?
openfig findcircle-test.fig image segmentation MATLAB Answers — New Questions
Finding multiple Matrix in a txt file
I want to do radiobiological calculations for structures in a patient with two different plans. I have a txt file with all the data in it. The txt file contains among other things the biological structure (which exists in both plans), the biological data in two columns and two rows that specifies what plan and what structure it is.
I know how to code the math to do the calculations, but how do I most easy read the text file and store each plans column in like a matrix?
For example (in my own dumb coding brain) I would like matlab to "Search a txt file that has a certain name that the user can specify. For a specific organ like the bladder, put the data in a variable called something like "Bladder Plan 1" and "Bladder Plan 2". Do math. Do same for all other organs. Put result in a report. Save as pdf or file". I hope that the wonderful Matlab community can help me, since I am no Matrix wizard with coding.
For all patients the structures all have the same naming convention, so I guess I could specify somewhere/somehow what organs should be searched for in the text file and what I would like the variable to be called, so that the search in the text file could go quick.
If anyone has any tips and suggestions that would be great. I have attached an anonymized txt file of how it could look like.I want to do radiobiological calculations for structures in a patient with two different plans. I have a txt file with all the data in it. The txt file contains among other things the biological structure (which exists in both plans), the biological data in two columns and two rows that specifies what plan and what structure it is.
I know how to code the math to do the calculations, but how do I most easy read the text file and store each plans column in like a matrix?
For example (in my own dumb coding brain) I would like matlab to "Search a txt file that has a certain name that the user can specify. For a specific organ like the bladder, put the data in a variable called something like "Bladder Plan 1" and "Bladder Plan 2". Do math. Do same for all other organs. Put result in a report. Save as pdf or file". I hope that the wonderful Matlab community can help me, since I am no Matrix wizard with coding.
For all patients the structures all have the same naming convention, so I guess I could specify somewhere/somehow what organs should be searched for in the text file and what I would like the variable to be called, so that the search in the text file could go quick.
If anyone has any tips and suggestions that would be great. I have attached an anonymized txt file of how it could look like. I want to do radiobiological calculations for structures in a patient with two different plans. I have a txt file with all the data in it. The txt file contains among other things the biological structure (which exists in both plans), the biological data in two columns and two rows that specifies what plan and what structure it is.
I know how to code the math to do the calculations, but how do I most easy read the text file and store each plans column in like a matrix?
For example (in my own dumb coding brain) I would like matlab to "Search a txt file that has a certain name that the user can specify. For a specific organ like the bladder, put the data in a variable called something like "Bladder Plan 1" and "Bladder Plan 2". Do math. Do same for all other organs. Put result in a report. Save as pdf or file". I hope that the wonderful Matlab community can help me, since I am no Matrix wizard with coding.
For all patients the structures all have the same naming convention, so I guess I could specify somewhere/somehow what organs should be searched for in the text file and what I would like the variable to be called, so that the search in the text file could go quick.
If anyone has any tips and suggestions that would be great. I have attached an anonymized txt file of how it could look like. radiobiology MATLAB Answers — New Questions
2D data fitting – Surface
I have some numbers as a function of 2 variables: _( x, y ) ↦ z_.
I would like to know which function _z = z( x, y )_ best fits my data.
Unfortunately, I don’t have any hint, I mean, there’s no theoretical background on these numbers. They’re the result ( _z_ ) of some FEM simulations of a system, being the simulation a parametric sweep over two parameters ( _x_ and _y_ ) of the system.
Here’s my data:
x = [1 2 4 6 8 10 13 17 21 25];
y = [0.2 0.5 1 2 4 7 10 14 18 22];
z = [1 0.6844 0.3048 0.2124 0.1689 0.1432 0.1192 0.1015 0.0908 0.0841;…
1.000 0.7096 0.3595 0.2731 0.2322 0.2081 0.1857 0.1690 0.1590 0.1529;…
1.000 0.7451 0.4362 0.3585 0.3217 0.2999 0.2797 0.2648 0.2561 0.2504;…
1.000 0.7979 0.5519 0.4877 0.4574 0.4394 0.4228 0.4107 0.4037 0.3994;…
1.000 0.8628 0.6945 0.6490 0.6271 0.6145 0.6027 0.5945 0.5896 0.5870;…
1.000 0.9131 0.8057 0.7758 0.7614 0.7531 0.7457 0.7410 0.7383 0.7368;…
1.000 0.9397 0.8647 0.8436 0.8333 0.8278 0.8228 0.8195 0.8181 0.8171;…
1.000 0.9594 0.9087 0.8942 0.8877 0.8839 0.8808 0.8791 0.8783 0.8777;…
1.000 0.9705 0.9342 0.9238 0.9190 0.9165 0.9145 0.9133 0.9131 0.9127;…
1.000 0.9776 0.9502 0.9425 0.9390 0.9372 0.9358 0.9352 0.9349 0.9348];
I tried with MATLAB with the Curve Fitting app, but I didn’t succeed. The ‘polynomial’ fitting doesn’t work well. I would like to use the ‘custom equation’ fitting, but I don’t know what equation to start. I don’t have much practice in data analysis.
Any hint?
<<http://i.stack.imgur.com/tlqDu.png>>I have some numbers as a function of 2 variables: _( x, y ) ↦ z_.
I would like to know which function _z = z( x, y )_ best fits my data.
Unfortunately, I don’t have any hint, I mean, there’s no theoretical background on these numbers. They’re the result ( _z_ ) of some FEM simulations of a system, being the simulation a parametric sweep over two parameters ( _x_ and _y_ ) of the system.
Here’s my data:
x = [1 2 4 6 8 10 13 17 21 25];
y = [0.2 0.5 1 2 4 7 10 14 18 22];
z = [1 0.6844 0.3048 0.2124 0.1689 0.1432 0.1192 0.1015 0.0908 0.0841;…
1.000 0.7096 0.3595 0.2731 0.2322 0.2081 0.1857 0.1690 0.1590 0.1529;…
1.000 0.7451 0.4362 0.3585 0.3217 0.2999 0.2797 0.2648 0.2561 0.2504;…
1.000 0.7979 0.5519 0.4877 0.4574 0.4394 0.4228 0.4107 0.4037 0.3994;…
1.000 0.8628 0.6945 0.6490 0.6271 0.6145 0.6027 0.5945 0.5896 0.5870;…
1.000 0.9131 0.8057 0.7758 0.7614 0.7531 0.7457 0.7410 0.7383 0.7368;…
1.000 0.9397 0.8647 0.8436 0.8333 0.8278 0.8228 0.8195 0.8181 0.8171;…
1.000 0.9594 0.9087 0.8942 0.8877 0.8839 0.8808 0.8791 0.8783 0.8777;…
1.000 0.9705 0.9342 0.9238 0.9190 0.9165 0.9145 0.9133 0.9131 0.9127;…
1.000 0.9776 0.9502 0.9425 0.9390 0.9372 0.9358 0.9352 0.9349 0.9348];
I tried with MATLAB with the Curve Fitting app, but I didn’t succeed. The ‘polynomial’ fitting doesn’t work well. I would like to use the ‘custom equation’ fitting, but I don’t know what equation to start. I don’t have much practice in data analysis.
Any hint?
<<http://i.stack.imgur.com/tlqDu.png>> I have some numbers as a function of 2 variables: _( x, y ) ↦ z_.
I would like to know which function _z = z( x, y )_ best fits my data.
Unfortunately, I don’t have any hint, I mean, there’s no theoretical background on these numbers. They’re the result ( _z_ ) of some FEM simulations of a system, being the simulation a parametric sweep over two parameters ( _x_ and _y_ ) of the system.
Here’s my data:
x = [1 2 4 6 8 10 13 17 21 25];
y = [0.2 0.5 1 2 4 7 10 14 18 22];
z = [1 0.6844 0.3048 0.2124 0.1689 0.1432 0.1192 0.1015 0.0908 0.0841;…
1.000 0.7096 0.3595 0.2731 0.2322 0.2081 0.1857 0.1690 0.1590 0.1529;…
1.000 0.7451 0.4362 0.3585 0.3217 0.2999 0.2797 0.2648 0.2561 0.2504;…
1.000 0.7979 0.5519 0.4877 0.4574 0.4394 0.4228 0.4107 0.4037 0.3994;…
1.000 0.8628 0.6945 0.6490 0.6271 0.6145 0.6027 0.5945 0.5896 0.5870;…
1.000 0.9131 0.8057 0.7758 0.7614 0.7531 0.7457 0.7410 0.7383 0.7368;…
1.000 0.9397 0.8647 0.8436 0.8333 0.8278 0.8228 0.8195 0.8181 0.8171;…
1.000 0.9594 0.9087 0.8942 0.8877 0.8839 0.8808 0.8791 0.8783 0.8777;…
1.000 0.9705 0.9342 0.9238 0.9190 0.9165 0.9145 0.9133 0.9131 0.9127;…
1.000 0.9776 0.9502 0.9425 0.9390 0.9372 0.9358 0.9352 0.9349 0.9348];
I tried with MATLAB with the Curve Fitting app, but I didn’t succeed. The ‘polynomial’ fitting doesn’t work well. I would like to use the ‘custom equation’ fitting, but I don’t know what equation to start. I don’t have much practice in data analysis.
Any hint?
<<http://i.stack.imgur.com/tlqDu.png>> statistics, 3d, 2d, surface, data analysis, fitting, curve fitting, lsqcurvefit, nlinfit, fit regression surface to 3d data MATLAB Answers — New Questions
Which SLRT Functions Replace xPC Functions?
I need to update legacy r2010b MATLAB code that uses xPC functions to r2024a code that uses Simulink Real-Time functions. For example, I have replaced instances of xpctargetping with slrtpingtarget (https://www.mathworks.com/help/releases/R2020a/xpc/api/slrtpingtarget.html).
Are there modern SLRT replacement functions for legacy setxpcenv and xpctarget.fs/xpctarget.ftp functions? Maybe setslrtenv and slrt(‘target’) or slrealtime.fs/ftp? (https://www.mathworks.com/help/slrealtime/api/slrealtime.target.html)
Are these functions only available once connected to target hardware?I need to update legacy r2010b MATLAB code that uses xPC functions to r2024a code that uses Simulink Real-Time functions. For example, I have replaced instances of xpctargetping with slrtpingtarget (https://www.mathworks.com/help/releases/R2020a/xpc/api/slrtpingtarget.html).
Are there modern SLRT replacement functions for legacy setxpcenv and xpctarget.fs/xpctarget.ftp functions? Maybe setslrtenv and slrt(‘target’) or slrealtime.fs/ftp? (https://www.mathworks.com/help/slrealtime/api/slrealtime.target.html)
Are these functions only available once connected to target hardware? I need to update legacy r2010b MATLAB code that uses xPC functions to r2024a code that uses Simulink Real-Time functions. For example, I have replaced instances of xpctargetping with slrtpingtarget (https://www.mathworks.com/help/releases/R2020a/xpc/api/slrtpingtarget.html).
Are there modern SLRT replacement functions for legacy setxpcenv and xpctarget.fs/xpctarget.ftp functions? Maybe setslrtenv and slrt(‘target’) or slrealtime.fs/ftp? (https://www.mathworks.com/help/slrealtime/api/slrealtime.target.html)
Are these functions only available once connected to target hardware? simulink, xpc, slrt MATLAB Answers — New Questions
Error: Failed to initialize the interactive session
I am trying to validate a cluster profile. I was able to do all tests but the parallel pool test. I have attached my validation report below. Any help is appreciated.
VALIDATION REPORT
Profile: beoshock
Scheduler Type: Generic
Stage: Cluster connection test (parcluster)
Status: Passed
Start Time: Thu May 13 12:21:31 CDT 2021
Finish Time: Thu May 13 12:21:31 CDT 2021
Running Duration: 0 min 0 sec
Description:
Error Report:
Command Line Output:
Debug Log:
Stage: Job test (createJob)
Status: Passed
Start Time: Thu May 13 12:21:31 CDT 2021
Finish Time: Thu May 13 12:21:57 CDT 2021
Running Duration: 0 min 26 sec
Description:
Error Report:
Command Line Output:
Debug Log:
Stage: SPMD job test (createCommunicatingJob)
Status: Passed
Start Time: Thu May 13 12:21:59 CDT 2021
Finish Time: Thu May 13 12:22:37 CDT 2021
Running Duration: 0 min 38 sec
Description: Job ran with 2 workers.
Error Report:
Command Line Output:
Debug Log:
Stage: Pool job test (createCommunicatingJob)
Status: Passed
Start Time: Thu May 13 12:22:39 CDT 2021
Finish Time: Thu May 13 12:23:06 CDT 2021
Running Duration: 0 min 27 sec
Description: Job ran with 2 workers.
Error Report:
Command Line Output:
Debug Log:
Stage: Parallel pool test (parpool)
Status: Failed
Start Time: Thu May 13 12:23:08 CDT 2021
Finish Time: Thu May 13 12:24:41 CDT 2021
Running Duration: 1 min 33 sec
Description: Failed to initialize the interactive session.
Error Report: Failed to initialize the interactive session.
Caused by:
Error using parallel.internal.pool.AbstractInteractiveClient>iThrowIfBadParallelJobStatus (line 433)
The interactive communicating job errored with the following message: MatlabPoolPeerInstance{fLabIndex=1, fNumberOfLabs=2, fUuid=b10ec9e0-6fbc-43e5-8566-67ed5d06514d} was unable to find the host for MacBook-Pro:27370 due to a JVM UnknownHostException: nullI am trying to validate a cluster profile. I was able to do all tests but the parallel pool test. I have attached my validation report below. Any help is appreciated.
VALIDATION REPORT
Profile: beoshock
Scheduler Type: Generic
Stage: Cluster connection test (parcluster)
Status: Passed
Start Time: Thu May 13 12:21:31 CDT 2021
Finish Time: Thu May 13 12:21:31 CDT 2021
Running Duration: 0 min 0 sec
Description:
Error Report:
Command Line Output:
Debug Log:
Stage: Job test (createJob)
Status: Passed
Start Time: Thu May 13 12:21:31 CDT 2021
Finish Time: Thu May 13 12:21:57 CDT 2021
Running Duration: 0 min 26 sec
Description:
Error Report:
Command Line Output:
Debug Log:
Stage: SPMD job test (createCommunicatingJob)
Status: Passed
Start Time: Thu May 13 12:21:59 CDT 2021
Finish Time: Thu May 13 12:22:37 CDT 2021
Running Duration: 0 min 38 sec
Description: Job ran with 2 workers.
Error Report:
Command Line Output:
Debug Log:
Stage: Pool job test (createCommunicatingJob)
Status: Passed
Start Time: Thu May 13 12:22:39 CDT 2021
Finish Time: Thu May 13 12:23:06 CDT 2021
Running Duration: 0 min 27 sec
Description: Job ran with 2 workers.
Error Report:
Command Line Output:
Debug Log:
Stage: Parallel pool test (parpool)
Status: Failed
Start Time: Thu May 13 12:23:08 CDT 2021
Finish Time: Thu May 13 12:24:41 CDT 2021
Running Duration: 1 min 33 sec
Description: Failed to initialize the interactive session.
Error Report: Failed to initialize the interactive session.
Caused by:
Error using parallel.internal.pool.AbstractInteractiveClient>iThrowIfBadParallelJobStatus (line 433)
The interactive communicating job errored with the following message: MatlabPoolPeerInstance{fLabIndex=1, fNumberOfLabs=2, fUuid=b10ec9e0-6fbc-43e5-8566-67ed5d06514d} was unable to find the host for MacBook-Pro:27370 due to a JVM UnknownHostException: null I am trying to validate a cluster profile. I was able to do all tests but the parallel pool test. I have attached my validation report below. Any help is appreciated.
VALIDATION REPORT
Profile: beoshock
Scheduler Type: Generic
Stage: Cluster connection test (parcluster)
Status: Passed
Start Time: Thu May 13 12:21:31 CDT 2021
Finish Time: Thu May 13 12:21:31 CDT 2021
Running Duration: 0 min 0 sec
Description:
Error Report:
Command Line Output:
Debug Log:
Stage: Job test (createJob)
Status: Passed
Start Time: Thu May 13 12:21:31 CDT 2021
Finish Time: Thu May 13 12:21:57 CDT 2021
Running Duration: 0 min 26 sec
Description:
Error Report:
Command Line Output:
Debug Log:
Stage: SPMD job test (createCommunicatingJob)
Status: Passed
Start Time: Thu May 13 12:21:59 CDT 2021
Finish Time: Thu May 13 12:22:37 CDT 2021
Running Duration: 0 min 38 sec
Description: Job ran with 2 workers.
Error Report:
Command Line Output:
Debug Log:
Stage: Pool job test (createCommunicatingJob)
Status: Passed
Start Time: Thu May 13 12:22:39 CDT 2021
Finish Time: Thu May 13 12:23:06 CDT 2021
Running Duration: 0 min 27 sec
Description: Job ran with 2 workers.
Error Report:
Command Line Output:
Debug Log:
Stage: Parallel pool test (parpool)
Status: Failed
Start Time: Thu May 13 12:23:08 CDT 2021
Finish Time: Thu May 13 12:24:41 CDT 2021
Running Duration: 1 min 33 sec
Description: Failed to initialize the interactive session.
Error Report: Failed to initialize the interactive session.
Caused by:
Error using parallel.internal.pool.AbstractInteractiveClient>iThrowIfBadParallelJobStatus (line 433)
The interactive communicating job errored with the following message: MatlabPoolPeerInstance{fLabIndex=1, fNumberOfLabs=2, fUuid=b10ec9e0-6fbc-43e5-8566-67ed5d06514d} was unable to find the host for MacBook-Pro:27370 due to a JVM UnknownHostException: null cluster profile, parallel computing MATLAB Answers — New Questions
Facing license Issues while running a function from Communication Toolbox.
I am encountering a License Manager Error -4 when trying to use a function from the Communication Toolbox, even though I have an active license for it. The error message suggests that the maximum number of users for ‘Signal_Blocks’ has been reached, is ‘Signal_Blocks’ related to the DSP System Toolbox?.
License checkout failed.
License Manager Error -4
Maximum number of users for Signal_Blocks
reached.
Try again later.
I’m trying to understand why I’m getting this error when accessing a function from the Communication Toolbox. Does using a function from one toolbox require licenses for other toolboxes as well? Additionally, how can I find out which toolboxes are included in my current license?I am encountering a License Manager Error -4 when trying to use a function from the Communication Toolbox, even though I have an active license for it. The error message suggests that the maximum number of users for ‘Signal_Blocks’ has been reached, is ‘Signal_Blocks’ related to the DSP System Toolbox?.
License checkout failed.
License Manager Error -4
Maximum number of users for Signal_Blocks
reached.
Try again later.
I’m trying to understand why I’m getting this error when accessing a function from the Communication Toolbox. Does using a function from one toolbox require licenses for other toolboxes as well? Additionally, how can I find out which toolboxes are included in my current license? I am encountering a License Manager Error -4 when trying to use a function from the Communication Toolbox, even though I have an active license for it. The error message suggests that the maximum number of users for ‘Signal_Blocks’ has been reached, is ‘Signal_Blocks’ related to the DSP System Toolbox?.
License checkout failed.
License Manager Error -4
Maximum number of users for Signal_Blocks
reached.
Try again later.
I’m trying to understand why I’m getting this error when accessing a function from the Communication Toolbox. Does using a function from one toolbox require licenses for other toolboxes as well? Additionally, how can I find out which toolboxes are included in my current license? license, toolbox, dspsystemtoolbox MATLAB Answers — New Questions
How does Forward kinematik work in Robotics System Toolbox?
How does the Robot System Toolbox work internally?
I noticed some small offset in the results of the Forward Kinematics if I compare the result of getTransform with the plain geometric Forward Kinematics calculated with the parameters from the Datasheet (p. 61).
The offset also seems to be dynamic. So I wonder what the reason could be.
Is there some kind of dynamic simulation of the joints stiffnes?
Attached is some code to reproduce this:
% Compare DH forward Kinematics with Matlab Model of KinGen3
%% get robot model
close all
gen3 = loadrobot("kinovaGen3");
gen3.DataFormat = ‘column’;
eeName = ‘EndEffector_Link’;
% define q:
q=[ 1.18 -68.68 18.47 -69.09 94.36 112.93 46.00]’;
%q=[ 1.18+180 -68.68 18.47 -69.09 94.36 112.93 46.00]’;
%q=[0 0 0 0 0 0 0]’;
%% calculate FK with DH and with Matlab modell:
% DH
H_DH = getSingleH(getHcomplete(q),0,8)
pos_DH = H_DH(1:3,4);
% Model
H_mod = getTransform(gen3, q/180*pi’, eeName)
pos_mod=H_mod(1:3,4);
%calculate difference:
pos_dif=(pos_DH-pos_mod)*1000
%% Funktiondecalrations for forward kinematics
function H = getHcomplete(q)
% calculates H cell according to input angles
% wheras H{1}=H01, H{2}=H12, H{3}=H23, etc…
i=1;
R{i}=rotx(180)*rotz(q(i)); % Rotation
D{i}=[0 0 +156.4]’/1000; % Displacement
H{i}=RnD2H(R{i},D{i});
i=2;
R{i}=rotx(+90)*rotz(q(i));
D{i}=[0 5.4 -128.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=3;
R{i}=rotx(-90)*rotz(q(i));
D{i}=[0 -210.4 -6.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=4;
R{i}=rotx(+90)*rotz(q(i));
D{i}=[0 6.4 -210.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=5;
R{i}=rotx(-90)*rotz(q(i));
D{i}=[0 -208.4 -6.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=6;
R{i}=rotx(+90)*rotz(q(i));
D{i}=[0 0 -105.9]’/1000;
H{i}=RnD2H(R{i},D{i});
i=7;
R{i}=rotx(-90)*rotz(q(i));
D{i}=[0 -105.9 0]’/1000;
H{i}=RnD2H(R{i},D{i});
i=8;
R{i}=rotx(180)*rotz(0);
D{i}=[0 0 -61.5]’/1000;
H{i}=RnD2H(R{i},D{i});
end
function H = RnD2H(R,D)
% combines Rotation and Displacement into homogenous transform
H = horzcat(R,D);
H = vertcat(H,[0 0 0 1]);
end
function H = getSingleH(h,von,bis)
% returns homogenous transfrormation from to defined frames
H=eye(4);
for i=von+(bis-von>0):sign(bis-von):bis+(von-bis>0)
H=H*h{i}^sign(bis-von);
end
endHow does the Robot System Toolbox work internally?
I noticed some small offset in the results of the Forward Kinematics if I compare the result of getTransform with the plain geometric Forward Kinematics calculated with the parameters from the Datasheet (p. 61).
The offset also seems to be dynamic. So I wonder what the reason could be.
Is there some kind of dynamic simulation of the joints stiffnes?
Attached is some code to reproduce this:
% Compare DH forward Kinematics with Matlab Model of KinGen3
%% get robot model
close all
gen3 = loadrobot("kinovaGen3");
gen3.DataFormat = ‘column’;
eeName = ‘EndEffector_Link’;
% define q:
q=[ 1.18 -68.68 18.47 -69.09 94.36 112.93 46.00]’;
%q=[ 1.18+180 -68.68 18.47 -69.09 94.36 112.93 46.00]’;
%q=[0 0 0 0 0 0 0]’;
%% calculate FK with DH and with Matlab modell:
% DH
H_DH = getSingleH(getHcomplete(q),0,8)
pos_DH = H_DH(1:3,4);
% Model
H_mod = getTransform(gen3, q/180*pi’, eeName)
pos_mod=H_mod(1:3,4);
%calculate difference:
pos_dif=(pos_DH-pos_mod)*1000
%% Funktiondecalrations for forward kinematics
function H = getHcomplete(q)
% calculates H cell according to input angles
% wheras H{1}=H01, H{2}=H12, H{3}=H23, etc…
i=1;
R{i}=rotx(180)*rotz(q(i)); % Rotation
D{i}=[0 0 +156.4]’/1000; % Displacement
H{i}=RnD2H(R{i},D{i});
i=2;
R{i}=rotx(+90)*rotz(q(i));
D{i}=[0 5.4 -128.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=3;
R{i}=rotx(-90)*rotz(q(i));
D{i}=[0 -210.4 -6.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=4;
R{i}=rotx(+90)*rotz(q(i));
D{i}=[0 6.4 -210.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=5;
R{i}=rotx(-90)*rotz(q(i));
D{i}=[0 -208.4 -6.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=6;
R{i}=rotx(+90)*rotz(q(i));
D{i}=[0 0 -105.9]’/1000;
H{i}=RnD2H(R{i},D{i});
i=7;
R{i}=rotx(-90)*rotz(q(i));
D{i}=[0 -105.9 0]’/1000;
H{i}=RnD2H(R{i},D{i});
i=8;
R{i}=rotx(180)*rotz(0);
D{i}=[0 0 -61.5]’/1000;
H{i}=RnD2H(R{i},D{i});
end
function H = RnD2H(R,D)
% combines Rotation and Displacement into homogenous transform
H = horzcat(R,D);
H = vertcat(H,[0 0 0 1]);
end
function H = getSingleH(h,von,bis)
% returns homogenous transfrormation from to defined frames
H=eye(4);
for i=von+(bis-von>0):sign(bis-von):bis+(von-bis>0)
H=H*h{i}^sign(bis-von);
end
end How does the Robot System Toolbox work internally?
I noticed some small offset in the results of the Forward Kinematics if I compare the result of getTransform with the plain geometric Forward Kinematics calculated with the parameters from the Datasheet (p. 61).
The offset also seems to be dynamic. So I wonder what the reason could be.
Is there some kind of dynamic simulation of the joints stiffnes?
Attached is some code to reproduce this:
% Compare DH forward Kinematics with Matlab Model of KinGen3
%% get robot model
close all
gen3 = loadrobot("kinovaGen3");
gen3.DataFormat = ‘column’;
eeName = ‘EndEffector_Link’;
% define q:
q=[ 1.18 -68.68 18.47 -69.09 94.36 112.93 46.00]’;
%q=[ 1.18+180 -68.68 18.47 -69.09 94.36 112.93 46.00]’;
%q=[0 0 0 0 0 0 0]’;
%% calculate FK with DH and with Matlab modell:
% DH
H_DH = getSingleH(getHcomplete(q),0,8)
pos_DH = H_DH(1:3,4);
% Model
H_mod = getTransform(gen3, q/180*pi’, eeName)
pos_mod=H_mod(1:3,4);
%calculate difference:
pos_dif=(pos_DH-pos_mod)*1000
%% Funktiondecalrations for forward kinematics
function H = getHcomplete(q)
% calculates H cell according to input angles
% wheras H{1}=H01, H{2}=H12, H{3}=H23, etc…
i=1;
R{i}=rotx(180)*rotz(q(i)); % Rotation
D{i}=[0 0 +156.4]’/1000; % Displacement
H{i}=RnD2H(R{i},D{i});
i=2;
R{i}=rotx(+90)*rotz(q(i));
D{i}=[0 5.4 -128.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=3;
R{i}=rotx(-90)*rotz(q(i));
D{i}=[0 -210.4 -6.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=4;
R{i}=rotx(+90)*rotz(q(i));
D{i}=[0 6.4 -210.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=5;
R{i}=rotx(-90)*rotz(q(i));
D{i}=[0 -208.4 -6.4]’/1000;
H{i}=RnD2H(R{i},D{i});
i=6;
R{i}=rotx(+90)*rotz(q(i));
D{i}=[0 0 -105.9]’/1000;
H{i}=RnD2H(R{i},D{i});
i=7;
R{i}=rotx(-90)*rotz(q(i));
D{i}=[0 -105.9 0]’/1000;
H{i}=RnD2H(R{i},D{i});
i=8;
R{i}=rotx(180)*rotz(0);
D{i}=[0 0 -61.5]’/1000;
H{i}=RnD2H(R{i},D{i});
end
function H = RnD2H(R,D)
% combines Rotation and Displacement into homogenous transform
H = horzcat(R,D);
H = vertcat(H,[0 0 0 1]);
end
function H = getSingleH(h,von,bis)
% returns homogenous transfrormation from to defined frames
H=eye(4);
for i=von+(bis-von>0):sign(bis-von):bis+(von-bis>0)
H=H*h{i}^sign(bis-von);
end
end robotics system toolbox, gettransform, kinovagen3, loadrobot MATLAB Answers — New Questions
MATLAB not saving variables to workspace
I don’t know what’s wrong with my MATLAB. Every time I run the dummy.m using the F5 in the editor, all the variables are being displayed in the workspace. But when I run the NitrogenDef.m using again the F5 in the editor, all the variables used in the NitrogenDef.m are not displayed in the workspace. Any help with this? Thanks!I don’t know what’s wrong with my MATLAB. Every time I run the dummy.m using the F5 in the editor, all the variables are being displayed in the workspace. But when I run the NitrogenDef.m using again the F5 in the editor, all the variables used in the NitrogenDef.m are not displayed in the workspace. Any help with this? Thanks! I don’t know what’s wrong with my MATLAB. Every time I run the dummy.m using the F5 in the editor, all the variables are being displayed in the workspace. But when I run the NitrogenDef.m using again the F5 in the editor, all the variables used in the NitrogenDef.m are not displayed in the workspace. Any help with this? Thanks! workspace, function, variable MATLAB Answers — New Questions
Simulation with an RL Agent does not save simulation data
I have a reinforcement learning simulink model environment I am training in MATLAB 2023a, which I started porting to MATLAB 2024a. The model runs well in 2023a and saves the simulations done using the sim function. The environment has some signals that I want to save.
For the 2023a they got saved in the SimulationInfo object but that doesnt happen with 2024a. Do I have to activate something additionally in 2024a or is it a bug?
The images below detail the difference between the two versions. The env is a simulink envrionment
simEpisodes = 1;
simOpts = rlSimulationOptions("MaxSteps",1250,…
"NumSimulations", simEpisodes);
experience = sim(env,agent,simOpts);
save(strcat(results_dir,’/Experience.mat’),"experience")I have a reinforcement learning simulink model environment I am training in MATLAB 2023a, which I started porting to MATLAB 2024a. The model runs well in 2023a and saves the simulations done using the sim function. The environment has some signals that I want to save.
For the 2023a they got saved in the SimulationInfo object but that doesnt happen with 2024a. Do I have to activate something additionally in 2024a or is it a bug?
The images below detail the difference between the two versions. The env is a simulink envrionment
simEpisodes = 1;
simOpts = rlSimulationOptions("MaxSteps",1250,…
"NumSimulations", simEpisodes);
experience = sim(env,agent,simOpts);
save(strcat(results_dir,’/Experience.mat’),"experience") I have a reinforcement learning simulink model environment I am training in MATLAB 2023a, which I started porting to MATLAB 2024a. The model runs well in 2023a and saves the simulations done using the sim function. The environment has some signals that I want to save.
For the 2023a they got saved in the SimulationInfo object but that doesnt happen with 2024a. Do I have to activate something additionally in 2024a or is it a bug?
The images below detail the difference between the two versions. The env is a simulink envrionment
simEpisodes = 1;
simOpts = rlSimulationOptions("MaxSteps",1250,…
"NumSimulations", simEpisodes);
experience = sim(env,agent,simOpts);
save(strcat(results_dir,’/Experience.mat’),"experience") machine learning, deep learning, artificial intelligence, bug, reinforcement learning MATLAB Answers — New Questions
App designer TabGroup colours
I have been creating an app in app designer, and I cannot see any way to change the grey border of a tabgroup where there are no tabs. It is very ugly and I would rather this be transparent – does anyone know a fix for this? Or any clever way of using HTML/CSS to make this possible? Thanks in advance.
See picture below:I have been creating an app in app designer, and I cannot see any way to change the grey border of a tabgroup where there are no tabs. It is very ugly and I would rather this be transparent – does anyone know a fix for this? Or any clever way of using HTML/CSS to make this possible? Thanks in advance.
See picture below: I have been creating an app in app designer, and I cannot see any way to change the grey border of a tabgroup where there are no tabs. It is very ugly and I would rather this be transparent – does anyone know a fix for this? Or any clever way of using HTML/CSS to make this possible? Thanks in advance.
See picture below: app designer, tabgroup MATLAB Answers — New Questions
Error in boxchart (invalid parameter/value pair arguments)
I am trying to use Boxchart but am getting an error even when using the carbig dataset and functions as listed in the help files. Eventually I need to get boxcharts for ANOVA results. This is what I have. (The help file for anovan calls "Model_Year" as "mfg date" but I think this is the equivalent set of data)
aov = anovan(MPG,{org when},’model’,2,’varnames’,{‘Origin’,’Model_Year’})
boxchart(aov,["Origin"])
legend
The ANOVA seems to run just fine, but when it gets to the Boxchart I get this error. Any ideas? I’m using version R2023b.
Error using matlab.graphics.chart.primitive.BoxChart
Invalid parameter/value pair arguments.
Error in boxchart (line 186)
H(idx) = matlab.graphics.chart.primitive.BoxChart(‘Parent’, cax,…
Error in ANOVA_trial_file (line 2)
boxchart(p,["Origin"])I am trying to use Boxchart but am getting an error even when using the carbig dataset and functions as listed in the help files. Eventually I need to get boxcharts for ANOVA results. This is what I have. (The help file for anovan calls "Model_Year" as "mfg date" but I think this is the equivalent set of data)
aov = anovan(MPG,{org when},’model’,2,’varnames’,{‘Origin’,’Model_Year’})
boxchart(aov,["Origin"])
legend
The ANOVA seems to run just fine, but when it gets to the Boxchart I get this error. Any ideas? I’m using version R2023b.
Error using matlab.graphics.chart.primitive.BoxChart
Invalid parameter/value pair arguments.
Error in boxchart (line 186)
H(idx) = matlab.graphics.chart.primitive.BoxChart(‘Parent’, cax,…
Error in ANOVA_trial_file (line 2)
boxchart(p,["Origin"]) I am trying to use Boxchart but am getting an error even when using the carbig dataset and functions as listed in the help files. Eventually I need to get boxcharts for ANOVA results. This is what I have. (The help file for anovan calls "Model_Year" as "mfg date" but I think this is the equivalent set of data)
aov = anovan(MPG,{org when},’model’,2,’varnames’,{‘Origin’,’Model_Year’})
boxchart(aov,["Origin"])
legend
The ANOVA seems to run just fine, but when it gets to the Boxchart I get this error. Any ideas? I’m using version R2023b.
Error using matlab.graphics.chart.primitive.BoxChart
Invalid parameter/value pair arguments.
Error in boxchart (line 186)
H(idx) = matlab.graphics.chart.primitive.BoxChart(‘Parent’, cax,…
Error in ANOVA_trial_file (line 2)
boxchart(p,["Origin"]) boxchart, anova MATLAB Answers — New Questions
Error : Failure in initial user-supplied nonlinear constraint function evaluation.
Hello everyone!
I’m encountering an issue with my MATLAB code and could use some assistance. Specifically, I’m getting the following error message:
[sol, fval, exitflag, output] = solve(prob);
Caused by:
Failure in initial user-supplied nonlinear constraint function evaluation.
It seems to be related to the evaluation of the nonlinear constraint function. I’ve attached the relevant part of my code below. I’m particularly confused because I linearised all my constraint terms, so I wasn’t expecting any non-linearity.
Could you please help me identify the issue and suggest any potential fixes?
Thank you!
best Regards!
MyProblem()Hello everyone!
I’m encountering an issue with my MATLAB code and could use some assistance. Specifically, I’m getting the following error message:
[sol, fval, exitflag, output] = solve(prob);
Caused by:
Failure in initial user-supplied nonlinear constraint function evaluation.
It seems to be related to the evaluation of the nonlinear constraint function. I’ve attached the relevant part of my code below. I’m particularly confused because I linearised all my constraint terms, so I wasn’t expecting any non-linearity.
Could you please help me identify the issue and suggest any potential fixes?
Thank you!
best Regards!
MyProblem() Hello everyone!
I’m encountering an issue with my MATLAB code and could use some assistance. Specifically, I’m getting the following error message:
[sol, fval, exitflag, output] = solve(prob);
Caused by:
Failure in initial user-supplied nonlinear constraint function evaluation.
It seems to be related to the evaluation of the nonlinear constraint function. I’ve attached the relevant part of my code below. I’m particularly confused because I linearised all my constraint terms, so I wasn’t expecting any non-linearity.
Could you please help me identify the issue and suggest any potential fixes?
Thank you!
best Regards!
MyProblem() nlp, optimization, error MATLAB Answers — New Questions