Tag Archives: matlab
Calculating UACI, NPCR for 2 images
Presently I have a problem in implementing the UACI and PSNR code for 2 images which are respectively Original & Cipher Images. I need the code for calculating it……
What would the Code? I don’t have much idea about it..
Do I need to find UACI between 2 images or only 1 image will be sufficientPresently I have a problem in implementing the UACI and PSNR code for 2 images which are respectively Original & Cipher Images. I need the code for calculating it……
What would the Code? I don’t have much idea about it..
Do I need to find UACI between 2 images or only 1 image will be sufficient Presently I have a problem in implementing the UACI and PSNR code for 2 images which are respectively Original & Cipher Images. I need the code for calculating it……
What would the Code? I don’t have much idea about it..
Do I need to find UACI between 2 images or only 1 image will be sufficient uaci, psnr calculation MATLAB Answers — New Questions
Help with MATLAB symbolic toolbox
Hi there everyone,
I need some help with using the MATLAB symbolic tool box.
I have some symbolic expressions to manipulate and I am getting quite frustrated.
I have the paticular solution to a differential equation and need to find the coefficients C1 and C2.
% Set up symbolic variables
syms t C1 C2
% Set up parameters
K = 2.2167e+06;
M = 45.96;
wn = sqrt(K/M)
c = 0.5
% set up quadratic terms
a = 1
b = 2*c*wn
c = wn^2
% Solve for u
u1 = (-b + sqrt(b^2 – 4*a*c))/2
u2 = (-b – sqrt(b^2 – 4*a*c))/2
% Particalular solution to differential equation
yp = vpa(exp(-43.1357*t)*(C1*cos(74.7132*t) + C2*sin(74.7132*t)) == 0,4)
% The first derivitive of yp
dyp = vpa(diff(yp),4)
% Find the value of C1 interm of C2
C1 = vpa(solve(yp, C1),4)
% Sub C1 into equation dyp to have an expression in terms of C2 alone
eq = vpa(subs(dyp,C2,C1),4)
As you can see I obtain the value of C1 in terms of C2. I then want to plug this into equation "dyp". However, when I run the code for "eq", C1 is still in the expression. The expression should contain just C2’s, and this is really frustrating. If equation "eq" contains just C2 values I can then solve for C2 – I hope this makes sense.
Is there a way around this. I have not very good at plug and chucking with long and messy equatons, so I am hoping MATLAB can help me out.
Thanks in advance,
ScottHi there everyone,
I need some help with using the MATLAB symbolic tool box.
I have some symbolic expressions to manipulate and I am getting quite frustrated.
I have the paticular solution to a differential equation and need to find the coefficients C1 and C2.
% Set up symbolic variables
syms t C1 C2
% Set up parameters
K = 2.2167e+06;
M = 45.96;
wn = sqrt(K/M)
c = 0.5
% set up quadratic terms
a = 1
b = 2*c*wn
c = wn^2
% Solve for u
u1 = (-b + sqrt(b^2 – 4*a*c))/2
u2 = (-b – sqrt(b^2 – 4*a*c))/2
% Particalular solution to differential equation
yp = vpa(exp(-43.1357*t)*(C1*cos(74.7132*t) + C2*sin(74.7132*t)) == 0,4)
% The first derivitive of yp
dyp = vpa(diff(yp),4)
% Find the value of C1 interm of C2
C1 = vpa(solve(yp, C1),4)
% Sub C1 into equation dyp to have an expression in terms of C2 alone
eq = vpa(subs(dyp,C2,C1),4)
As you can see I obtain the value of C1 in terms of C2. I then want to plug this into equation "dyp". However, when I run the code for "eq", C1 is still in the expression. The expression should contain just C2’s, and this is really frustrating. If equation "eq" contains just C2 values I can then solve for C2 – I hope this makes sense.
Is there a way around this. I have not very good at plug and chucking with long and messy equatons, so I am hoping MATLAB can help me out.
Thanks in advance,
Scott Hi there everyone,
I need some help with using the MATLAB symbolic tool box.
I have some symbolic expressions to manipulate and I am getting quite frustrated.
I have the paticular solution to a differential equation and need to find the coefficients C1 and C2.
% Set up symbolic variables
syms t C1 C2
% Set up parameters
K = 2.2167e+06;
M = 45.96;
wn = sqrt(K/M)
c = 0.5
% set up quadratic terms
a = 1
b = 2*c*wn
c = wn^2
% Solve for u
u1 = (-b + sqrt(b^2 – 4*a*c))/2
u2 = (-b – sqrt(b^2 – 4*a*c))/2
% Particalular solution to differential equation
yp = vpa(exp(-43.1357*t)*(C1*cos(74.7132*t) + C2*sin(74.7132*t)) == 0,4)
% The first derivitive of yp
dyp = vpa(diff(yp),4)
% Find the value of C1 interm of C2
C1 = vpa(solve(yp, C1),4)
% Sub C1 into equation dyp to have an expression in terms of C2 alone
eq = vpa(subs(dyp,C2,C1),4)
As you can see I obtain the value of C1 in terms of C2. I then want to plug this into equation "dyp". However, when I run the code for "eq", C1 is still in the expression. The expression should contain just C2’s, and this is really frustrating. If equation "eq" contains just C2 values I can then solve for C2 – I hope this makes sense.
Is there a way around this. I have not very good at plug and chucking with long and messy equatons, so I am hoping MATLAB can help me out.
Thanks in advance,
Scott symbolic MATLAB Answers — New Questions
error: Function definition is misplaced or improperly nested error?
I am defining a nested function (bicomp1) inside a function (biaxialcomp) whose output is to be minimised using the fmincon optimization function, but I get an error that this function is misplaced or improperly nested. What could be the problem with it?
function [Mux, Muy] = biaxialcomp(c,app,gc,gs,bar,n,i)
th = [10 20 30 40 50 60 70 80];
Mux = zeros(1,8);
Muy = zeros(1,8);
for iv = 1:8
% first potential scenario
if app.b*tand(th(iv)) < app.t
tt = app.b*sind(th(iv))+app.t*cosd(th(iv));
c_opt = fmincon(@bicomp1,c,[],[],[],[],0,tt);
function obj = bicomp1(c)
a = 0.8*c;
Xna = a/sind(th(iv));
fcu = 0.67*app.Fcu/gc;
…I am defining a nested function (bicomp1) inside a function (biaxialcomp) whose output is to be minimised using the fmincon optimization function, but I get an error that this function is misplaced or improperly nested. What could be the problem with it?
function [Mux, Muy] = biaxialcomp(c,app,gc,gs,bar,n,i)
th = [10 20 30 40 50 60 70 80];
Mux = zeros(1,8);
Muy = zeros(1,8);
for iv = 1:8
% first potential scenario
if app.b*tand(th(iv)) < app.t
tt = app.b*sind(th(iv))+app.t*cosd(th(iv));
c_opt = fmincon(@bicomp1,c,[],[],[],[],0,tt);
function obj = bicomp1(c)
a = 0.8*c;
Xna = a/sind(th(iv));
fcu = 0.67*app.Fcu/gc;
… I am defining a nested function (bicomp1) inside a function (biaxialcomp) whose output is to be minimised using the fmincon optimization function, but I get an error that this function is misplaced or improperly nested. What could be the problem with it?
function [Mux, Muy] = biaxialcomp(c,app,gc,gs,bar,n,i)
th = [10 20 30 40 50 60 70 80];
Mux = zeros(1,8);
Muy = zeros(1,8);
for iv = 1:8
% first potential scenario
if app.b*tand(th(iv)) < app.t
tt = app.b*sind(th(iv))+app.t*cosd(th(iv));
c_opt = fmincon(@bicomp1,c,[],[],[],[],0,tt);
function obj = bicomp1(c)
a = 0.8*c;
Xna = a/sind(th(iv));
fcu = 0.67*app.Fcu/gc;
… functions MATLAB Answers — New Questions
Viscircles. Example doesn’t work
I try to understand function Viscircles. But i can’t do it. I can’t to launch the example Clear Axes Before Plotting Circles. Where i can wrong?
figure
colors = {‘b’,’r’,’g’,’y’,’k’};
for k = 1:5
% Create 5 random circles to display,
X = rand(5,1);
Y = rand(5,1);
centers = [X Y];
radii = 0.1*rand(5,1);
% Clear the axes.
cla
% Fix the axis limits.
xlim([-0.1 1.1])
ylim([-0.1 1.1])
% Set the axis aspect ratio to 1:1.
axis square
% Set a title.
title([‘k = ‘ num2str(k)])
% Display the circles.
viscircles(centers,radii,’Color’,colors{k});
%% Error using viscircles>parseInputs (line 175) Unknown input string: Color.
%% Error in viscircles (line 67) [ax, centers, radii, options] = parseInputs(varargin{:});
% Pause for 1 second.
pause(1)
endI try to understand function Viscircles. But i can’t do it. I can’t to launch the example Clear Axes Before Plotting Circles. Where i can wrong?
figure
colors = {‘b’,’r’,’g’,’y’,’k’};
for k = 1:5
% Create 5 random circles to display,
X = rand(5,1);
Y = rand(5,1);
centers = [X Y];
radii = 0.1*rand(5,1);
% Clear the axes.
cla
% Fix the axis limits.
xlim([-0.1 1.1])
ylim([-0.1 1.1])
% Set the axis aspect ratio to 1:1.
axis square
% Set a title.
title([‘k = ‘ num2str(k)])
% Display the circles.
viscircles(centers,radii,’Color’,colors{k});
%% Error using viscircles>parseInputs (line 175) Unknown input string: Color.
%% Error in viscircles (line 67) [ax, centers, radii, options] = parseInputs(varargin{:});
% Pause for 1 second.
pause(1)
end I try to understand function Viscircles. But i can’t do it. I can’t to launch the example Clear Axes Before Plotting Circles. Where i can wrong?
figure
colors = {‘b’,’r’,’g’,’y’,’k’};
for k = 1:5
% Create 5 random circles to display,
X = rand(5,1);
Y = rand(5,1);
centers = [X Y];
radii = 0.1*rand(5,1);
% Clear the axes.
cla
% Fix the axis limits.
xlim([-0.1 1.1])
ylim([-0.1 1.1])
% Set the axis aspect ratio to 1:1.
axis square
% Set a title.
title([‘k = ‘ num2str(k)])
% Display the circles.
viscircles(centers,radii,’Color’,colors{k});
%% Error using viscircles>parseInputs (line 175) Unknown input string: Color.
%% Error in viscircles (line 67) [ax, centers, radii, options] = parseInputs(varargin{:});
% Pause for 1 second.
pause(1)
end viscircles MATLAB Answers — New Questions
Simmetrical Constraints in Multivariate Regression
Hi everyone!
This is my problem:
My data are related in this way: F = H*V + B*A where F is a 2xn matrix, V and A are 2xn matrices while H and B are 2×2 matrices.
H and B must be simmetrical.
I’ve already got F, V and A and I want to calculate H and B with a multivariate regression. How can I do it?
Thank you in advance!Hi everyone!
This is my problem:
My data are related in this way: F = H*V + B*A where F is a 2xn matrix, V and A are 2xn matrices while H and B are 2×2 matrices.
H and B must be simmetrical.
I’ve already got F, V and A and I want to calculate H and B with a multivariate regression. How can I do it?
Thank you in advance! Hi everyone!
This is my problem:
My data are related in this way: F = H*V + B*A where F is a 2xn matrix, V and A are 2xn matrices while H and B are 2×2 matrices.
H and B must be simmetrical.
I’ve already got F, V and A and I want to calculate H and B with a multivariate regression. How can I do it?
Thank you in advance! regression, matrices MATLAB Answers — New Questions
Finding the percentile of a time series
Dear all,
I hope this finds you well.
I had a question concerning quantiles/percentiles. I want to know the 90th percentile of my time series, because I want to use that value as a threshold later on.
Is it enough to use the quantile() or the prctile() commands on my data set, or do I have to go with a different approach that involves sorting my data, finding the standard deviation, etc. or Find the distribution of my data then look at the tails?
Also my time series has NaNs in them. Not sure if that affects the commands.
This is a dropbox link to my data:
https://www.dropbox.com/s/k838d1ww0wj5s38/Help-Data.mat?dl=0
Thank You!!Dear all,
I hope this finds you well.
I had a question concerning quantiles/percentiles. I want to know the 90th percentile of my time series, because I want to use that value as a threshold later on.
Is it enough to use the quantile() or the prctile() commands on my data set, or do I have to go with a different approach that involves sorting my data, finding the standard deviation, etc. or Find the distribution of my data then look at the tails?
Also my time series has NaNs in them. Not sure if that affects the commands.
This is a dropbox link to my data:
https://www.dropbox.com/s/k838d1ww0wj5s38/Help-Data.mat?dl=0
Thank You!! Dear all,
I hope this finds you well.
I had a question concerning quantiles/percentiles. I want to know the 90th percentile of my time series, because I want to use that value as a threshold later on.
Is it enough to use the quantile() or the prctile() commands on my data set, or do I have to go with a different approach that involves sorting my data, finding the standard deviation, etc. or Find the distribution of my data then look at the tails?
Also my time series has NaNs in them. Not sure if that affects the commands.
This is a dropbox link to my data:
https://www.dropbox.com/s/k838d1ww0wj5s38/Help-Data.mat?dl=0
Thank You!! percentile, time series, noob, quantile MATLAB Answers — New Questions
How i can get the best option plot for density and also other graph ?
i saw a lot design of graph which color are change and make a plot very better and really i am looking for such option but i can’t manage the option and i don’t know which option is good can any one help me for get the best design of plotting?
% Define the grid
[x, y] = meshgrid(linspace(-10, 10, 400), linspace(-10, 10, 400));
% Define the function
Z = real(0.3e1 ./ 0.2e1 * (0.9375e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.50625e1 .* exp(0.15e1 * x – 0.2e1 * y)) ./ (0.1e1 + 0.15e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.225e1 .* exp(0.15e1 * x – 0.2e1 * y)) – 0.3e1 ./ 0.2e1 .* (0.375e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.3375e1 .* exp(0.15e1 * x – 0.2e1 * y)) .^ 2 ./ (0.1e1 + 0.15e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.225e1 .* exp(0.15e1 * x – 0.2e1 * y)) .^ 2);
% Create density plot
figure;
contourf(x, y, Z, 50, ‘LineStyle’, ‘none’);
colormap(prism);
xlabel(‘x’);
ylabel(‘y’);
title(‘Density Plot of Given Function’);i saw a lot design of graph which color are change and make a plot very better and really i am looking for such option but i can’t manage the option and i don’t know which option is good can any one help me for get the best design of plotting?
% Define the grid
[x, y] = meshgrid(linspace(-10, 10, 400), linspace(-10, 10, 400));
% Define the function
Z = real(0.3e1 ./ 0.2e1 * (0.9375e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.50625e1 .* exp(0.15e1 * x – 0.2e1 * y)) ./ (0.1e1 + 0.15e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.225e1 .* exp(0.15e1 * x – 0.2e1 * y)) – 0.3e1 ./ 0.2e1 .* (0.375e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.3375e1 .* exp(0.15e1 * x – 0.2e1 * y)) .^ 2 ./ (0.1e1 + 0.15e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.225e1 .* exp(0.15e1 * x – 0.2e1 * y)) .^ 2);
% Create density plot
figure;
contourf(x, y, Z, 50, ‘LineStyle’, ‘none’);
colormap(prism);
xlabel(‘x’);
ylabel(‘y’);
title(‘Density Plot of Given Function’); i saw a lot design of graph which color are change and make a plot very better and really i am looking for such option but i can’t manage the option and i don’t know which option is good can any one help me for get the best design of plotting?
% Define the grid
[x, y] = meshgrid(linspace(-10, 10, 400), linspace(-10, 10, 400));
% Define the function
Z = real(0.3e1 ./ 0.2e1 * (0.9375e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.50625e1 .* exp(0.15e1 * x – 0.2e1 * y)) ./ (0.1e1 + 0.15e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.225e1 .* exp(0.15e1 * x – 0.2e1 * y)) – 0.3e1 ./ 0.2e1 .* (0.375e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.3375e1 .* exp(0.15e1 * x – 0.2e1 * y)) .^ 2 ./ (0.1e1 + 0.15e1 .* exp(0.25e1 * x – 0.4761904763e0 * y) + 0.225e1 .* exp(0.15e1 * x – 0.2e1 * y)) .^ 2);
% Create density plot
figure;
contourf(x, y, Z, 50, ‘LineStyle’, ‘none’);
colormap(prism);
xlabel(‘x’);
ylabel(‘y’);
title(‘Density Plot of Given Function’); plotting MATLAB Answers — New Questions
Distributed and spmd not running faster
I think I’m missing something fundamental about using distributed arrays with spmd. If I run the following the distributed version takes ~0.04s while the non-distributed version completes in ~0.2s (with a process pool matching the cores on my machine).
x = ones(10000, 10000);
tic
x = x * 2.3;
toc
x
x = distributed(ones(10000, 10000));
tic
spmd
x = x * 2.3;
end
toc
gather(x)
What am I missing?
Edit: I moved the tic and toc to after the array initialization and before displaying x to not include that as I realized calling distributed is taking longer while it distributes the array across the processes and gather is taking time.I think I’m missing something fundamental about using distributed arrays with spmd. If I run the following the distributed version takes ~0.04s while the non-distributed version completes in ~0.2s (with a process pool matching the cores on my machine).
x = ones(10000, 10000);
tic
x = x * 2.3;
toc
x
x = distributed(ones(10000, 10000));
tic
spmd
x = x * 2.3;
end
toc
gather(x)
What am I missing?
Edit: I moved the tic and toc to after the array initialization and before displaying x to not include that as I realized calling distributed is taking longer while it distributes the array across the processes and gather is taking time. I think I’m missing something fundamental about using distributed arrays with spmd. If I run the following the distributed version takes ~0.04s while the non-distributed version completes in ~0.2s (with a process pool matching the cores on my machine).
x = ones(10000, 10000);
tic
x = x * 2.3;
toc
x
x = distributed(ones(10000, 10000));
tic
spmd
x = x * 2.3;
end
toc
gather(x)
What am I missing?
Edit: I moved the tic and toc to after the array initialization and before displaying x to not include that as I realized calling distributed is taking longer while it distributes the array across the processes and gather is taking time. distributed, parallel computing, spmd, parallel computing toolbox MATLAB Answers — New Questions
Matlab for auto logging into websites, populating web fields etc or go with Python
Hello all
I know that Matlab is suited for many engineering uses however i wanted the opinion of the community of using Matlab to run automated reports by extracting data from web sites as well as autologging into websites and populating data fields.
An idea i have is to use a Matlab GUI for a user to enter data, this data then opens a browser and populates various web fields.
I have been told that i should abandon the idea of using Matlab and go with Python.
Just wondering what the thoughts of the commuinty was?
Thank you.Hello all
I know that Matlab is suited for many engineering uses however i wanted the opinion of the community of using Matlab to run automated reports by extracting data from web sites as well as autologging into websites and populating data fields.
An idea i have is to use a Matlab GUI for a user to enter data, this data then opens a browser and populates various web fields.
I have been told that i should abandon the idea of using Matlab and go with Python.
Just wondering what the thoughts of the commuinty was?
Thank you. Hello all
I know that Matlab is suited for many engineering uses however i wanted the opinion of the community of using Matlab to run automated reports by extracting data from web sites as well as autologging into websites and populating data fields.
An idea i have is to use a Matlab GUI for a user to enter data, this data then opens a browser and populates various web fields.
I have been told that i should abandon the idea of using Matlab and go with Python.
Just wondering what the thoughts of the commuinty was?
Thank you. web, auto log in, matlab 2019 MATLAB Answers — New Questions
CPM Modulator Implementation Methods
In the comm.CPMModulator help, in the "More About > CPM Method", it says the output comes from a relation mentioned there.
But, the only way to get to the same output is by using FM Modulator method (using g(t) instead of q(t)).
I wonder if there is a way to get to the same output just by using that relation (using q(t)).
Thanks!In the comm.CPMModulator help, in the "More About > CPM Method", it says the output comes from a relation mentioned there.
But, the only way to get to the same output is by using FM Modulator method (using g(t) instead of q(t)).
I wonder if there is a way to get to the same output just by using that relation (using q(t)).
Thanks! In the comm.CPMModulator help, in the "More About > CPM Method", it says the output comes from a relation mentioned there.
But, the only way to get to the same output is by using FM Modulator method (using g(t) instead of q(t)).
I wonder if there is a way to get to the same output just by using that relation (using q(t)).
Thanks! cpm modulator, digital modulations, communications toolbox, wireless communications MATLAB Answers — New Questions
How do I multiplex 3 phase power system signals onto a single signal or generate a varying frequency voltage source
So I am trying to test a HVDC model’s response to a frequency deviation. I designed a quick model to output a balanced three phase voltage whose frequency profile I could control (see image attached). The trouble is that I get the voltage as three separate signals, but I need them as a single line. I’ve tried both generic muxes and physical signal converters, but they don’t connect (wrong signal type). Essentially what I want to do is the reverse of a phase splitter block but I can’t find a block that will do this.
Please reply if you have a solution to this problem or if you know of a different way to vary the frequency of a three phase voltage source.So I am trying to test a HVDC model’s response to a frequency deviation. I designed a quick model to output a balanced three phase voltage whose frequency profile I could control (see image attached). The trouble is that I get the voltage as three separate signals, but I need them as a single line. I’ve tried both generic muxes and physical signal converters, but they don’t connect (wrong signal type). Essentially what I want to do is the reverse of a phase splitter block but I can’t find a block that will do this.
Please reply if you have a solution to this problem or if you know of a different way to vary the frequency of a three phase voltage source. So I am trying to test a HVDC model’s response to a frequency deviation. I designed a quick model to output a balanced three phase voltage whose frequency profile I could control (see image attached). The trouble is that I get the voltage as three separate signals, but I need them as a single line. I’ve tried both generic muxes and physical signal converters, but they don’t connect (wrong signal type). Essentially what I want to do is the reverse of a phase splitter block but I can’t find a block that will do this.
Please reply if you have a solution to this problem or if you know of a different way to vary the frequency of a three phase voltage source. three phase, frequency, varying, mux, simpowersystems, power system, power_electronics_control, power_conversion_control MATLAB Answers — New Questions
website is not receiving data from ,y node mcu
I’m using a NodeMCU for my AQI project. Initially, everything was working fine, but now when I try to update, my ThingSpeak website isn’t showing any new data. It only shows my last entry from three months ago.
The serial monitor indicates ‘Data sent to ThingSpeak,’ but my channel is not displaying any updated data. Instead, it’s showing ‘Field value unavailable.I’m using a NodeMCU for my AQI project. Initially, everything was working fine, but now when I try to update, my ThingSpeak website isn’t showing any new data. It only shows my last entry from three months ago.
The serial monitor indicates ‘Data sent to ThingSpeak,’ but my channel is not displaying any updated data. Instead, it’s showing ‘Field value unavailable. I’m using a NodeMCU for my AQI project. Initially, everything was working fine, but now when I try to update, my ThingSpeak website isn’t showing any new data. It only shows my last entry from three months ago.
The serial monitor indicates ‘Data sent to ThingSpeak,’ but my channel is not displaying any updated data. Instead, it’s showing ‘Field value unavailable. data not received MATLAB Answers — New Questions
How to connect broken lines, but no enlarge line width?
I need to fill rectangle(run fill holes), but the broken lines in rectangle stop me to do this. due to the high density rectangles in figure, so I want to connect broken lines, but no enlarge line width. Could you help me?
I have tryed to do dilate/erode/open/close mask operations, but they all can’t meet my request.I need to fill rectangle(run fill holes), but the broken lines in rectangle stop me to do this. due to the high density rectangles in figure, so I want to connect broken lines, but no enlarge line width. Could you help me?
I have tryed to do dilate/erode/open/close mask operations, but they all can’t meet my request. I need to fill rectangle(run fill holes), but the broken lines in rectangle stop me to do this. due to the high density rectangles in figure, so I want to connect broken lines, but no enlarge line width. Could you help me?
I have tryed to do dilate/erode/open/close mask operations, but they all can’t meet my request. image processing, image segmentation MATLAB Answers — New Questions
Problem with converting uitable to table (array2table) with strange number of column names
Hello, I have a UITable that on startup has 4 columns.
I want to create some dummy data (3 columns) and play with the different save options (writecell, writematrix and writetable) to see which one handles NaNs the best and can save the column names.
I am hence steering towards writetable.
However, when I clear the table and re-enter my dummy data via:
uit=app.UITable;
uit.Data=[];
r = randi([0,10],10,3)
uit.Data = [r];
I notice that the number of column names is still 4 and not 3, yet the data size in columns is 3!
T=app.UITable;
vn=T.ColumnName
vn = %UITable Column Names
4×1 cell array
{‘Column 1’}
{‘Column 2’}
{‘Column 3’}
{‘Column 4’}
ans = % UITable Data size
10 3
hence the following fails
T = array2table(data, ‘VariableNames’,vn’)
Error using array2table
The VariableNames property must contain one name for each variable in the table.
Any suggestions please?
(and a 2nd question, most of the time my data is doubles, however occasionally its a cell array – when I want e.g. some text. I assume the only chnage I would need is when creating the table I would use cell2table instead of array2table?)Hello, I have a UITable that on startup has 4 columns.
I want to create some dummy data (3 columns) and play with the different save options (writecell, writematrix and writetable) to see which one handles NaNs the best and can save the column names.
I am hence steering towards writetable.
However, when I clear the table and re-enter my dummy data via:
uit=app.UITable;
uit.Data=[];
r = randi([0,10],10,3)
uit.Data = [r];
I notice that the number of column names is still 4 and not 3, yet the data size in columns is 3!
T=app.UITable;
vn=T.ColumnName
vn = %UITable Column Names
4×1 cell array
{‘Column 1’}
{‘Column 2’}
{‘Column 3’}
{‘Column 4’}
ans = % UITable Data size
10 3
hence the following fails
T = array2table(data, ‘VariableNames’,vn’)
Error using array2table
The VariableNames property must contain one name for each variable in the table.
Any suggestions please?
(and a 2nd question, most of the time my data is doubles, however occasionally its a cell array – when I want e.g. some text. I assume the only chnage I would need is when creating the table I would use cell2table instead of array2table?) Hello, I have a UITable that on startup has 4 columns.
I want to create some dummy data (3 columns) and play with the different save options (writecell, writematrix and writetable) to see which one handles NaNs the best and can save the column names.
I am hence steering towards writetable.
However, when I clear the table and re-enter my dummy data via:
uit=app.UITable;
uit.Data=[];
r = randi([0,10],10,3)
uit.Data = [r];
I notice that the number of column names is still 4 and not 3, yet the data size in columns is 3!
T=app.UITable;
vn=T.ColumnName
vn = %UITable Column Names
4×1 cell array
{‘Column 1’}
{‘Column 2’}
{‘Column 3’}
{‘Column 4’}
ans = % UITable Data size
10 3
hence the following fails
T = array2table(data, ‘VariableNames’,vn’)
Error using array2table
The VariableNames property must contain one name for each variable in the table.
Any suggestions please?
(and a 2nd question, most of the time my data is doubles, however occasionally its a cell array – when I want e.g. some text. I assume the only chnage I would need is when creating the table I would use cell2table instead of array2table?) uitable, array2table, writetable MATLAB Answers — New Questions
Who can give me a full answer of this question?
Write a program which repeatedly reads numbers until the user enters "done". Once "done" is
entered, print out the Max and Min. Use an array to store all the numbers. Example of execution:
Enter a number: 4
Enter a number: 5
Enter a number: 9
Enter a number: done
Max = 9, Min = 4Write a program which repeatedly reads numbers until the user enters "done". Once "done" is
entered, print out the Max and Min. Use an array to store all the numbers. Example of execution:
Enter a number: 4
Enter a number: 5
Enter a number: 9
Enter a number: done
Max = 9, Min = 4 Write a program which repeatedly reads numbers until the user enters "done". Once "done" is
entered, print out the Max and Min. Use an array to store all the numbers. Example of execution:
Enter a number: 4
Enter a number: 5
Enter a number: 9
Enter a number: done
Max = 9, Min = 4 homework MATLAB Answers — New Questions
Out of Memory during serialization of the subsystem data – reinforcement learning
Hi, during training (reinforcement learning), agents aren’t saved properly and this warning is given. What can be done to fix this? Training is done with parallel processing.Hi, during training (reinforcement learning), agents aren’t saved properly and this warning is given. What can be done to fix this? Training is done with parallel processing. Hi, during training (reinforcement learning), agents aren’t saved properly and this warning is given. What can be done to fix this? Training is done with parallel processing. reinforcement learning MATLAB Answers — New Questions
function pdepe coder generation
Hi all,
I am trying to generate a dynamic library file by using ‘coder’. When I trying to do it, there is an information said that the function ‘pdepe’ is not supported in code generation. I am wondering if there is any solution to it like a replacement of the ‘pdepe’ function or some other settings?
Thank you in advanceHi all,
I am trying to generate a dynamic library file by using ‘coder’. When I trying to do it, there is an information said that the function ‘pdepe’ is not supported in code generation. I am wondering if there is any solution to it like a replacement of the ‘pdepe’ function or some other settings?
Thank you in advance Hi all,
I am trying to generate a dynamic library file by using ‘coder’. When I trying to do it, there is an information said that the function ‘pdepe’ is not supported in code generation. I am wondering if there is any solution to it like a replacement of the ‘pdepe’ function or some other settings?
Thank you in advance code generation, pdepe, matlab, coder MATLAB Answers — New Questions
complex gaussian noise generation
how can i generate a complex gaussian noise with zero mean and some variance in matlab?how can i generate a complex gaussian noise with zero mean and some variance in matlab? how can i generate a complex gaussian noise with zero mean and some variance in matlab? a, f MATLAB Answers — New Questions
error with configuring android studio with matlab
So i have been trying to configure matlab to work with android studio for a project and i came across Simulink Support Package for Android Devices ,but when i try to configure it i get this error message. Does anyone know how to fix this
Build App
A problem occurred configuring root project ‘TestApp’. > Could not open cp_proj generic class cache for build file ‘C:UsersUserAppDataLocalTemptpee9cd55b_8ffa_4e98_82dc_4f945f5ab51cTestAppbuild.gradle’ (C:UsersUser.gradlecaches7.5scripts56lbh5pj36js9453y7f1h6iim). > BUG! exception in phase ‘semantic analysis’ in source unit ‘_BuildScript_’ Unsupported class file major version 65 *So i have been trying to configure matlab to work with android studio for a project and i came across Simulink Support Package for Android Devices ,but when i try to configure it i get this error message. Does anyone know how to fix this
Build App
A problem occurred configuring root project ‘TestApp’. > Could not open cp_proj generic class cache for build file ‘C:UsersUserAppDataLocalTemptpee9cd55b_8ffa_4e98_82dc_4f945f5ab51cTestAppbuild.gradle’ (C:UsersUser.gradlecaches7.5scripts56lbh5pj36js9453y7f1h6iim). > BUG! exception in phase ‘semantic analysis’ in source unit ‘_BuildScript_’ Unsupported class file major version 65 * So i have been trying to configure matlab to work with android studio for a project and i came across Simulink Support Package for Android Devices ,but when i try to configure it i get this error message. Does anyone know how to fix this
Build App
A problem occurred configuring root project ‘TestApp’. > Could not open cp_proj generic class cache for build file ‘C:UsersUserAppDataLocalTemptpee9cd55b_8ffa_4e98_82dc_4f945f5ab51cTestAppbuild.gradle’ (C:UsersUser.gradlecaches7.5scripts56lbh5pj36js9453y7f1h6iim). > BUG! exception in phase ‘semantic analysis’ in source unit ‘_BuildScript_’ Unsupported class file major version 65 * android studio MATLAB Answers — New Questions
how to set the browser of webread function?
Hi Matlab,
I plan to use webread to get the data from a website. I can open the website in Chrome, yet I get the message "The currently used browser has security risks". It seems the website prevents the default matlab browser to read the data. Is it possible to change the browser used by webread to Chrome?Hi Matlab,
I plan to use webread to get the data from a website. I can open the website in Chrome, yet I get the message "The currently used browser has security risks". It seems the website prevents the default matlab browser to read the data. Is it possible to change the browser used by webread to Chrome? Hi Matlab,
I plan to use webread to get the data from a website. I can open the website in Chrome, yet I get the message "The currently used browser has security risks". It seems the website prevents the default matlab browser to read the data. Is it possible to change the browser used by webread to Chrome? webread, browser MATLAB Answers — New Questions