Tag Archives: matlab
Confidence levels for glmfit – glmval or fitglm using the Likelihood Ratio method
After several days and many hours of researching and googling, I am unable to determine how I could find confidence levels using the Likelihood Ratio for either glmfit – glmval or fitglm. I know it can be done in R, but I don’t see that capability in Matlab. Does it exist? Neither glmval nor coefCI appear to use or have options for using the Likelihood Ratio method. And paramci does not appear to work with a GeneralizedLinearModel object.
Thanks for any help you can provide.After several days and many hours of researching and googling, I am unable to determine how I could find confidence levels using the Likelihood Ratio for either glmfit – glmval or fitglm. I know it can be done in R, but I don’t see that capability in Matlab. Does it exist? Neither glmval nor coefCI appear to use or have options for using the Likelihood Ratio method. And paramci does not appear to work with a GeneralizedLinearModel object.
Thanks for any help you can provide. After several days and many hours of researching and googling, I am unable to determine how I could find confidence levels using the Likelihood Ratio for either glmfit – glmval or fitglm. I know it can be done in R, but I don’t see that capability in Matlab. Does it exist? Neither glmval nor coefCI appear to use or have options for using the Likelihood Ratio method. And paramci does not appear to work with a GeneralizedLinearModel object.
Thanks for any help you can provide. statistics, generalized linear model MATLAB Answers — New Questions
Error using mex ‘No supported compiler was found’ on Mac.
I am trying to run a c++ program in Matlab. To do this I am using mex. I have a mac.
I was trying to get my c++ files to run but that wasn’t working so to begin with I have been trying to use this example provided by MATLAB: https://uk.mathworks.com/help/matlab/matlab_external/build-an-executable-mex-file.html
Each time I run the command ‘mex timestwo.c’ I recieve the same error as when I was trying to get my own programme to run. The error says:
‘Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.’
This seems to be a very common problem and I have looked through all the guidance I can find but I am still recieving the same error. I have xcode 10.x and MATLAB 2019a and I have accepted the Xcode licence.
Thank you in advanceI am trying to run a c++ program in Matlab. To do this I am using mex. I have a mac.
I was trying to get my c++ files to run but that wasn’t working so to begin with I have been trying to use this example provided by MATLAB: https://uk.mathworks.com/help/matlab/matlab_external/build-an-executable-mex-file.html
Each time I run the command ‘mex timestwo.c’ I recieve the same error as when I was trying to get my own programme to run. The error says:
‘Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.’
This seems to be a very common problem and I have looked through all the guidance I can find but I am still recieving the same error. I have xcode 10.x and MATLAB 2019a and I have accepted the Xcode licence.
Thank you in advance I am trying to run a c++ program in Matlab. To do this I am using mex. I have a mac.
I was trying to get my c++ files to run but that wasn’t working so to begin with I have been trying to use this example provided by MATLAB: https://uk.mathworks.com/help/matlab/matlab_external/build-an-executable-mex-file.html
Each time I run the command ‘mex timestwo.c’ I recieve the same error as when I was trying to get my own programme to run. The error says:
‘Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.’
This seems to be a very common problem and I have looked through all the guidance I can find but I am still recieving the same error. I have xcode 10.x and MATLAB 2019a and I have accepted the Xcode licence.
Thank you in advance mex, mac, xcode, compiler MATLAB Answers — New Questions
Exporting a custom trained network to C#. MATLAB coder or ONNX?
I have a simple working trained custom network code that does a great job for me in classifying new data (arrays of 202 integers which represent some physical curves, which need to be classified to either ‘good’ or ‘bad’ curves).
I have used a starightforward patternnet(30) network.
Now I need to delpoy my prediction function into a C# project. I relized that matlab coder can’t handle loading and training networks, so I have to save my trained network via Matlab and then load it through C# and run there the predict function, which matlab coder will hopefully run.
For this reason I realized that I might need to use exportONNXNetwork, but it forces me to use other network types (and not patternnet) such as SeriesNework or dlnetwork, which I didnt succeed to manually build layers to produce them.
I have also tried to use both classification learner and deep network designer apps to generate networks code for me that would be exported to ONNX and would also mimic the success of my simple patternnet network, but each time they generate code that the exportONNXNetwork function doesn’t like, and produce errors like:
Error using nnet.internal.cnn.onnx.exportONNXNetwork>iValidateNetwork
First argument must be a SeriesNetwork, DAGNetwork, dlnetwork, or layerGraph.
My original code of the working patternnet is:
function [PredictedLabels,PredictedScores]=NeuralNetTLD(handles)
close all;
clear;
load(‘C:UsersuserDocumentsMATLABData filesGoodMAT_2024’);
load(‘C:UsersuserDocumentsMATLABData fileslabels_2024’);
load(‘C:UsersuserDocumentsMATLABData filesBadMAT_2024’);
goodId = (strcmp(labels,’GOOD’));
badId = (strcmp(labels,’BAD’));
Alllabels = [badId ; goodId];
DATA = [BadMAT1 GoodMAT1];
DATA=DATA(1:200,:);
DATA(201,:)=skewness(DATA,0);
DATA(202,:)=kurtosis(DATA,0);
net = patternnet(30);
net = configure(net,DATA,Alllabels);
net.divideParam.trainRatio = 60/100;
net.divideParam.valRatio = 20/100;
net.divideParam.testRatio = 20/100;
rng(1);
[net,tr] = train(net,DATA,Alllabels);
y = net(DATA);
predictions =net(trial);
figure;plot([1:202], trial(:,1:4)); figure; plot([1:202], trial(:,5));
PredictedScores= y(2,:)
PredictedLabels=labels;
end
I would love to hear a simple solution for this problem, as I think deploying a prediction function of a simple network to C# should be quite a common task to perform.
Thanks in advance,
GalI have a simple working trained custom network code that does a great job for me in classifying new data (arrays of 202 integers which represent some physical curves, which need to be classified to either ‘good’ or ‘bad’ curves).
I have used a starightforward patternnet(30) network.
Now I need to delpoy my prediction function into a C# project. I relized that matlab coder can’t handle loading and training networks, so I have to save my trained network via Matlab and then load it through C# and run there the predict function, which matlab coder will hopefully run.
For this reason I realized that I might need to use exportONNXNetwork, but it forces me to use other network types (and not patternnet) such as SeriesNework or dlnetwork, which I didnt succeed to manually build layers to produce them.
I have also tried to use both classification learner and deep network designer apps to generate networks code for me that would be exported to ONNX and would also mimic the success of my simple patternnet network, but each time they generate code that the exportONNXNetwork function doesn’t like, and produce errors like:
Error using nnet.internal.cnn.onnx.exportONNXNetwork>iValidateNetwork
First argument must be a SeriesNetwork, DAGNetwork, dlnetwork, or layerGraph.
My original code of the working patternnet is:
function [PredictedLabels,PredictedScores]=NeuralNetTLD(handles)
close all;
clear;
load(‘C:UsersuserDocumentsMATLABData filesGoodMAT_2024’);
load(‘C:UsersuserDocumentsMATLABData fileslabels_2024’);
load(‘C:UsersuserDocumentsMATLABData filesBadMAT_2024’);
goodId = (strcmp(labels,’GOOD’));
badId = (strcmp(labels,’BAD’));
Alllabels = [badId ; goodId];
DATA = [BadMAT1 GoodMAT1];
DATA=DATA(1:200,:);
DATA(201,:)=skewness(DATA,0);
DATA(202,:)=kurtosis(DATA,0);
net = patternnet(30);
net = configure(net,DATA,Alllabels);
net.divideParam.trainRatio = 60/100;
net.divideParam.valRatio = 20/100;
net.divideParam.testRatio = 20/100;
rng(1);
[net,tr] = train(net,DATA,Alllabels);
y = net(DATA);
predictions =net(trial);
figure;plot([1:202], trial(:,1:4)); figure; plot([1:202], trial(:,5));
PredictedScores= y(2,:)
PredictedLabels=labels;
end
I would love to hear a simple solution for this problem, as I think deploying a prediction function of a simple network to C# should be quite a common task to perform.
Thanks in advance,
Gal I have a simple working trained custom network code that does a great job for me in classifying new data (arrays of 202 integers which represent some physical curves, which need to be classified to either ‘good’ or ‘bad’ curves).
I have used a starightforward patternnet(30) network.
Now I need to delpoy my prediction function into a C# project. I relized that matlab coder can’t handle loading and training networks, so I have to save my trained network via Matlab and then load it through C# and run there the predict function, which matlab coder will hopefully run.
For this reason I realized that I might need to use exportONNXNetwork, but it forces me to use other network types (and not patternnet) such as SeriesNework or dlnetwork, which I didnt succeed to manually build layers to produce them.
I have also tried to use both classification learner and deep network designer apps to generate networks code for me that would be exported to ONNX and would also mimic the success of my simple patternnet network, but each time they generate code that the exportONNXNetwork function doesn’t like, and produce errors like:
Error using nnet.internal.cnn.onnx.exportONNXNetwork>iValidateNetwork
First argument must be a SeriesNetwork, DAGNetwork, dlnetwork, or layerGraph.
My original code of the working patternnet is:
function [PredictedLabels,PredictedScores]=NeuralNetTLD(handles)
close all;
clear;
load(‘C:UsersuserDocumentsMATLABData filesGoodMAT_2024’);
load(‘C:UsersuserDocumentsMATLABData fileslabels_2024’);
load(‘C:UsersuserDocumentsMATLABData filesBadMAT_2024’);
goodId = (strcmp(labels,’GOOD’));
badId = (strcmp(labels,’BAD’));
Alllabels = [badId ; goodId];
DATA = [BadMAT1 GoodMAT1];
DATA=DATA(1:200,:);
DATA(201,:)=skewness(DATA,0);
DATA(202,:)=kurtosis(DATA,0);
net = patternnet(30);
net = configure(net,DATA,Alllabels);
net.divideParam.trainRatio = 60/100;
net.divideParam.valRatio = 20/100;
net.divideParam.testRatio = 20/100;
rng(1);
[net,tr] = train(net,DATA,Alllabels);
y = net(DATA);
predictions =net(trial);
figure;plot([1:202], trial(:,1:4)); figure; plot([1:202], trial(:,5));
PredictedScores= y(2,:)
PredictedLabels=labels;
end
I would love to hear a simple solution for this problem, as I think deploying a prediction function of a simple network to C# should be quite a common task to perform.
Thanks in advance,
Gal c# deployment, neural network, matlab coder, onnx MATLAB Answers — New Questions
How can I create 3D seismic survey ?
Hi All,
I would like to create 3D seismic survey from 2D seismic lines?
I want to use Matlab not Seilab?
i will be thankful for your assistanceHi All,
I would like to create 3D seismic survey from 2D seismic lines?
I want to use Matlab not Seilab?
i will be thankful for your assistance Hi All,
I would like to create 3D seismic survey from 2D seismic lines?
I want to use Matlab not Seilab?
i will be thankful for your assistance seismic MATLAB Answers — New Questions
How can i set the dimension of the arrow in a quiver plot?
I want to set the arrows dimensions in my quiver plot to a fixed value. I’ve used this function
https://uk.mathworks.com/matlabcentral/answers/354324-how-to-make-the-quiver-arrow-head-size-fixed#answer_794194
but this dosent permit to scale the vectors. So using this i solve the problem of the arrow but i cant scale my vectors.
Thanks!I want to set the arrows dimensions in my quiver plot to a fixed value. I’ve used this function
https://uk.mathworks.com/matlabcentral/answers/354324-how-to-make-the-quiver-arrow-head-size-fixed#answer_794194
but this dosent permit to scale the vectors. So using this i solve the problem of the arrow but i cant scale my vectors.
Thanks! I want to set the arrows dimensions in my quiver plot to a fixed value. I’ve used this function
https://uk.mathworks.com/matlabcentral/answers/354324-how-to-make-the-quiver-arrow-head-size-fixed#answer_794194
but this dosent permit to scale the vectors. So using this i solve the problem of the arrow but i cant scale my vectors.
Thanks! quiver, scale, arrow MATLAB Answers — New Questions
how to scale arrows
I have this code for a vector field, the arrows keep getting crazier no mater what i do, can some one plese tell me how do i make them look nice and organized and same size
t1 = linspace(-1,500,10);
y1 = linspace(140,160,10);
[T,Y]=meshgrid(t1,y1);
DY=TribMod4(T,Y); DT=ones(size(DY));
scale = 1./sqrt(DT.^2+DY.^2);
p1=quiver(T,Y, 0.01.*DT, 0.001.*DY);
set(p1,’AutoScale’,’on’, ‘AutoScaleFactor’, 0.08)
axis([-5 500 140 160])
hold on
[t,y]=ode45(@TribMod4,[0:0.51:900],147.971);
plot(t,y,’r’)
ylabel(‘y’)
xlabel(‘time (t)’)
title(‘Direction field of function(2) with b=0.005’)
thanksI have this code for a vector field, the arrows keep getting crazier no mater what i do, can some one plese tell me how do i make them look nice and organized and same size
t1 = linspace(-1,500,10);
y1 = linspace(140,160,10);
[T,Y]=meshgrid(t1,y1);
DY=TribMod4(T,Y); DT=ones(size(DY));
scale = 1./sqrt(DT.^2+DY.^2);
p1=quiver(T,Y, 0.01.*DT, 0.001.*DY);
set(p1,’AutoScale’,’on’, ‘AutoScaleFactor’, 0.08)
axis([-5 500 140 160])
hold on
[t,y]=ode45(@TribMod4,[0:0.51:900],147.971);
plot(t,y,’r’)
ylabel(‘y’)
xlabel(‘time (t)’)
title(‘Direction field of function(2) with b=0.005’)
thanks I have this code for a vector field, the arrows keep getting crazier no mater what i do, can some one plese tell me how do i make them look nice and organized and same size
t1 = linspace(-1,500,10);
y1 = linspace(140,160,10);
[T,Y]=meshgrid(t1,y1);
DY=TribMod4(T,Y); DT=ones(size(DY));
scale = 1./sqrt(DT.^2+DY.^2);
p1=quiver(T,Y, 0.01.*DT, 0.001.*DY);
set(p1,’AutoScale’,’on’, ‘AutoScaleFactor’, 0.08)
axis([-5 500 140 160])
hold on
[t,y]=ode45(@TribMod4,[0:0.51:900],147.971);
plot(t,y,’r’)
ylabel(‘y’)
xlabel(‘time (t)’)
title(‘Direction field of function(2) with b=0.005’)
thanks scale, vector MATLAB Answers — New Questions
sorting non-exact x/y data into rows and columns, typewriter style
say I have the following two arrays:
x=[1.01 2.01 1.02 2.02];
y=[1.01 1.02 2.01 2.02];
sorting these rows using
xy = table(x’,y’)
[~, id] = sortrows(xy)
gives the answer of
id = [1;3;2;4];
I’m hoping to obtain the ‘typewriter’ answer of
id = [3, 4; 1, 2]
or something similar that tells me the third element of the table is the upper left, etc. The eventual goal is to combine elevation .tiff in the correct order to form a coherent dataset from northwest to southeast.
I feel like this should be a simple solution, but I’m delving into loops and logic and feel like I’m missing something easy.
Thanks in advance.say I have the following two arrays:
x=[1.01 2.01 1.02 2.02];
y=[1.01 1.02 2.01 2.02];
sorting these rows using
xy = table(x’,y’)
[~, id] = sortrows(xy)
gives the answer of
id = [1;3;2;4];
I’m hoping to obtain the ‘typewriter’ answer of
id = [3, 4; 1, 2]
or something similar that tells me the third element of the table is the upper left, etc. The eventual goal is to combine elevation .tiff in the correct order to form a coherent dataset from northwest to southeast.
I feel like this should be a simple solution, but I’m delving into loops and logic and feel like I’m missing something easy.
Thanks in advance. say I have the following two arrays:
x=[1.01 2.01 1.02 2.02];
y=[1.01 1.02 2.01 2.02];
sorting these rows using
xy = table(x’,y’)
[~, id] = sortrows(xy)
gives the answer of
id = [1;3;2;4];
I’m hoping to obtain the ‘typewriter’ answer of
id = [3, 4; 1, 2]
or something similar that tells me the third element of the table is the upper left, etc. The eventual goal is to combine elevation .tiff in the correct order to form a coherent dataset from northwest to southeast.
I feel like this should be a simple solution, but I’m delving into loops and logic and feel like I’m missing something easy.
Thanks in advance. sorting, array MATLAB Answers — New Questions
Placing circles on the ends of a vector
So I’m creating a movie model using data which describes a vector changing over time. I have the vector anchored at the origin and the head moves around according to the vector data. Because this is a bead-spring model, I want to graphically represent the beads by plotting circles at both ends of the vector. The problem I’m running into is that the bead that should be on the head of the vector is always offset by a certain amount. I can’t seem to figure out why it doesn’t have the same co-ords as the vector.
data = xlsread(‘C:UsersUserDocumentsMATLABData_Test.xlsx’,’Sheet1′);
t_s = data(:,1);
x_s = data(:,2);
y_s = data(:,3);
z_s = data(:,4);
d_s = size(t_s);
writerObj = VideoWriter(‘polymer.avi’);
open(writerObj);
for j = 1:d_s(1)
time = t_s(j);
x = x_s(j);
x1 = x*1000000;
y = y_s(j);
y1 = y*1000000;
z = z_s(j);
z1 = z*1000000;
h = quiver3(0, 0, 0, x1, y1, z1 );
set(h, ‘ShowArrowHead’, ‘off’);
axis([-5 15 -5 15 -5 15 3 5]);
title(‘it{Polymer Vibration}’,’FontSize’,16)
xlabel(‘x10^6′,’FontSize’,12);
ylabel(‘x10^6′,’FontSize’,12);
zlabel(‘x10^6′,’FontSize’,12);
timestamp_str = [‘t = ‘ num2str(time) ‘seconds’];
annotation(‘textbox’, [.05 .85 .1 .1],…
‘String’, timestamp_str);
hold all;
x2 = [0, x1];
y2 = [0, y1];
z2 = [0, z1];
scatter3( x2, y2, z2);
F(j) = getframe(gcf);
frame = getframe(gcf);
writeVideo(writerObj, frame);
clf;
disp([num2str(j) ‘ / ‘ num2str(d_s(1))])
end
movie(F);
close(writerObj);
An image of the problem I’m having:
<<http://i.imgur.com/JS1wp26.png>>So I’m creating a movie model using data which describes a vector changing over time. I have the vector anchored at the origin and the head moves around according to the vector data. Because this is a bead-spring model, I want to graphically represent the beads by plotting circles at both ends of the vector. The problem I’m running into is that the bead that should be on the head of the vector is always offset by a certain amount. I can’t seem to figure out why it doesn’t have the same co-ords as the vector.
data = xlsread(‘C:UsersUserDocumentsMATLABData_Test.xlsx’,’Sheet1′);
t_s = data(:,1);
x_s = data(:,2);
y_s = data(:,3);
z_s = data(:,4);
d_s = size(t_s);
writerObj = VideoWriter(‘polymer.avi’);
open(writerObj);
for j = 1:d_s(1)
time = t_s(j);
x = x_s(j);
x1 = x*1000000;
y = y_s(j);
y1 = y*1000000;
z = z_s(j);
z1 = z*1000000;
h = quiver3(0, 0, 0, x1, y1, z1 );
set(h, ‘ShowArrowHead’, ‘off’);
axis([-5 15 -5 15 -5 15 3 5]);
title(‘it{Polymer Vibration}’,’FontSize’,16)
xlabel(‘x10^6′,’FontSize’,12);
ylabel(‘x10^6′,’FontSize’,12);
zlabel(‘x10^6′,’FontSize’,12);
timestamp_str = [‘t = ‘ num2str(time) ‘seconds’];
annotation(‘textbox’, [.05 .85 .1 .1],…
‘String’, timestamp_str);
hold all;
x2 = [0, x1];
y2 = [0, y1];
z2 = [0, z1];
scatter3( x2, y2, z2);
F(j) = getframe(gcf);
frame = getframe(gcf);
writeVideo(writerObj, frame);
clf;
disp([num2str(j) ‘ / ‘ num2str(d_s(1))])
end
movie(F);
close(writerObj);
An image of the problem I’m having:
<<http://i.imgur.com/JS1wp26.png>> So I’m creating a movie model using data which describes a vector changing over time. I have the vector anchored at the origin and the head moves around according to the vector data. Because this is a bead-spring model, I want to graphically represent the beads by plotting circles at both ends of the vector. The problem I’m running into is that the bead that should be on the head of the vector is always offset by a certain amount. I can’t seem to figure out why it doesn’t have the same co-ords as the vector.
data = xlsread(‘C:UsersUserDocumentsMATLABData_Test.xlsx’,’Sheet1′);
t_s = data(:,1);
x_s = data(:,2);
y_s = data(:,3);
z_s = data(:,4);
d_s = size(t_s);
writerObj = VideoWriter(‘polymer.avi’);
open(writerObj);
for j = 1:d_s(1)
time = t_s(j);
x = x_s(j);
x1 = x*1000000;
y = y_s(j);
y1 = y*1000000;
z = z_s(j);
z1 = z*1000000;
h = quiver3(0, 0, 0, x1, y1, z1 );
set(h, ‘ShowArrowHead’, ‘off’);
axis([-5 15 -5 15 -5 15 3 5]);
title(‘it{Polymer Vibration}’,’FontSize’,16)
xlabel(‘x10^6′,’FontSize’,12);
ylabel(‘x10^6′,’FontSize’,12);
zlabel(‘x10^6′,’FontSize’,12);
timestamp_str = [‘t = ‘ num2str(time) ‘seconds’];
annotation(‘textbox’, [.05 .85 .1 .1],…
‘String’, timestamp_str);
hold all;
x2 = [0, x1];
y2 = [0, y1];
z2 = [0, z1];
scatter3( x2, y2, z2);
F(j) = getframe(gcf);
frame = getframe(gcf);
writeVideo(writerObj, frame);
clf;
disp([num2str(j) ‘ / ‘ num2str(d_s(1))])
end
movie(F);
close(writerObj);
An image of the problem I’m having:
<<http://i.imgur.com/JS1wp26.png>> plot quiver scatter MATLAB Answers — New Questions
How to translate MATLAB’s euler angle quadrotor equations into body frame?
In the following MIT lecture notes Equation (6.10) is given with body-frame angular velocities, whereas in this Matlab tutorial, the equations are given in euler angles. I have tried, using cross product properties, to translate between the two. The two equation presentations are given in detail in this post, I was unable to move the latex expressions over to Matlab’s latex editor.In the following MIT lecture notes Equation (6.10) is given with body-frame angular velocities, whereas in this Matlab tutorial, the equations are given in euler angles. I have tried, using cross product properties, to translate between the two. The two equation presentations are given in detail in this post, I was unable to move the latex expressions over to Matlab’s latex editor. In the following MIT lecture notes Equation (6.10) is given with body-frame angular velocities, whereas in this Matlab tutorial, the equations are given in euler angles. I have tried, using cross product properties, to translate between the two. The two equation presentations are given in detail in this post, I was unable to move the latex expressions over to Matlab’s latex editor. control, mathematics, equation, matrix manipulation MATLAB Answers — New Questions
How to create a transparent, rectangular patch with rounded corners?
It would be helpful to create a transparent, rectangular patch with rounded corners. This could be acheived with something like this:
h = rectangle(‘Position’, [x1, y1, x2, y2], …
‘Curvature’, 0.2, …
‘FaceColor’, ‘r’, …
‘EdgeColor’, ‘r’);
Unfortunately, rectangle properties do not include FaceAlpha and EdgeAlpha. Patch objects do, so I thought that I could get the XData and YData properties of the rectangle object from which to create a patch object. No dice; wasn’t able to find these properties.
Again, the desired features are: transparency + rounded corners + face colorIt would be helpful to create a transparent, rectangular patch with rounded corners. This could be acheived with something like this:
h = rectangle(‘Position’, [x1, y1, x2, y2], …
‘Curvature’, 0.2, …
‘FaceColor’, ‘r’, …
‘EdgeColor’, ‘r’);
Unfortunately, rectangle properties do not include FaceAlpha and EdgeAlpha. Patch objects do, so I thought that I could get the XData and YData properties of the rectangle object from which to create a patch object. No dice; wasn’t able to find these properties.
Again, the desired features are: transparency + rounded corners + face color It would be helpful to create a transparent, rectangular patch with rounded corners. This could be acheived with something like this:
h = rectangle(‘Position’, [x1, y1, x2, y2], …
‘Curvature’, 0.2, …
‘FaceColor’, ‘r’, …
‘EdgeColor’, ‘r’);
Unfortunately, rectangle properties do not include FaceAlpha and EdgeAlpha. Patch objects do, so I thought that I could get the XData and YData properties of the rectangle object from which to create a patch object. No dice; wasn’t able to find these properties.
Again, the desired features are: transparency + rounded corners + face color rectangle, patch MATLAB Answers — New Questions
In MATLAB ..Am doing research in melanoma skin cancer detection..In ABCD rule: how to find color value??
for C-Color i need to find the presence of white, red, lightbrown, darkbrown, blue-gray, black colors in my lesion image..A score of one is assigned on presence of each colour in the image..have to return the count of color that is range from 0 to 6.how to do that??for C-Color i need to find the presence of white, red, lightbrown, darkbrown, blue-gray, black colors in my lesion image..A score of one is assigned on presence of each colour in the image..have to return the count of color that is range from 0 to 6.how to do that?? for C-Color i need to find the presence of white, red, lightbrown, darkbrown, blue-gray, black colors in my lesion image..A score of one is assigned on presence of each colour in the image..have to return the count of color that is range from 0 to 6.how to do that?? abcd rule – color, skin cancer, melanoma, cancer MATLAB Answers — New Questions
‘Text’ must be character vector issue in app designer
Hi, I’m quite new to MATLAB so please bear with me. I’m assigning the values produced by MATRIX_VALUES from a seperate script to the button names seen below, but I keep getting an ‘Text’ must be a character vector error on the btn.Text = C{i} line. MATRIX_VALUES(); is a 4×4, and I shaped it to a 1×16 vector, which should fit the loop conditions fine, but I keep getting this error. Any help would be massively appreicated, thanks.
MATRIX_VALUES();
x = reshape(FINAL_Shuffled_Columns,1,[]);
C = {x}; %Making a cell with the matrix of values from MATRIX_VALUES
mybuttons = {app.Button1,app.Button2,app.Button3,app.Button4,…
app.Button5,app.Button6,app.Button7,app.Button8,…
app.Button9,app.Button10,app.Button11,app.Button12,…
app.Button13,app.Button14,app.Button15,app.Button16};
for i = 1:16
btn = mybuttons{i};
btn.Text = C{i};
endHi, I’m quite new to MATLAB so please bear with me. I’m assigning the values produced by MATRIX_VALUES from a seperate script to the button names seen below, but I keep getting an ‘Text’ must be a character vector error on the btn.Text = C{i} line. MATRIX_VALUES(); is a 4×4, and I shaped it to a 1×16 vector, which should fit the loop conditions fine, but I keep getting this error. Any help would be massively appreicated, thanks.
MATRIX_VALUES();
x = reshape(FINAL_Shuffled_Columns,1,[]);
C = {x}; %Making a cell with the matrix of values from MATRIX_VALUES
mybuttons = {app.Button1,app.Button2,app.Button3,app.Button4,…
app.Button5,app.Button6,app.Button7,app.Button8,…
app.Button9,app.Button10,app.Button11,app.Button12,…
app.Button13,app.Button14,app.Button15,app.Button16};
for i = 1:16
btn = mybuttons{i};
btn.Text = C{i};
end Hi, I’m quite new to MATLAB so please bear with me. I’m assigning the values produced by MATRIX_VALUES from a seperate script to the button names seen below, but I keep getting an ‘Text’ must be a character vector error on the btn.Text = C{i} line. MATRIX_VALUES(); is a 4×4, and I shaped it to a 1×16 vector, which should fit the loop conditions fine, but I keep getting this error. Any help would be massively appreicated, thanks.
MATRIX_VALUES();
x = reshape(FINAL_Shuffled_Columns,1,[]);
C = {x}; %Making a cell with the matrix of values from MATRIX_VALUES
mybuttons = {app.Button1,app.Button2,app.Button3,app.Button4,…
app.Button5,app.Button6,app.Button7,app.Button8,…
app.Button9,app.Button10,app.Button11,app.Button12,…
app.Button13,app.Button14,app.Button15,app.Button16};
for i = 1:16
btn = mybuttons{i};
btn.Text = C{i};
end appdesigner, button MATLAB Answers — New Questions
How to change distance between groups of bars in a bar plot?
I have 3 sets of data that I am plotting using ‘bar’. This generates sets of grouped bars. I know one can change the width of bars such that within a group they have some gap between them.
But how do I change the distance between groups of bars? I could not find any solution online, except calculating the x coordinates by yourself and plotting each dataset separately. If that’s the only way, Mathworks should do something about it!I have 3 sets of data that I am plotting using ‘bar’. This generates sets of grouped bars. I know one can change the width of bars such that within a group they have some gap between them.
But how do I change the distance between groups of bars? I could not find any solution online, except calculating the x coordinates by yourself and plotting each dataset separately. If that’s the only way, Mathworks should do something about it! I have 3 sets of data that I am plotting using ‘bar’. This generates sets of grouped bars. I know one can change the width of bars such that within a group they have some gap between them.
But how do I change the distance between groups of bars? I could not find any solution online, except calculating the x coordinates by yourself and plotting each dataset separately. If that’s the only way, Mathworks should do something about it! barplot, group, bar, width, distance MATLAB Answers — New Questions
Is it possible to make ‘uisetcolor’ integrated in GUI?
Hi
I’m trying to build ‘uisetcolor’ into my GUI.
At the moment, if I run my GUI, the ‘uisetcolor’ pops up in a seperate window. See below.
What do I need to do in order to make it shown in my GUI interface rather than a stand-alone window?
If you noticed that my uisetcolor interface looks different to the one you know that is because i’m using matlab 2018a so uisetcolor is missing the gradient color picker which is only available in the later matlab version such as 2018b.
Please help.Hi
I’m trying to build ‘uisetcolor’ into my GUI.
At the moment, if I run my GUI, the ‘uisetcolor’ pops up in a seperate window. See below.
What do I need to do in order to make it shown in my GUI interface rather than a stand-alone window?
If you noticed that my uisetcolor interface looks different to the one you know that is because i’m using matlab 2018a so uisetcolor is missing the gradient color picker which is only available in the later matlab version such as 2018b.
Please help. Hi
I’m trying to build ‘uisetcolor’ into my GUI.
At the moment, if I run my GUI, the ‘uisetcolor’ pops up in a seperate window. See below.
What do I need to do in order to make it shown in my GUI interface rather than a stand-alone window?
If you noticed that my uisetcolor interface looks different to the one you know that is because i’m using matlab 2018a so uisetcolor is missing the gradient color picker which is only available in the later matlab version such as 2018b.
Please help. uisetcolor, color picker MATLAB Answers — New Questions
Test connection error in the setup process of Arduino support package for Simulink with Arduino Nano 33 BLE board
Hello Everyone,
I’m facing an error with the last step of the setup process in Arduino Support Package for Simulink. In the Test Connection, the Build is done successfully while the Download (ensures the connection between PC and board) fails. I tried solving the issue by following: Post 1 and Post 2 but the issue still persists. The log file outputs:
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
�[92mUsed platform�[0m �[92mVersion�[0m �[90mPath�[0m
�[93marduino:avr�[0m 1.8.3 �[90mC:ProgramDataMATLABSupportPackagesR2024aaCLIdatapackagesarduinohardwareavr1.8.3�[0m
Any suggestions?
Thank you!Hello Everyone,
I’m facing an error with the last step of the setup process in Arduino Support Package for Simulink. In the Test Connection, the Build is done successfully while the Download (ensures the connection between PC and board) fails. I tried solving the issue by following: Post 1 and Post 2 but the issue still persists. The log file outputs:
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
�[92mUsed platform�[0m �[92mVersion�[0m �[90mPath�[0m
�[93marduino:avr�[0m 1.8.3 �[90mC:ProgramDataMATLABSupportPackagesR2024aaCLIdatapackagesarduinohardwareavr1.8.3�[0m
Any suggestions?
Thank you! Hello Everyone,
I’m facing an error with the last step of the setup process in Arduino Support Package for Simulink. In the Test Connection, the Build is done successfully while the Download (ensures the connection between PC and board) fails. I tried solving the issue by following: Post 1 and Post 2 but the issue still persists. The log file outputs:
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
�[92mUsed platform�[0m �[92mVersion�[0m �[90mPath�[0m
�[93marduino:avr�[0m 1.8.3 �[90mC:ProgramDataMATLABSupportPackagesR2024aaCLIdatapackagesarduinohardwareavr1.8.3�[0m
Any suggestions?
Thank you! arduino, simulink MATLAB Answers — New Questions
pie chart creation with name (number) and corresponding percentage
Hi! I would like to create a pie chart like in the present demo:
x = [1,2,3];
p = pie(x);
pText = findobj(p,’Type’,’text’);
percentValues = get(pText,’String’);
txt = {‘Item A: ‘;’Item B: ‘;’Item C: ‘};
combinedtxt = strcat(txt,percentValues);
pText(1).String = combinedtxt(1);
pText(2).String = combinedtxt(2);
pText(3).String = combinedtxt(3);
How can I achieve the same result with my data?
I tried it this way:
number = [78;79;80;81;82;83;84;85;86;87;88]’;
value = [4509;5239;6400;9074;11047;13147;15137;13909;6354;1152;183]’;
number2 = {};
for K = 1:height(number)
number1 = sprintf(‘%.0f’,number(K));
number2 = [number2,{number1}];
end
number2 = number2.’;
p = pie(value);
pText = findobj(p,’Type’,’text’);
percentValues = get(pText,’String’);
combinedtxt = strcat(number2,percentValues);
for K = 1:height(value)
pText(K).String = combinedtxt(K);
endHi! I would like to create a pie chart like in the present demo:
x = [1,2,3];
p = pie(x);
pText = findobj(p,’Type’,’text’);
percentValues = get(pText,’String’);
txt = {‘Item A: ‘;’Item B: ‘;’Item C: ‘};
combinedtxt = strcat(txt,percentValues);
pText(1).String = combinedtxt(1);
pText(2).String = combinedtxt(2);
pText(3).String = combinedtxt(3);
How can I achieve the same result with my data?
I tried it this way:
number = [78;79;80;81;82;83;84;85;86;87;88]’;
value = [4509;5239;6400;9074;11047;13147;15137;13909;6354;1152;183]’;
number2 = {};
for K = 1:height(number)
number1 = sprintf(‘%.0f’,number(K));
number2 = [number2,{number1}];
end
number2 = number2.’;
p = pie(value);
pText = findobj(p,’Type’,’text’);
percentValues = get(pText,’String’);
combinedtxt = strcat(number2,percentValues);
for K = 1:height(value)
pText(K).String = combinedtxt(K);
end Hi! I would like to create a pie chart like in the present demo:
x = [1,2,3];
p = pie(x);
pText = findobj(p,’Type’,’text’);
percentValues = get(pText,’String’);
txt = {‘Item A: ‘;’Item B: ‘;’Item C: ‘};
combinedtxt = strcat(txt,percentValues);
pText(1).String = combinedtxt(1);
pText(2).String = combinedtxt(2);
pText(3).String = combinedtxt(3);
How can I achieve the same result with my data?
I tried it this way:
number = [78;79;80;81;82;83;84;85;86;87;88]’;
value = [4509;5239;6400;9074;11047;13147;15137;13909;6354;1152;183]’;
number2 = {};
for K = 1:height(number)
number1 = sprintf(‘%.0f’,number(K));
number2 = [number2,{number1}];
end
number2 = number2.’;
p = pie(value);
pText = findobj(p,’Type’,’text’);
percentValues = get(pText,’String’);
combinedtxt = strcat(number2,percentValues);
for K = 1:height(value)
pText(K).String = combinedtxt(K);
end pie, chart MATLAB Answers — New Questions
State Flow C Action Language Bitwise Operators
I am trying to use bitwise operators to AND as well as OR an uint value with an int value in stateflow with C action language. I need to use 32 bit values but the results appear to be incorrect with 32 bit values, while 8-, 16-, and 64- bit values all seem to give correct results. Image below shows the stateflow chart and correct results using 16 bit values vs incorrect results with 32 bit values. Am I missing something? Or is this a known issue?I am trying to use bitwise operators to AND as well as OR an uint value with an int value in stateflow with C action language. I need to use 32 bit values but the results appear to be incorrect with 32 bit values, while 8-, 16-, and 64- bit values all seem to give correct results. Image below shows the stateflow chart and correct results using 16 bit values vs incorrect results with 32 bit values. Am I missing something? Or is this a known issue? I am trying to use bitwise operators to AND as well as OR an uint value with an int value in stateflow with C action language. I need to use 32 bit values but the results appear to be incorrect with 32 bit values, while 8-, 16-, and 64- bit values all seem to give correct results. Image below shows the stateflow chart and correct results using 16 bit values vs incorrect results with 32 bit values. Am I missing something? Or is this a known issue? bitwise, stateflow, int, uint, and, or MATLAB Answers — New Questions
Need input on 508 compliant colors in MATLAB
Hi
I am putting together a training class to inform fellows/staff where to find the 508 compliant accessible color schemes in
various programs. I would like to include MATLAB in the class.
I don’t use the program myself, so can you point me to a set or multiple sets of colors that are 508 compliant?
Thank you,
Deb CroteauHi
I am putting together a training class to inform fellows/staff where to find the 508 compliant accessible color schemes in
various programs. I would like to include MATLAB in the class.
I don’t use the program myself, so can you point me to a set or multiple sets of colors that are 508 compliant?
Thank you,
Deb Croteau Hi
I am putting together a training class to inform fellows/staff where to find the 508 compliant accessible color schemes in
various programs. I would like to include MATLAB in the class.
I don’t use the program myself, so can you point me to a set or multiple sets of colors that are 508 compliant?
Thank you,
Deb Croteau 508 color compliant schemes MATLAB Answers — New Questions
How do I fix a duplicate name error ?
I am using the simBiology builder app on matlab. I keep receiving an error on one of my models of a duplicate name error ( names are SSRI, SERT, 5-HT ) However, it doesn’t say how to fix it. I have to models in this project and only one has this issue. How do I fix it?I am using the simBiology builder app on matlab. I keep receiving an error on one of my models of a duplicate name error ( names are SSRI, SERT, 5-HT ) However, it doesn’t say how to fix it. I have to models in this project and only one has this issue. How do I fix it? I am using the simBiology builder app on matlab. I keep receiving an error on one of my models of a duplicate name error ( names are SSRI, SERT, 5-HT ) However, it doesn’t say how to fix it. I have to models in this project and only one has this issue. How do I fix it? matlab, simbiology MATLAB Answers — New Questions
Converting a three-column set of data to xyf matrix suitable for a contour plot
I have a set of data (the output of a CFD calculation) that consists of three columns x and y showing location and a third column that we call f which contains the values of the variable calculated for every specific xy location. I want to convert this array to a 2D matrix where x and y are now in the horizontal and vertical directions. Some data points simply do not exist because they are outside of the domain boundaries.
So basically, what I need to do is this (where the black cells are the ones for which the original dataset has no values.):I have a set of data (the output of a CFD calculation) that consists of three columns x and y showing location and a third column that we call f which contains the values of the variable calculated for every specific xy location. I want to convert this array to a 2D matrix where x and y are now in the horizontal and vertical directions. Some data points simply do not exist because they are outside of the domain boundaries.
So basically, what I need to do is this (where the black cells are the ones for which the original dataset has no values.): I have a set of data (the output of a CFD calculation) that consists of three columns x and y showing location and a third column that we call f which contains the values of the variable calculated for every specific xy location. I want to convert this array to a 2D matrix where x and y are now in the horizontal and vertical directions. Some data points simply do not exist because they are outside of the domain boundaries.
So basically, what I need to do is this (where the black cells are the ones for which the original dataset has no values.): resize, columns, matrix, contours plots MATLAB Answers — New Questions