Category: News
How to ploting input signal by “Digilent Analog Discovery Pro 3450”
I am currently trying to use a library to interface Analog Discovery with MATLAB. However, I am encountering an issue. I am practicing the Getting Started code from the Digilent toolbox, and there are no problems when using the Analog Discovery 2 (AD2_0) for Blocking Input Stream. However, when using the "Digilent Analog Discovery Pro 3450" (ADP3450_0), the Blocking Input Stream does not work. I have attached the plotted image below.
The plotting keeps getting stuck like the image below. How can I fix this? The code is as follows:
daqreset;
devices = daqlist %list devices
devices.DeviceInfo(1)
%Single Scan
Read data from 2 analog input channels the display data
daqreset;
dq = daq("digilent");
addinput(dq,"ADP3450_0", "ai0" ,’Voltage’);
addinput(dq,"ADP3450_0", "ai1" ,’Voltage’);
ss = read(dq)
%Blocking Input Stream
Read data for 2 analog input channels then plot
daqreset;
dq = daq("digilent");
addinput(dq, "ADP3450_0", "ai0" ,’Voltage’);
addinput(dq, "ADP3450_0", "ai1" ,’Voltage’);
systemRate = 1e8; %100Mhz max frequency for AD2_0
rDiv = uint32(1) % Rate divisor is expected to be integer
rate = systemRate/rDiv;
dq.Rate = rate; % 100Mhz
data = read(dq, 100);
figure(1);
title(‘Blocking Input Stream’);
xlabel(‘Samples’);
ylabel(‘Volts’);
plot([data.ADP3450_0_ai0, data.ADP3450_0_ai1]);I am currently trying to use a library to interface Analog Discovery with MATLAB. However, I am encountering an issue. I am practicing the Getting Started code from the Digilent toolbox, and there are no problems when using the Analog Discovery 2 (AD2_0) for Blocking Input Stream. However, when using the "Digilent Analog Discovery Pro 3450" (ADP3450_0), the Blocking Input Stream does not work. I have attached the plotted image below.
The plotting keeps getting stuck like the image below. How can I fix this? The code is as follows:
daqreset;
devices = daqlist %list devices
devices.DeviceInfo(1)
%Single Scan
Read data from 2 analog input channels the display data
daqreset;
dq = daq("digilent");
addinput(dq,"ADP3450_0", "ai0" ,’Voltage’);
addinput(dq,"ADP3450_0", "ai1" ,’Voltage’);
ss = read(dq)
%Blocking Input Stream
Read data for 2 analog input channels then plot
daqreset;
dq = daq("digilent");
addinput(dq, "ADP3450_0", "ai0" ,’Voltage’);
addinput(dq, "ADP3450_0", "ai1" ,’Voltage’);
systemRate = 1e8; %100Mhz max frequency for AD2_0
rDiv = uint32(1) % Rate divisor is expected to be integer
rate = systemRate/rDiv;
dq.Rate = rate; % 100Mhz
data = read(dq, 100);
figure(1);
title(‘Blocking Input Stream’);
xlabel(‘Samples’);
ylabel(‘Volts’);
plot([data.ADP3450_0_ai0, data.ADP3450_0_ai1]); I am currently trying to use a library to interface Analog Discovery with MATLAB. However, I am encountering an issue. I am practicing the Getting Started code from the Digilent toolbox, and there are no problems when using the Analog Discovery 2 (AD2_0) for Blocking Input Stream. However, when using the "Digilent Analog Discovery Pro 3450" (ADP3450_0), the Blocking Input Stream does not work. I have attached the plotted image below.
The plotting keeps getting stuck like the image below. How can I fix this? The code is as follows:
daqreset;
devices = daqlist %list devices
devices.DeviceInfo(1)
%Single Scan
Read data from 2 analog input channels the display data
daqreset;
dq = daq("digilent");
addinput(dq,"ADP3450_0", "ai0" ,’Voltage’);
addinput(dq,"ADP3450_0", "ai1" ,’Voltage’);
ss = read(dq)
%Blocking Input Stream
Read data for 2 analog input channels then plot
daqreset;
dq = daq("digilent");
addinput(dq, "ADP3450_0", "ai0" ,’Voltage’);
addinput(dq, "ADP3450_0", "ai1" ,’Voltage’);
systemRate = 1e8; %100Mhz max frequency for AD2_0
rDiv = uint32(1) % Rate divisor is expected to be integer
rate = systemRate/rDiv;
dq.Rate = rate; % 100Mhz
data = read(dq, 100);
figure(1);
title(‘Blocking Input Stream’);
xlabel(‘Samples’);
ylabel(‘Volts’);
plot([data.ADP3450_0_ai0, data.ADP3450_0_ai1]); digilent, data acquisition MATLAB Answers — New Questions
Optimization of EPANET network using GA toolkit
A pipe network distribution layout for irrigation purpose is prepared in EPANET. This network have 80 pipes and 80 nodes plus one reservoir Optimisation of pipe network for minimum cost is required to be done using GA tool box of MATLAB.
The pipe network (EPANET file i.e .inp file) needs to be coupled with MATLAB. And then the same network needs to be optimised. That means diameters of all 80 pipes need to be determined using GA tool box of MATLAB, such that it that will suffice the limiting conditions of design viz: minimum pressure head at outlet nodes must be at least 1 m and velocity in all pipes must be in between 0.6 and 1.8 m/s.
the set of commercially available diameters and there cost is available, need to use those diameters only.A pipe network distribution layout for irrigation purpose is prepared in EPANET. This network have 80 pipes and 80 nodes plus one reservoir Optimisation of pipe network for minimum cost is required to be done using GA tool box of MATLAB.
The pipe network (EPANET file i.e .inp file) needs to be coupled with MATLAB. And then the same network needs to be optimised. That means diameters of all 80 pipes need to be determined using GA tool box of MATLAB, such that it that will suffice the limiting conditions of design viz: minimum pressure head at outlet nodes must be at least 1 m and velocity in all pipes must be in between 0.6 and 1.8 m/s.
the set of commercially available diameters and there cost is available, need to use those diameters only. A pipe network distribution layout for irrigation purpose is prepared in EPANET. This network have 80 pipes and 80 nodes plus one reservoir Optimisation of pipe network for minimum cost is required to be done using GA tool box of MATLAB.
The pipe network (EPANET file i.e .inp file) needs to be coupled with MATLAB. And then the same network needs to be optimised. That means diameters of all 80 pipes need to be determined using GA tool box of MATLAB, such that it that will suffice the limiting conditions of design viz: minimum pressure head at outlet nodes must be at least 1 m and velocity in all pipes must be in between 0.6 and 1.8 m/s.
the set of commercially available diameters and there cost is available, need to use those diameters only. epanet-matlab toolkit, optimization using ga toolkit MATLAB Answers — New Questions
Difference between hist and imhist
Hi,
I have a fundamental question about the hist and imhist and an explanation will be great as I am a bit lost.
I am running this script:
I = imread(‘pout.tif’);
figure;
x=imhist(I)
imhist(I)
figure(2);
hist(x)
and when I compare the two histograms they do not look alike, why?
How can I save the imhist data so that the hist will show the same plot?
ThanksHi,
I have a fundamental question about the hist and imhist and an explanation will be great as I am a bit lost.
I am running this script:
I = imread(‘pout.tif’);
figure;
x=imhist(I)
imhist(I)
figure(2);
hist(x)
and when I compare the two histograms they do not look alike, why?
How can I save the imhist data so that the hist will show the same plot?
Thanks Hi,
I have a fundamental question about the hist and imhist and an explanation will be great as I am a bit lost.
I am running this script:
I = imread(‘pout.tif’);
figure;
x=imhist(I)
imhist(I)
figure(2);
hist(x)
and when I compare the two histograms they do not look alike, why?
How can I save the imhist data so that the hist will show the same plot?
Thanks hist, imhist MATLAB Answers — New Questions
ASR – Not seeing all the VMs in the ASR portal
I have set up Azure Site Recovery (ASR) to protect some on premise VMware VMs. The ASR appliance has an account in vCenter with the correct permissions.
In the Azure portal, when I go to select the VMs to protect, I only see 7 of the 78 VMs.
Any ideas on what is preventing the ASR appliance from seeing the complete VM inventory (Windows and Linux VMs).
Thanks
Ken
I have set up Azure Site Recovery (ASR) to protect some on premise VMware VMs. The ASR appliance has an account in vCenter with the correct permissions. In the Azure portal, when I go to select the VMs to protect, I only see 7 of the 78 VMs. Any ideas on what is preventing the ASR appliance from seeing the complete VM inventory (Windows and Linux VMs). Thanks Ken Read More
Outlook Send Button Moved
It looks like Outlook automagically downloaded.
Why on earth would you move the send and close buttons around? Now when I go to the top of the window to double click the send button Outlook then tries to close. You moved the outlook icon over to where the send button was. How would you like it if someone came to your desk and moved around the keys of your keyboard? How about it they changed the spacing between the keys so you would have to relearn it. You somehow think changing the spacing on the UI is something you should force on us.
What happened to the Microsoft that was backwards compatible, that didn’t force things down its users, that didn’t act like Apple? When did Microsoft start knowing better than the users it supplies? If I want new software I will buy it or ask for it.
It looks like Outlook automagically downloaded. Why on earth would you move the send and close buttons around? Now when I go to the top of the window to double click the send button Outlook then tries to close. You moved the outlook icon over to where the send button was. How would you like it if someone came to your desk and moved around the keys of your keyboard? How about it they changed the spacing between the keys so you would have to relearn it. You somehow think changing the spacing on the UI is something you should force on us. What happened to the Microsoft that was backwards compatible, that didn’t force things down its users, that didn’t act like Apple? When did Microsoft start knowing better than the users it supplies? If I want new software I will buy it or ask for it. Read More
Paramter optimization by curve fitting
I tried paramter optimization by curve fitting. I have five paramters to optimize. If possible, I would kindly like to know the below things.
I kindly would like to know, how opts could be chnaged to have good fit? I have this code. It says options are not excecuted but doesn’t give an error.
How to decide lower and upper bounds?Is it soley based on literature?(In my case, I have only one literature similar to my material, but it didnt give a good fit)
Main file
%rng default % For reproducibility
% Constants
AD = 1.2; % Air density
p0 = 101320; % Air pressure
SH = 1.4; % Specific heat of air
PN = 0.7; % Prandtl constant
c0 = 343; % Air velocity
d = 0.05; % Assuming a constant value for d
% Define the model equation
SAC_fun = @(x, f) your_ATTENBOROUGH_function(x, f, AD, p0, SH, PN, c0, d);
% Load experimental data from Excel file
exp_data = readmatrix(‘/Users/pramodya/Desktop/PhD/Modelling/MATLAB Final codes/My research/Exp.results/Done/C-1.xlsx’); % Assuming first column contains frequencies and second column contains corresponding SAC values
f = exp_data(:, 1); % Frequency data
ydata = exp_data(:, 2); % SAC experimental data
% Plot the experimental data
figure
plot(f, ydata, ‘r*’)
xlabel ‘Frequency’
ylabel ‘SAC’
title(‘Experimental Data’)
% Define the objective function for GA
objectiveFunction = @(x) sum((SAC_fun(x, f) – ydata).^2);
% Define bounds
lb = [0, 0, 0, 0.1]; % Lower bounds for parameters
ub = [2,20, 1e8, 1]; % Upper bounds for parameters
% Define GA options with a specified number of generations
opts = optimoptions(@ga,’SelectionFcn’,@selectiontournament, …
‘FitnessScalingFcn’,@fitscalingprop);
% Run GA to fit the model to the data
nvars = 4; % Number of variables to optimize
[sol, fval] = ga(objectiveFunction, nvars, [], [], [], [], lb, ub, [], options);
% Plot the fitted curve
figure
responsedata = SAC_fun(sol, f);
plot(f, ydata, ‘y*’, f, responsedata, ‘g-‘)
legend(‘Experimental Data’, ‘Fitted Curve’)
xlabel ‘Frequency’
ylabel ‘SAC’
title(‘Fitted Response’)
% Display optimized parameter values
disp(‘Optimized Parameter Values:’);
disp([‘b: ‘, num2str(sol(1))]);
disp([‘T: ‘, num2str(sol(2))]);
disp([‘FR: ‘, num2str(sol(3))]);
disp([‘P: ‘, num2str(sol(4))]);
% Calculate R-squared value
SS_total = sum((ydata – mean(ydata)).^2);
SS_residual = sum((ydata – responsedata).^2);
R_squared = 1 – (SS_residual / SS_total);
% Display R-squared value
disp([‘R-squared Value: ‘, num2str(R_squared)]);
Function file:
function SAC = your_ATTENBOROUGH_function(x, f, AD, p0, SH, PN, c0, d)
% Parameters
%VL = x(1);
b = x(1);%shape factor
T = x(2);
FR = x(3);
P = x(4);
% SAC calculation based on provided equations
s = (1/2*b)*sqrt((8*T*AD*2*pi*f)/(FR*P));
T_bes = besselj(1, s*sqrt(-1i)) ./ besselj(0, s*sqrt(-1i));
p = (T*AD/P) * (1 – (2./(s*sqrt(-1i))) .* T_bes).^-1;
T_bes2 = besselj(1, PN^0.5*s*sqrt(-1i)) ./ besselj(0, PN^0.5*s*sqrt(-1i));
K_w = (SH*p0/P) * (SH – ((2*(SH-1))./(PN^0.5*s*sqrt(-1i))) .* T_bes).^-1;
%Characteristic Impedance
Zc = sqrt(K_w.* p);
%Complex wave number
k_c = 2 * pi * f .* sqrt(p./K_w);
%Surface impedance of sample
Zs = -1i * Zc .* cot(k_c * d);
z0 = AD * c0;
%Normalised impedance
Zn = Zs / z0;
%Reflection coefficient
R = (Zs – z0) ./ (Zs + z0);
%Absorption coefficient
SAC = 1 – abs(R).^2;
end
Thank you in advance.I tried paramter optimization by curve fitting. I have five paramters to optimize. If possible, I would kindly like to know the below things.
I kindly would like to know, how opts could be chnaged to have good fit? I have this code. It says options are not excecuted but doesn’t give an error.
How to decide lower and upper bounds?Is it soley based on literature?(In my case, I have only one literature similar to my material, but it didnt give a good fit)
Main file
%rng default % For reproducibility
% Constants
AD = 1.2; % Air density
p0 = 101320; % Air pressure
SH = 1.4; % Specific heat of air
PN = 0.7; % Prandtl constant
c0 = 343; % Air velocity
d = 0.05; % Assuming a constant value for d
% Define the model equation
SAC_fun = @(x, f) your_ATTENBOROUGH_function(x, f, AD, p0, SH, PN, c0, d);
% Load experimental data from Excel file
exp_data = readmatrix(‘/Users/pramodya/Desktop/PhD/Modelling/MATLAB Final codes/My research/Exp.results/Done/C-1.xlsx’); % Assuming first column contains frequencies and second column contains corresponding SAC values
f = exp_data(:, 1); % Frequency data
ydata = exp_data(:, 2); % SAC experimental data
% Plot the experimental data
figure
plot(f, ydata, ‘r*’)
xlabel ‘Frequency’
ylabel ‘SAC’
title(‘Experimental Data’)
% Define the objective function for GA
objectiveFunction = @(x) sum((SAC_fun(x, f) – ydata).^2);
% Define bounds
lb = [0, 0, 0, 0.1]; % Lower bounds for parameters
ub = [2,20, 1e8, 1]; % Upper bounds for parameters
% Define GA options with a specified number of generations
opts = optimoptions(@ga,’SelectionFcn’,@selectiontournament, …
‘FitnessScalingFcn’,@fitscalingprop);
% Run GA to fit the model to the data
nvars = 4; % Number of variables to optimize
[sol, fval] = ga(objectiveFunction, nvars, [], [], [], [], lb, ub, [], options);
% Plot the fitted curve
figure
responsedata = SAC_fun(sol, f);
plot(f, ydata, ‘y*’, f, responsedata, ‘g-‘)
legend(‘Experimental Data’, ‘Fitted Curve’)
xlabel ‘Frequency’
ylabel ‘SAC’
title(‘Fitted Response’)
% Display optimized parameter values
disp(‘Optimized Parameter Values:’);
disp([‘b: ‘, num2str(sol(1))]);
disp([‘T: ‘, num2str(sol(2))]);
disp([‘FR: ‘, num2str(sol(3))]);
disp([‘P: ‘, num2str(sol(4))]);
% Calculate R-squared value
SS_total = sum((ydata – mean(ydata)).^2);
SS_residual = sum((ydata – responsedata).^2);
R_squared = 1 – (SS_residual / SS_total);
% Display R-squared value
disp([‘R-squared Value: ‘, num2str(R_squared)]);
Function file:
function SAC = your_ATTENBOROUGH_function(x, f, AD, p0, SH, PN, c0, d)
% Parameters
%VL = x(1);
b = x(1);%shape factor
T = x(2);
FR = x(3);
P = x(4);
% SAC calculation based on provided equations
s = (1/2*b)*sqrt((8*T*AD*2*pi*f)/(FR*P));
T_bes = besselj(1, s*sqrt(-1i)) ./ besselj(0, s*sqrt(-1i));
p = (T*AD/P) * (1 – (2./(s*sqrt(-1i))) .* T_bes).^-1;
T_bes2 = besselj(1, PN^0.5*s*sqrt(-1i)) ./ besselj(0, PN^0.5*s*sqrt(-1i));
K_w = (SH*p0/P) * (SH – ((2*(SH-1))./(PN^0.5*s*sqrt(-1i))) .* T_bes).^-1;
%Characteristic Impedance
Zc = sqrt(K_w.* p);
%Complex wave number
k_c = 2 * pi * f .* sqrt(p./K_w);
%Surface impedance of sample
Zs = -1i * Zc .* cot(k_c * d);
z0 = AD * c0;
%Normalised impedance
Zn = Zs / z0;
%Reflection coefficient
R = (Zs – z0) ./ (Zs + z0);
%Absorption coefficient
SAC = 1 – abs(R).^2;
end
Thank you in advance. I tried paramter optimization by curve fitting. I have five paramters to optimize. If possible, I would kindly like to know the below things.
I kindly would like to know, how opts could be chnaged to have good fit? I have this code. It says options are not excecuted but doesn’t give an error.
How to decide lower and upper bounds?Is it soley based on literature?(In my case, I have only one literature similar to my material, but it didnt give a good fit)
Main file
%rng default % For reproducibility
% Constants
AD = 1.2; % Air density
p0 = 101320; % Air pressure
SH = 1.4; % Specific heat of air
PN = 0.7; % Prandtl constant
c0 = 343; % Air velocity
d = 0.05; % Assuming a constant value for d
% Define the model equation
SAC_fun = @(x, f) your_ATTENBOROUGH_function(x, f, AD, p0, SH, PN, c0, d);
% Load experimental data from Excel file
exp_data = readmatrix(‘/Users/pramodya/Desktop/PhD/Modelling/MATLAB Final codes/My research/Exp.results/Done/C-1.xlsx’); % Assuming first column contains frequencies and second column contains corresponding SAC values
f = exp_data(:, 1); % Frequency data
ydata = exp_data(:, 2); % SAC experimental data
% Plot the experimental data
figure
plot(f, ydata, ‘r*’)
xlabel ‘Frequency’
ylabel ‘SAC’
title(‘Experimental Data’)
% Define the objective function for GA
objectiveFunction = @(x) sum((SAC_fun(x, f) – ydata).^2);
% Define bounds
lb = [0, 0, 0, 0.1]; % Lower bounds for parameters
ub = [2,20, 1e8, 1]; % Upper bounds for parameters
% Define GA options with a specified number of generations
opts = optimoptions(@ga,’SelectionFcn’,@selectiontournament, …
‘FitnessScalingFcn’,@fitscalingprop);
% Run GA to fit the model to the data
nvars = 4; % Number of variables to optimize
[sol, fval] = ga(objectiveFunction, nvars, [], [], [], [], lb, ub, [], options);
% Plot the fitted curve
figure
responsedata = SAC_fun(sol, f);
plot(f, ydata, ‘y*’, f, responsedata, ‘g-‘)
legend(‘Experimental Data’, ‘Fitted Curve’)
xlabel ‘Frequency’
ylabel ‘SAC’
title(‘Fitted Response’)
% Display optimized parameter values
disp(‘Optimized Parameter Values:’);
disp([‘b: ‘, num2str(sol(1))]);
disp([‘T: ‘, num2str(sol(2))]);
disp([‘FR: ‘, num2str(sol(3))]);
disp([‘P: ‘, num2str(sol(4))]);
% Calculate R-squared value
SS_total = sum((ydata – mean(ydata)).^2);
SS_residual = sum((ydata – responsedata).^2);
R_squared = 1 – (SS_residual / SS_total);
% Display R-squared value
disp([‘R-squared Value: ‘, num2str(R_squared)]);
Function file:
function SAC = your_ATTENBOROUGH_function(x, f, AD, p0, SH, PN, c0, d)
% Parameters
%VL = x(1);
b = x(1);%shape factor
T = x(2);
FR = x(3);
P = x(4);
% SAC calculation based on provided equations
s = (1/2*b)*sqrt((8*T*AD*2*pi*f)/(FR*P));
T_bes = besselj(1, s*sqrt(-1i)) ./ besselj(0, s*sqrt(-1i));
p = (T*AD/P) * (1 – (2./(s*sqrt(-1i))) .* T_bes).^-1;
T_bes2 = besselj(1, PN^0.5*s*sqrt(-1i)) ./ besselj(0, PN^0.5*s*sqrt(-1i));
K_w = (SH*p0/P) * (SH – ((2*(SH-1))./(PN^0.5*s*sqrt(-1i))) .* T_bes).^-1;
%Characteristic Impedance
Zc = sqrt(K_w.* p);
%Complex wave number
k_c = 2 * pi * f .* sqrt(p./K_w);
%Surface impedance of sample
Zs = -1i * Zc .* cot(k_c * d);
z0 = AD * c0;
%Normalised impedance
Zn = Zs / z0;
%Reflection coefficient
R = (Zs – z0) ./ (Zs + z0);
%Absorption coefficient
SAC = 1 – abs(R).^2;
end
Thank you in advance. paramter optimizaiton, ga, curve fitting MATLAB Answers — New Questions
How can I download MATLAB & Simulink R2013a student version without cd?
How can I download MATLAB & Simulink R2013a student version without cd? I bought a new computer without an optical drive, so I cannot download MATLAB using the installation disc that came when I purchased the software. Just wondering how I could download the software for a mac (I already have a key code for authorization)?How can I download MATLAB & Simulink R2013a student version without cd? I bought a new computer without an optical drive, so I cannot download MATLAB using the installation disc that came when I purchased the software. Just wondering how I could download the software for a mac (I already have a key code for authorization)? How can I download MATLAB & Simulink R2013a student version without cd? I bought a new computer without an optical drive, so I cannot download MATLAB using the installation disc that came when I purchased the software. Just wondering how I could download the software for a mac (I already have a key code for authorization)? software, download, version upgrade MATLAB Answers — New Questions
Can I use splitapply with two grouping variables and how can it be done in matlab app designer?
Hi ! 🙂
I am referring to this example:
load carsmall
whos
Name Size Bytes Class Attributes
Acceleration 100×1 800 double
Cylinders 100×1 800 double
Displacement 100×1 800 double
Horsepower 100×1 800 double
MPG 100×1 800 double
Mfg 100×13 2600 char
Model 100×33 6600 char
Model_Year 100×1 800 double
Origin 100×7 1400 char
Weight 100×1 800 double
cmdout 1×33 66 char
[g,id]=findgroups(Model_Year);
hAx=axes; hold(hAx,’on’)
splitapply(@(x,y)scatter(x,y,’filled’),Displacement,Horsepower,g)
legend(hAx,"Model Year "+string(1900+id),’location’,’northwest’)
xlabel(‘Displacement’), ylabel(‘Horsepower’)
——————————–
I have a table which is heterogenous. And I want to show the names of the first preferred salt user has chosen and second preferred salt (these are two of the column in my table) along with their properties on the x and y axis. Their properties are also the different columns in my tableHi ! 🙂
I am referring to this example:
load carsmall
whos
Name Size Bytes Class Attributes
Acceleration 100×1 800 double
Cylinders 100×1 800 double
Displacement 100×1 800 double
Horsepower 100×1 800 double
MPG 100×1 800 double
Mfg 100×13 2600 char
Model 100×33 6600 char
Model_Year 100×1 800 double
Origin 100×7 1400 char
Weight 100×1 800 double
cmdout 1×33 66 char
[g,id]=findgroups(Model_Year);
hAx=axes; hold(hAx,’on’)
splitapply(@(x,y)scatter(x,y,’filled’),Displacement,Horsepower,g)
legend(hAx,"Model Year "+string(1900+id),’location’,’northwest’)
xlabel(‘Displacement’), ylabel(‘Horsepower’)
——————————–
I have a table which is heterogenous. And I want to show the names of the first preferred salt user has chosen and second preferred salt (these are two of the column in my table) along with their properties on the x and y axis. Their properties are also the different columns in my table Hi ! 🙂
I am referring to this example:
load carsmall
whos
Name Size Bytes Class Attributes
Acceleration 100×1 800 double
Cylinders 100×1 800 double
Displacement 100×1 800 double
Horsepower 100×1 800 double
MPG 100×1 800 double
Mfg 100×13 2600 char
Model 100×33 6600 char
Model_Year 100×1 800 double
Origin 100×7 1400 char
Weight 100×1 800 double
cmdout 1×33 66 char
[g,id]=findgroups(Model_Year);
hAx=axes; hold(hAx,’on’)
splitapply(@(x,y)scatter(x,y,’filled’),Displacement,Horsepower,g)
legend(hAx,"Model Year "+string(1900+id),’location’,’northwest’)
xlabel(‘Displacement’), ylabel(‘Horsepower’)
——————————–
I have a table which is heterogenous. And I want to show the names of the first preferred salt user has chosen and second preferred salt (these are two of the column in my table) along with their properties on the x and y axis. Their properties are also the different columns in my table matlab app designer, split apply, two grouping variables MATLAB Answers — New Questions
simulink -sinx integral
As I know, integral -sinx dx is cosx
but, in sinulink there is offset !As I know, integral -sinx dx is cosx
but, in sinulink there is offset ! As I know, integral -sinx dx is cosx
but, in sinulink there is offset ! simulink MATLAB Answers — New Questions
Acessing TO DO inside new Outlook
When i access TODO inside new outlook the hashtags ( #) i have created for my tasks are useless.
However they work fine in the windows TODO app.
Can you check this
Regards
When i access TODO inside new outlook the hashtags ( #) i have created for my tasks are useless.However they work fine in the windows TODO app. Can you check thisRegards Read More
Edge will not start
Hello
I’m on Windows 10 pro 64. 22H2
Today on starting, Edge asked for my MS acount to continue (never did that before); when I basically chose not right now, it crashed and refuses to start.
When I click on the icon nothing happens; there is no app or processes
on background, no error message nothing. I’ve tried repairing it, uninstall, delete the files on the prgram filesmicrosoft folder and then reinstaling. Also deleted folders in the userappdata folder. Nothing works, clicking the icon to start simply does nothing, no processes show in the task manager
Also found that, if I switch users on the PC, Edge works. It’s only on
my user that it won’t start.
Anyone ever seen this?
HelloI’m on Windows 10 pro 64. 22H2Today on starting, Edge asked for my MS acount to continue (never did that before); when I basically chose not right now, it crashed and refuses to start.When I click on the icon nothing happens; there is no app or processeson background, no error message nothing. I’ve tried repairing it, uninstall, delete the files on the prgram filesmicrosoft folder and then reinstaling. Also deleted folders in the userappdata folder. Nothing works, clicking the icon to start simply does nothing, no processes show in the task managerAlso found that, if I switch users on the PC, Edge works. It’s only onmy user that it won’t start.Anyone ever seen this? Read More
How does Azure empower organizations to build holistic cloud defense strategies?
The threat landscape is ever-changing, and organizations are increasingly turning to Azure security services to build robust defense strategies for their cloud deployments. Here’s how Azure empowers a holistic approach:
Multi-Layered Protection:
Built-in Security: Azure offers a secure foundation by default. From Microsoft-managed data centers to security integrated into hardware and firmware, Azure safeguards your cloud infrastructure.Advanced Threat Intelligence: Azure Security Center leverages Microsoft’s vast cybersecurity expertise, providing real-time threat insights and proactive recommendations to stay ahead of evolving attacks.
Unified Threat Management:
Centralized Visibility: Azure Monitor offers a single pane of glass to view security posture across your entire cloud environment. You gain insights into potential vulnerabilities and can prioritize remediation efforts.Integrated Security Services: Azure provides a comprehensive suite of security services that work together seamlessly. Azure Firewall filters traffic, Azure Key Vault secures credentials, and Azure Security Center orchestrates the overall defense.
Holistic Defense Across Hybrid Environments:
Consistent Security Policies: Azure enforces consistent security policies across your cloud and on-premises deployments, ensuring a unified defense regardless of location.Workload Protection: Azure Security Center extends its protection to your on-premises workloads, providing a holistic view of your security posture across your entire IT infrastructure.
Empowering Your Security Team:
Automated Threat Detection & Response: Azure automates many security tasks, freeing up your team to focus on strategic initiatives and incident response.Simplified Security Management: Azure’s intuitive security tools empower your team to easily manage and monitor your cloud security posture.
By leveraging Azure’s comprehensive security services, organizations can create a holistic defense strategy that safeguards their cloud deployments from evolving threats.
The threat landscape is ever-changing, and organizations are increasingly turning to Azure security services to build robust defense strategies for their cloud deployments. Here’s how Azure empowers a holistic approach: Multi-Layered Protection:Built-in Security: Azure offers a secure foundation by default. From Microsoft-managed data centers to security integrated into hardware and firmware, Azure safeguards your cloud infrastructure.Advanced Threat Intelligence: Azure Security Center leverages Microsoft’s vast cybersecurity expertise, providing real-time threat insights and proactive recommendations to stay ahead of evolving attacks.Unified Threat Management:Centralized Visibility: Azure Monitor offers a single pane of glass to view security posture across your entire cloud environment. You gain insights into potential vulnerabilities and can prioritize remediation efforts.Integrated Security Services: Azure provides a comprehensive suite of security services that work together seamlessly. Azure Firewall filters traffic, Azure Key Vault secures credentials, and Azure Security Center orchestrates the overall defense.Holistic Defense Across Hybrid Environments:Consistent Security Policies: Azure enforces consistent security policies across your cloud and on-premises deployments, ensuring a unified defense regardless of location.Workload Protection: Azure Security Center extends its protection to your on-premises workloads, providing a holistic view of your security posture across your entire IT infrastructure.Empowering Your Security Team:Automated Threat Detection & Response: Azure automates many security tasks, freeing up your team to focus on strategic initiatives and incident response.Simplified Security Management: Azure’s intuitive security tools empower your team to easily manage and monitor your cloud security posture.By leveraging Azure’s comprehensive security services, organizations can create a holistic defense strategy that safeguards their cloud deployments from evolving threats. Read More
Task Manager Windows 11
Hello
Since the start of Windows 11, when we open the Task Manager, there is a lag (time lapse) before the processes is displayed correctly (same with 24h2)
With Windows 10, there is no lag, everything is displayed immediately
It’s just that Windows 11 is less “efficient” (badly coded, “heavier” to load or otherwise) ?
Hello Since the start of Windows 11, when we open the Task Manager, there is a lag (time lapse) before the processes is displayed correctly (same with 24h2)With Windows 10, there is no lag, everything is displayed immediatelyIt’s just that Windows 11 is less “efficient” (badly coded, “heavier” to load or otherwise) ? Read More
I’m trying to solve two separate systems using ODE23 while controlling the number of indexes so that the indexes are equal for both systems, but I couldn’t. Can you help? Than
function [sol1,sol2] = two_system
clc
close all
clear all
opt = odeset(‘RelTol’,1e-3);
sol1 = ode23(@system1,[0 5],[0],opt);
sol2 = ode23(@system2,[0 5],[0],opt);
figure(1)
plot(sol1.x(1,:),sol1.y(1,:),’b’,’LineWidth’,1.5)
hold on
plot(sol2.x(1,:),sol2.y(1,:),’–r’,’LineWidth’,1.5)
L1=length(sol1.x(1,:))
L2=length(sol2.x(1,:))
end
function dydt = system1(t,y)
M1 = y(1);
F_M1= 2;
theta1=0*pi/180;
A1 = 0.01;
%%%%%%% equation_system1 %%%%%%%
dMdt=(A1*(2*pi*(F_M1))*cos(2*pi*(F_M1)*(t)+theta1));
dydt = [dMdt];
end
function dydt = system2(t,y)
M2 = y(1);
F_M2= 2;
theta2=90*pi/180;
A2 = 0.01;
%%%%%%% equation_system2 %%%%%%%
dMdt=(A2*(2*pi*(F_M2))*cos(2*pi*(F_M2)*(t)+theta2));
dydt = [dMdt];
endfunction [sol1,sol2] = two_system
clc
close all
clear all
opt = odeset(‘RelTol’,1e-3);
sol1 = ode23(@system1,[0 5],[0],opt);
sol2 = ode23(@system2,[0 5],[0],opt);
figure(1)
plot(sol1.x(1,:),sol1.y(1,:),’b’,’LineWidth’,1.5)
hold on
plot(sol2.x(1,:),sol2.y(1,:),’–r’,’LineWidth’,1.5)
L1=length(sol1.x(1,:))
L2=length(sol2.x(1,:))
end
function dydt = system1(t,y)
M1 = y(1);
F_M1= 2;
theta1=0*pi/180;
A1 = 0.01;
%%%%%%% equation_system1 %%%%%%%
dMdt=(A1*(2*pi*(F_M1))*cos(2*pi*(F_M1)*(t)+theta1));
dydt = [dMdt];
end
function dydt = system2(t,y)
M2 = y(1);
F_M2= 2;
theta2=90*pi/180;
A2 = 0.01;
%%%%%%% equation_system2 %%%%%%%
dMdt=(A2*(2*pi*(F_M2))*cos(2*pi*(F_M2)*(t)+theta2));
dydt = [dMdt];
end function [sol1,sol2] = two_system
clc
close all
clear all
opt = odeset(‘RelTol’,1e-3);
sol1 = ode23(@system1,[0 5],[0],opt);
sol2 = ode23(@system2,[0 5],[0],opt);
figure(1)
plot(sol1.x(1,:),sol1.y(1,:),’b’,’LineWidth’,1.5)
hold on
plot(sol2.x(1,:),sol2.y(1,:),’–r’,’LineWidth’,1.5)
L1=length(sol1.x(1,:))
L2=length(sol2.x(1,:))
end
function dydt = system1(t,y)
M1 = y(1);
F_M1= 2;
theta1=0*pi/180;
A1 = 0.01;
%%%%%%% equation_system1 %%%%%%%
dMdt=(A1*(2*pi*(F_M1))*cos(2*pi*(F_M1)*(t)+theta1));
dydt = [dMdt];
end
function dydt = system2(t,y)
M2 = y(1);
F_M2= 2;
theta2=90*pi/180;
A2 = 0.01;
%%%%%%% equation_system2 %%%%%%%
dMdt=(A2*(2*pi*(F_M2))*cos(2*pi*(F_M2)*(t)+theta2));
dydt = [dMdt];
end mischa kim MATLAB Answers — New Questions
Lambda
I used this Lambda function:
“=LAMBDA(range,IFERROR(TOCOL(FILTER(‘3 times’!K3:CL3,(range=3))),””))(K4:CL4)” and it worked perfectly.
I then inserted it into name manger, created a name and it fails to work. It seems to input the wrong cell references?
I used this Lambda function:”=LAMBDA(range,IFERROR(TOCOL(FILTER(‘3 times’!K3:CL3,(range=3))),””))(K4:CL4)” and it worked perfectly.I then inserted it into name manger, created a name and it fails to work. It seems to input the wrong cell references? Read More
Balancing “Car Simulator 2” and Outlook: Tips for Productivity on and off the Road
Hey everyone,
While I’ve been diving into “Car Simulator 2” for some relaxation, I’m also knee-deep in Outlook for work. It got me thinking, how do you all balance gaming and productivity tools like Outlook? Any neat tricks for managing both efficiently? I’d love to hear your thoughts on staying organized whether you’re behind the wheel in the virtual world or tackling your inbox in the real one!
Looking forward to your insights!
Hey everyone,While I’ve been diving into “Car Simulator 2” for some relaxation, I’m also knee-deep in Outlook for work. It got me thinking, how do you all balance gaming and productivity tools like Outlook? Any neat tricks for managing both efficiently? I’d love to hear your thoughts on staying organized whether you’re behind the wheel in the virtual world or tackling your inbox in the real one!Looking forward to your insights! Read More
Header background is being applied intermittently using Site Script in communication site
Hello All,
The problem is that while I am using some of the verbs in conjunction with the “setSiteBranding” in the site script, the header background color is not always set.
I’ve noticed that the site template functions flawlessly when I apply it to an already-existing site, but it only occasionally—not always—works when I use it to create a new site.
Can anyone please assist me on this?
Hello All, The problem is that while I am using some of the verbs in conjunction with the “setSiteBranding” in the site script, the header background color is not always set. I’ve noticed that the site template functions flawlessly when I apply it to an already-existing site, but it only occasionally—not always—works when I use it to create a new site. Can anyone please assist me on this? Read More
Pivot Table SubTotal does not agree with simple SUM operation
I have created a pivot table using one table and a calculated column using Power Pivot. Field “Three+” is displaying correctly but the sub total is incorrect. The other fields are displaying correct subtotals.
What am I missing?
Thanks
Brad
I have created a pivot table using one table and a calculated column using Power Pivot. Field “Three+” is displaying correctly but the sub total is incorrect. The other fields are displaying correct subtotals.What am I missing?ThanksBrad Read More
Simulate Fick’s 1st and 2nd laws of mass diffusion.
Dear a person who is looking this.
I am trying to simulate the mass diffusion based on Fick’s laws on 2D plane.
The initial condition is that the concentration on the left wall is 1.
But the result seems to be odd as below.
I guess the problem is from the code for the 2nd law. So I have tried to modify that like
C(i,j) = C(i,j) …
– dt * ((Jx(i, j) – Jx(i-1,j))/(dx) …
+ (Jy(i, j) – Jy(i,j-1))/(dy));
But the result was the same.
How can I solve this problem. I really want some help..
Thank you for reading this.
======Here is my code (you can operate by just copy and paste)=======
% Parameters
Nx = 20; % Number of grid points in x-direction
Ny = 20; % Number of grid points in y-direction
D = 0.1; % Diffusion coefficient
dx = 1.0; % Spatial step in x-direction
dy = 1.0; % Spatial step in y-direction
dt = 0.1; % Time step
T = 200.0; % Total simulation time
C = zeros(Nx, Ny); % Initial concentration
Jx = zeros(Nx, Ny);
Jy = zeros(Nx, Ny);
C(:, 1) = 1.0; % Initial condition: concentrated mass at the center
% Time loop
for t = 0:dt:T
% Create a copy of the concentration array to hold the new values
% C_new = C;
% Iterate over each interior point
% flux
% Fick’s 1st law: J = -D * del c
for i = 2:Nx-1
for j = 2:Ny-1
Jx(i,j) = – D * (C(i,j) – C(i-1,j))/dx – D * (C(i+1,j) – C(i,j))/dx ;
Jy(i,j) = – D * (C(i,j) – C(i,j-1))/dy – D * (C(i,j+1) – C(i,j))/dy ;
end
end
% concentration
% Fick’s 2nd law: partial dc/dt = – div J
for i = 2:Nx-1
for j = 2:Ny-1
C(i,j) = C(i,j) …
– dt * ((Jx(i+1, j) – Jx(i-1,j))/(2*dx) …
+ (Jy(i, j+1) – Jy(i,j-1))/(2*dy));
end
end
% Optionally plot the concentration at each time step
slice_view = squeeze(C(:,:)); % View a slice in the middle of the z-plane
imagesc(slice_view);
colorbar;
colormap(‘jet’);
title(sprintf(‘Time = %.2f’, t));
drawnow;
end
% Final plot
slice_view = squeeze(C(:,:)); % View a slice in the middle of the z-plane
imagesc(slice_view);
colorbar;
title(‘Final Concentration’);
xlabel(‘X’);
ylabel(‘Y’);Dear a person who is looking this.
I am trying to simulate the mass diffusion based on Fick’s laws on 2D plane.
The initial condition is that the concentration on the left wall is 1.
But the result seems to be odd as below.
I guess the problem is from the code for the 2nd law. So I have tried to modify that like
C(i,j) = C(i,j) …
– dt * ((Jx(i, j) – Jx(i-1,j))/(dx) …
+ (Jy(i, j) – Jy(i,j-1))/(dy));
But the result was the same.
How can I solve this problem. I really want some help..
Thank you for reading this.
======Here is my code (you can operate by just copy and paste)=======
% Parameters
Nx = 20; % Number of grid points in x-direction
Ny = 20; % Number of grid points in y-direction
D = 0.1; % Diffusion coefficient
dx = 1.0; % Spatial step in x-direction
dy = 1.0; % Spatial step in y-direction
dt = 0.1; % Time step
T = 200.0; % Total simulation time
C = zeros(Nx, Ny); % Initial concentration
Jx = zeros(Nx, Ny);
Jy = zeros(Nx, Ny);
C(:, 1) = 1.0; % Initial condition: concentrated mass at the center
% Time loop
for t = 0:dt:T
% Create a copy of the concentration array to hold the new values
% C_new = C;
% Iterate over each interior point
% flux
% Fick’s 1st law: J = -D * del c
for i = 2:Nx-1
for j = 2:Ny-1
Jx(i,j) = – D * (C(i,j) – C(i-1,j))/dx – D * (C(i+1,j) – C(i,j))/dx ;
Jy(i,j) = – D * (C(i,j) – C(i,j-1))/dy – D * (C(i,j+1) – C(i,j))/dy ;
end
end
% concentration
% Fick’s 2nd law: partial dc/dt = – div J
for i = 2:Nx-1
for j = 2:Ny-1
C(i,j) = C(i,j) …
– dt * ((Jx(i+1, j) – Jx(i-1,j))/(2*dx) …
+ (Jy(i, j+1) – Jy(i,j-1))/(2*dy));
end
end
% Optionally plot the concentration at each time step
slice_view = squeeze(C(:,:)); % View a slice in the middle of the z-plane
imagesc(slice_view);
colorbar;
colormap(‘jet’);
title(sprintf(‘Time = %.2f’, t));
drawnow;
end
% Final plot
slice_view = squeeze(C(:,:)); % View a slice in the middle of the z-plane
imagesc(slice_view);
colorbar;
title(‘Final Concentration’);
xlabel(‘X’);
ylabel(‘Y’); Dear a person who is looking this.
I am trying to simulate the mass diffusion based on Fick’s laws on 2D plane.
The initial condition is that the concentration on the left wall is 1.
But the result seems to be odd as below.
I guess the problem is from the code for the 2nd law. So I have tried to modify that like
C(i,j) = C(i,j) …
– dt * ((Jx(i, j) – Jx(i-1,j))/(dx) …
+ (Jy(i, j) – Jy(i,j-1))/(dy));
But the result was the same.
How can I solve this problem. I really want some help..
Thank you for reading this.
======Here is my code (you can operate by just copy and paste)=======
% Parameters
Nx = 20; % Number of grid points in x-direction
Ny = 20; % Number of grid points in y-direction
D = 0.1; % Diffusion coefficient
dx = 1.0; % Spatial step in x-direction
dy = 1.0; % Spatial step in y-direction
dt = 0.1; % Time step
T = 200.0; % Total simulation time
C = zeros(Nx, Ny); % Initial concentration
Jx = zeros(Nx, Ny);
Jy = zeros(Nx, Ny);
C(:, 1) = 1.0; % Initial condition: concentrated mass at the center
% Time loop
for t = 0:dt:T
% Create a copy of the concentration array to hold the new values
% C_new = C;
% Iterate over each interior point
% flux
% Fick’s 1st law: J = -D * del c
for i = 2:Nx-1
for j = 2:Ny-1
Jx(i,j) = – D * (C(i,j) – C(i-1,j))/dx – D * (C(i+1,j) – C(i,j))/dx ;
Jy(i,j) = – D * (C(i,j) – C(i,j-1))/dy – D * (C(i,j+1) – C(i,j))/dy ;
end
end
% concentration
% Fick’s 2nd law: partial dc/dt = – div J
for i = 2:Nx-1
for j = 2:Ny-1
C(i,j) = C(i,j) …
– dt * ((Jx(i+1, j) – Jx(i-1,j))/(2*dx) …
+ (Jy(i, j+1) – Jy(i,j-1))/(2*dy));
end
end
% Optionally plot the concentration at each time step
slice_view = squeeze(C(:,:)); % View a slice in the middle of the z-plane
imagesc(slice_view);
colorbar;
colormap(‘jet’);
title(sprintf(‘Time = %.2f’, t));
drawnow;
end
% Final plot
slice_view = squeeze(C(:,:)); % View a slice in the middle of the z-plane
imagesc(slice_view);
colorbar;
title(‘Final Concentration’);
xlabel(‘X’);
ylabel(‘Y’); physics, diffusion, mass diffusion, differential equations MATLAB Answers — New Questions
How to set Matlab do display all calculation results?
Hi,
How can I set Matlab to display all the calculation results?
I am solving the system of ODEs with large spatial variable and time step distribution. If I set total time to 100 with time step of 1 only the results starting from t=50 are displayed.
How to fix it?
ThanksHi,
How can I set Matlab to display all the calculation results?
I am solving the system of ODEs with large spatial variable and time step distribution. If I set total time to 100 with time step of 1 only the results starting from t=50 are displayed.
How to fix it?
Thanks Hi,
How can I set Matlab to display all the calculation results?
I am solving the system of ODEs with large spatial variable and time step distribution. If I set total time to 100 with time step of 1 only the results starting from t=50 are displayed.
How to fix it?
Thanks odes, results display MATLAB Answers — New Questions