Month: September 2024
embedding inset plots in subplots matlab
Hi, I am trying to plots an insets plots in aubplots but only the last subplot and inset plots are shown. Please can someone help with this?
% Define xi_select and slope_select for main and inset plots
xi_select = [1, 10, 11, 12];
slope_select = [1, 3, 4, 5, 7, 9];
% Create a tiled layout with 2 rows and 3 columns of subplots
t = tiledlayout(2, 3, ‘TileSpacing’, ‘compact’, ‘Padding’, ‘compact’);
% Define custom colors (green to red gradient)
num_colors = length(xi_select);
custom_colors = [linspace(0, 1, num_colors)’, linspace(1, 0, num_colors)’, zeros(num_colors, 1)];
custom_linestyles = repmat({‘–‘}, 1, num_colors); % All dashed lines
% Initialize arrays for legend
legend_labels = {}; % Cell array to store legend labels
legend_index = 0; % Initialize legend index
plot_handles = []; % Array for storing plot handles
for j = 1:length(slope_select) % Loop through selected ramp_slope
% Create the main subplot
ax = nexttile; % Move to the next tile for each subplot
hold(ax, ‘on’); % Hold on to plot multiple lines in the same subplot
% Loop through selected xi values for the main plots
for i = 1:length(xi_select)
% Find the switching times for the current xi and ramp_slope
transitions = find(switching(:, xi_select(i), slope_select(j)));
if ~isempty(transitions)
% Plot the uxlt data at the switching times for this xi and ramp_slope
for t_idx = transitions
% Extract the uxlt data for the current time point
uxlt_data = squeeze(uxlt(ym, :, xi_select(i), slope_select(j))); % Dimension: y, xi, ramp_slope
% Proper LaTeX syntax for the legend entry, omitting time
display_name = sprintf(‘$\xi=%.2f$’, xi(xi_select(i)));
% Plot the data with specified color and linestyle
h = plot(ax, tarray, uxlt_data, ‘LineWidth’, 1.5, …
‘Color’, custom_colors(i, :), ‘LineStyle’, custom_linestyles{i});
% Only add the label and handle once to the legend
if ~ismember(display_name, legend_labels)
legend_index = legend_index + 1;
plot_handles(legend_index) = h(1); % Store only the first handle
legend_labels{legend_index} = display_name; % Append label
end
end
end
end
% Add labels and title to each subplot
xlabel(ax, ‘Time (s)’, ‘Interpreter’, ‘latex’);
ylabel(ax, ‘$int u_L , mathrm{dz}$’, ‘Interpreter’, ‘latex’);
xlim(ax, [min(tarray), max(tarray)]);
ylim(ax, [0, 2.5e-04]);
% Add subplot numbering and S_{rf} value
title(ax, sprintf(‘(%c) $S_{rf} = %.2f$’, ‘a’ + j – 1, ramp_slope(slope_select(j))), ‘Interpreter’, ‘latex’);
box(ax, ‘on’); % Place a box around the current subplot
% Add inset plots
inset_pos = ax.Position; % Get the position of the current subplot
if j == 1
% The first inset plot on the top left of the first subplot
inset_pos = [inset_pos(1) + 0.1 * inset_pos(3), inset_pos(2) + 0.65 * inset_pos(4), 0.15, 0.15];
else
% Remaining inset plots on the top right of the respective subplots
inset_pos = [inset_pos(1) + 0.6 * inset_pos(3), inset_pos(2) + 0.65 * inset_pos(4), 0.15, 0.15];
end
% Create new axes for inset plots, without attaching them to the main subplot axes
inset_ax = axes(‘Position’, inset_pos); % Create inset axes with adjusted position
hold(inset_ax, ‘on’); % Hold on inset axes to plot multiple lines
% Loop through selected xi values for the inset plots
for i = 1:length(xi_select)
% Find the switching times for the current xi and ramp_slope
transitions = find(switching(:, xi_select(i), slope_select(j)));
if ~isempty(transitions)
% Plot the uxl data in the inset plot
for t_idx = transitions
% Extract the uxl data for the current time point
uxl_data = squeeze(uxl(:, xi_select(i), slope_select(j))); % Dimension: y, xi, ramp_slope
% Plot the data in the inset with color and linestyle
plot(inset_ax, y, uxl_data, ‘LineWidth’, 1.5, …
‘Color’, custom_colors(i, :), ‘LineStyle’, custom_linestyles{i});
end
end
end
% Add labels to inset
xlabel(inset_ax, ‘$z$’, ‘Interpreter’, ‘latex’);
ylabel(inset_ax, ‘$int u_L , mathrm{dz}$’, ‘Interpreter’, ‘latex’);
xlim(inset_ax, [min(y), max(y)]);
hold(inset_ax, ‘off’); % Release hold on the inset axes
end
% Create a global legend (optional, if needed)
lgd = legend(plot_handles, legend_labels, ‘Interpreter’, ‘latex’, ‘NumColumns’, 2);
% Ensure that the entire figure has a box around it
box on;Hi, I am trying to plots an insets plots in aubplots but only the last subplot and inset plots are shown. Please can someone help with this?
% Define xi_select and slope_select for main and inset plots
xi_select = [1, 10, 11, 12];
slope_select = [1, 3, 4, 5, 7, 9];
% Create a tiled layout with 2 rows and 3 columns of subplots
t = tiledlayout(2, 3, ‘TileSpacing’, ‘compact’, ‘Padding’, ‘compact’);
% Define custom colors (green to red gradient)
num_colors = length(xi_select);
custom_colors = [linspace(0, 1, num_colors)’, linspace(1, 0, num_colors)’, zeros(num_colors, 1)];
custom_linestyles = repmat({‘–‘}, 1, num_colors); % All dashed lines
% Initialize arrays for legend
legend_labels = {}; % Cell array to store legend labels
legend_index = 0; % Initialize legend index
plot_handles = []; % Array for storing plot handles
for j = 1:length(slope_select) % Loop through selected ramp_slope
% Create the main subplot
ax = nexttile; % Move to the next tile for each subplot
hold(ax, ‘on’); % Hold on to plot multiple lines in the same subplot
% Loop through selected xi values for the main plots
for i = 1:length(xi_select)
% Find the switching times for the current xi and ramp_slope
transitions = find(switching(:, xi_select(i), slope_select(j)));
if ~isempty(transitions)
% Plot the uxlt data at the switching times for this xi and ramp_slope
for t_idx = transitions
% Extract the uxlt data for the current time point
uxlt_data = squeeze(uxlt(ym, :, xi_select(i), slope_select(j))); % Dimension: y, xi, ramp_slope
% Proper LaTeX syntax for the legend entry, omitting time
display_name = sprintf(‘$\xi=%.2f$’, xi(xi_select(i)));
% Plot the data with specified color and linestyle
h = plot(ax, tarray, uxlt_data, ‘LineWidth’, 1.5, …
‘Color’, custom_colors(i, :), ‘LineStyle’, custom_linestyles{i});
% Only add the label and handle once to the legend
if ~ismember(display_name, legend_labels)
legend_index = legend_index + 1;
plot_handles(legend_index) = h(1); % Store only the first handle
legend_labels{legend_index} = display_name; % Append label
end
end
end
end
% Add labels and title to each subplot
xlabel(ax, ‘Time (s)’, ‘Interpreter’, ‘latex’);
ylabel(ax, ‘$int u_L , mathrm{dz}$’, ‘Interpreter’, ‘latex’);
xlim(ax, [min(tarray), max(tarray)]);
ylim(ax, [0, 2.5e-04]);
% Add subplot numbering and S_{rf} value
title(ax, sprintf(‘(%c) $S_{rf} = %.2f$’, ‘a’ + j – 1, ramp_slope(slope_select(j))), ‘Interpreter’, ‘latex’);
box(ax, ‘on’); % Place a box around the current subplot
% Add inset plots
inset_pos = ax.Position; % Get the position of the current subplot
if j == 1
% The first inset plot on the top left of the first subplot
inset_pos = [inset_pos(1) + 0.1 * inset_pos(3), inset_pos(2) + 0.65 * inset_pos(4), 0.15, 0.15];
else
% Remaining inset plots on the top right of the respective subplots
inset_pos = [inset_pos(1) + 0.6 * inset_pos(3), inset_pos(2) + 0.65 * inset_pos(4), 0.15, 0.15];
end
% Create new axes for inset plots, without attaching them to the main subplot axes
inset_ax = axes(‘Position’, inset_pos); % Create inset axes with adjusted position
hold(inset_ax, ‘on’); % Hold on inset axes to plot multiple lines
% Loop through selected xi values for the inset plots
for i = 1:length(xi_select)
% Find the switching times for the current xi and ramp_slope
transitions = find(switching(:, xi_select(i), slope_select(j)));
if ~isempty(transitions)
% Plot the uxl data in the inset plot
for t_idx = transitions
% Extract the uxl data for the current time point
uxl_data = squeeze(uxl(:, xi_select(i), slope_select(j))); % Dimension: y, xi, ramp_slope
% Plot the data in the inset with color and linestyle
plot(inset_ax, y, uxl_data, ‘LineWidth’, 1.5, …
‘Color’, custom_colors(i, :), ‘LineStyle’, custom_linestyles{i});
end
end
end
% Add labels to inset
xlabel(inset_ax, ‘$z$’, ‘Interpreter’, ‘latex’);
ylabel(inset_ax, ‘$int u_L , mathrm{dz}$’, ‘Interpreter’, ‘latex’);
xlim(inset_ax, [min(y), max(y)]);
hold(inset_ax, ‘off’); % Release hold on the inset axes
end
% Create a global legend (optional, if needed)
lgd = legend(plot_handles, legend_labels, ‘Interpreter’, ‘latex’, ‘NumColumns’, 2);
% Ensure that the entire figure has a box around it
box on; Hi, I am trying to plots an insets plots in aubplots but only the last subplot and inset plots are shown. Please can someone help with this?
% Define xi_select and slope_select for main and inset plots
xi_select = [1, 10, 11, 12];
slope_select = [1, 3, 4, 5, 7, 9];
% Create a tiled layout with 2 rows and 3 columns of subplots
t = tiledlayout(2, 3, ‘TileSpacing’, ‘compact’, ‘Padding’, ‘compact’);
% Define custom colors (green to red gradient)
num_colors = length(xi_select);
custom_colors = [linspace(0, 1, num_colors)’, linspace(1, 0, num_colors)’, zeros(num_colors, 1)];
custom_linestyles = repmat({‘–‘}, 1, num_colors); % All dashed lines
% Initialize arrays for legend
legend_labels = {}; % Cell array to store legend labels
legend_index = 0; % Initialize legend index
plot_handles = []; % Array for storing plot handles
for j = 1:length(slope_select) % Loop through selected ramp_slope
% Create the main subplot
ax = nexttile; % Move to the next tile for each subplot
hold(ax, ‘on’); % Hold on to plot multiple lines in the same subplot
% Loop through selected xi values for the main plots
for i = 1:length(xi_select)
% Find the switching times for the current xi and ramp_slope
transitions = find(switching(:, xi_select(i), slope_select(j)));
if ~isempty(transitions)
% Plot the uxlt data at the switching times for this xi and ramp_slope
for t_idx = transitions
% Extract the uxlt data for the current time point
uxlt_data = squeeze(uxlt(ym, :, xi_select(i), slope_select(j))); % Dimension: y, xi, ramp_slope
% Proper LaTeX syntax for the legend entry, omitting time
display_name = sprintf(‘$\xi=%.2f$’, xi(xi_select(i)));
% Plot the data with specified color and linestyle
h = plot(ax, tarray, uxlt_data, ‘LineWidth’, 1.5, …
‘Color’, custom_colors(i, :), ‘LineStyle’, custom_linestyles{i});
% Only add the label and handle once to the legend
if ~ismember(display_name, legend_labels)
legend_index = legend_index + 1;
plot_handles(legend_index) = h(1); % Store only the first handle
legend_labels{legend_index} = display_name; % Append label
end
end
end
end
% Add labels and title to each subplot
xlabel(ax, ‘Time (s)’, ‘Interpreter’, ‘latex’);
ylabel(ax, ‘$int u_L , mathrm{dz}$’, ‘Interpreter’, ‘latex’);
xlim(ax, [min(tarray), max(tarray)]);
ylim(ax, [0, 2.5e-04]);
% Add subplot numbering and S_{rf} value
title(ax, sprintf(‘(%c) $S_{rf} = %.2f$’, ‘a’ + j – 1, ramp_slope(slope_select(j))), ‘Interpreter’, ‘latex’);
box(ax, ‘on’); % Place a box around the current subplot
% Add inset plots
inset_pos = ax.Position; % Get the position of the current subplot
if j == 1
% The first inset plot on the top left of the first subplot
inset_pos = [inset_pos(1) + 0.1 * inset_pos(3), inset_pos(2) + 0.65 * inset_pos(4), 0.15, 0.15];
else
% Remaining inset plots on the top right of the respective subplots
inset_pos = [inset_pos(1) + 0.6 * inset_pos(3), inset_pos(2) + 0.65 * inset_pos(4), 0.15, 0.15];
end
% Create new axes for inset plots, without attaching them to the main subplot axes
inset_ax = axes(‘Position’, inset_pos); % Create inset axes with adjusted position
hold(inset_ax, ‘on’); % Hold on inset axes to plot multiple lines
% Loop through selected xi values for the inset plots
for i = 1:length(xi_select)
% Find the switching times for the current xi and ramp_slope
transitions = find(switching(:, xi_select(i), slope_select(j)));
if ~isempty(transitions)
% Plot the uxl data in the inset plot
for t_idx = transitions
% Extract the uxl data for the current time point
uxl_data = squeeze(uxl(:, xi_select(i), slope_select(j))); % Dimension: y, xi, ramp_slope
% Plot the data in the inset with color and linestyle
plot(inset_ax, y, uxl_data, ‘LineWidth’, 1.5, …
‘Color’, custom_colors(i, :), ‘LineStyle’, custom_linestyles{i});
end
end
end
% Add labels to inset
xlabel(inset_ax, ‘$z$’, ‘Interpreter’, ‘latex’);
ylabel(inset_ax, ‘$int u_L , mathrm{dz}$’, ‘Interpreter’, ‘latex’);
xlim(inset_ax, [min(y), max(y)]);
hold(inset_ax, ‘off’); % Release hold on the inset axes
end
% Create a global legend (optional, if needed)
lgd = legend(plot_handles, legend_labels, ‘Interpreter’, ‘latex’, ‘NumColumns’, 2);
% Ensure that the entire figure has a box around it
box on; insets, subplots, figures MATLAB Answers — New Questions
Convert Excel Formula to Math
Hello,
For the longest time, I had been looking for an excel add-on that would convert a formula in a cell to readable math. I could not can’t find one and with some help wrote a basic one here, but it does not work very well on some formulas.
https://github.com/keshishianv/XL-Formula-to-Math
Does anyone know of an add-on that will do so? It makes finding errors super easy.
Thank You.
Hello,For the longest time, I had been looking for an excel add-on that would convert a formula in a cell to readable math. I could not can’t find one and with some help wrote a basic one here, but it does not work very well on some formulas.https://github.com/keshishianv/XL-Formula-to-Math Does anyone know of an add-on that will do so? It makes finding errors super easy. Thank You. Read More
Is there a way to call the same Flow from SharePoint UI inside multiple libraries
We have around 15 document libraries inside a sharepoint site. now we want to build a flow which is called from SharePoint list view UI as follow:- and when the user click on the move icon >> the workflow should move the file to OWS using SFTP connector. Now the issue i am facing is that when i define the flow, to run on selected file:- I will need to define the library in advance:- so not sure how i can allow the same flow to run on the 15++ libraries we have ? is this possible? If not then is there any workarounds? Thanks Read More
Update File Properties, why i cannot populate an image
2) Images properties, such as ApproverSignature:-
I have a word document template inside SharePoint Document library where i have added some Document properties to it, which include:- 1) Text properties, such as GranteeName & GranteeAddress:- 2) Images properties, such as ApproverSignature:- Now using the “Update File Properties” action, i can populate the Text properties, as follow:- but the ApproverSignature property did not appear inside the list of properties, so how i can populate the template’s ApproverSignature property ? I tried this using another tenant, which i have premium license on, and i can do so using the “Populate a Micrsoft Word Template” action , as follow:- so cannot we do the same using “Update File Properties” action? Thanks Read More
“SFTP – SSH” , Error “Test connection failed. Details: Bad Gateway”
I want to connect to an SFTP so i used this connector: – but i got this error:- “Test connection failed. Details: Bad Gateway” any advice what could be causing this error? Thanks Read More
Filter Form and Syntax
Hello Experts,
I am trying to filter a form based on a combo box and I need 2 criteria. I can filter with 1 criteria no issue but adding another criteria that is TEXT is the problem.
In the below, [ExpiredYN] is a cbo with a row source: “Terminated”;”Active”.
[ProjIDfk] is not text.
do you see where I am wrong?
Private Sub cboFilterProj_AfterUpdate()
‘http://allenbrowne.com/ser-28.html
If IsNull(Me.cboFilterProj) Then
Me.FilterOn = False
Else
Me.Filter = “ProjIDfk = ” & Me!cboFilterProj & “‘ And [ExpiredYN] = ‘” & Me!cboStatus & “‘“
^dqsq ^sqdq ^dqsqdq
the above returns a syntax:
Me.Filter = “ProjIDfk = ” & Me!cboFilterProj & “‘ And ” & [ExpiredYN] = ‘” & Me!cboStatus & “‘“
^dqsq ^?? ^sqdq ^dqsqdq
I get a compile error on the above:
Me.FilterOn = True
End If
End Sub
thank you
Hello Experts, I am trying to filter a form based on a combo box and I need 2 criteria. I can filter with 1 criteria no issue but adding another criteria that is TEXT is the problem. In the below, [ExpiredYN] is a cbo with a row source: “Terminated”;”Active”. [ProjIDfk] is not text. do you see where I am wrong? Private Sub cboFilterProj_AfterUpdate()’http://allenbrowne.com/ser-28.htmlIf IsNull(Me.cboFilterProj) ThenMe.FilterOn = FalseElseMe.Filter = “ProjIDfk = ” & Me!cboFilterProj & “‘ And [ExpiredYN] = ‘” & Me!cboStatus & “‘” ^dqsq ^sqdq ^dqsqdqthe above returns a syntax: Me.Filter = “ProjIDfk = ” & Me!cboFilterProj & “‘ And ” & [ExpiredYN] = ‘” & Me!cboStatus & “‘” ^dqsq ^?? ^sqdq ^dqsqdqI get a compile error on the above: Me.FilterOn = TrueEnd IfEnd Sub thank you Read More
Now you Acelareted the planet AI
AI-Artificial Inteligência
for me
AI-Áurea Inteligente
30 years work in Total for AI
AI-Artificial Inteligênciafor meAI-Áurea Inteligente 30 years work in Total for AI Read More
resource over allocation in a Master Project
I’m working with Master Project, and some Sub projects.
Let’s say Jack, is allocated at the same dates to tasks in different subproject, and at the same time to a task of the Master project.
I do use the “resource Pool” and also assign “Share resources”. But this enables only to look at over allocation between Master Project and one of the Sub Projects.
Is there a way to see over allocation between all the sub projects, as an aggregated summary and red indication?
I’m working with Master Project, and some Sub projects. Let’s say Jack, is allocated at the same dates to tasks in different subproject, and at the same time to a task of the Master project.I do use the “resource Pool” and also assign “Share resources”. But this enables only to look at over allocation between Master Project and one of the Sub Projects.Is there a way to see over allocation between all the sub projects, as an aggregated summary and red indication? Read More
Android RD Client Mouse Middle Click Problems
I can use the RD Client application on my Android tablet. I can connect without any problems. I can also use it with a mouse and keyboard that I connect to my tablet via Bluetooth without any problems, but while all the buttons on the mouse work, only the middle button click works like the left mouse button instead of performing its own function.
I can use the RD Client application on my Android tablet. I can connect without any problems. I can also use it with a mouse and keyboard that I connect to my tablet via Bluetooth without any problems, but while all the buttons on the mouse work, only the middle button click works like the left mouse button instead of performing its own function. Read More
NDR Emails Not Appearing in Group Mailbox
I’ve encountered an issue with non-delivery reports (NDR) when sending emails from a Teams group mailbox.
When I send an email from my personal company email address to a non-existent address, I correctly receive an NDR in my inbox. However, when I do the same from a Teams group email address, no NDR is delivered to the group mailbox.
Upon checking Exchange Message Trace, I can see that the NDR is being sent to the group mailbox, but it is delivered to the “RecoverableItemsDeletions” folder.
I believe this issue may have started after switching to the New Groups in Outlook. Previously, it seemed to work fine.
Can anyone assist with resolving this? Thank you in advance for your help.
I’ve encountered an issue with non-delivery reports (NDR) when sending emails from a Teams group mailbox.When I send an email from my personal company email address to a non-existent address, I correctly receive an NDR in my inbox. However, when I do the same from a Teams group email address, no NDR is delivered to the group mailbox.Upon checking Exchange Message Trace, I can see that the NDR is being sent to the group mailbox, but it is delivered to the “RecoverableItemsDeletions” folder. The message was successfully delivered to the folder: DefaultFolderType:RecoverableItemsDeletions I believe this issue may have started after switching to the New Groups in Outlook. Previously, it seemed to work fine. Can anyone assist with resolving this? Thank you in advance for your help. Read More
How to write code for repetitive process?
Hello.
Given:
Variable components: species_1 and species_2;
Initial values: species_1=1000 g and species_2=200 g;
Process parameters: timecut=2 hour, timecon=1hour, kf=0.1 1/hour
The components are related to each other by a reaction according to the law of mass action:
species_1 -> species_2: kf*species_1
In the time interval 0<=time<=timecut, the mass of the component species_1 decreases while the mass of the component species_2 increases. At the point time=timecut, the masses of the components return to their initial values. Two sawtooth patterns are formed on the charts: one sawtooth on chart for species_1 and another inverted sawtooth on chart for species_2.
Then, during the timecon, the masses of components retain their original values: "shelves" are formed. Codes in the Simbiology Builder:
Trigger: time>=timecut
Event FCNS:
kf=0
species_1=1000
species_2=200
If time>=timecut+timecon and kf=0.1, the mass of the species_1 component decreases and the mass of the species_2 component increases. No saw teeth and shelves are formed.
How should the code be written in Simbiology so that the "tooth-shelf" process are repeated n times?Hello.
Given:
Variable components: species_1 and species_2;
Initial values: species_1=1000 g and species_2=200 g;
Process parameters: timecut=2 hour, timecon=1hour, kf=0.1 1/hour
The components are related to each other by a reaction according to the law of mass action:
species_1 -> species_2: kf*species_1
In the time interval 0<=time<=timecut, the mass of the component species_1 decreases while the mass of the component species_2 increases. At the point time=timecut, the masses of the components return to their initial values. Two sawtooth patterns are formed on the charts: one sawtooth on chart for species_1 and another inverted sawtooth on chart for species_2.
Then, during the timecon, the masses of components retain their original values: "shelves" are formed. Codes in the Simbiology Builder:
Trigger: time>=timecut
Event FCNS:
kf=0
species_1=1000
species_2=200
If time>=timecut+timecon and kf=0.1, the mass of the species_1 component decreases and the mass of the species_2 component increases. No saw teeth and shelves are formed.
How should the code be written in Simbiology so that the "tooth-shelf" process are repeated n times? Hello.
Given:
Variable components: species_1 and species_2;
Initial values: species_1=1000 g and species_2=200 g;
Process parameters: timecut=2 hour, timecon=1hour, kf=0.1 1/hour
The components are related to each other by a reaction according to the law of mass action:
species_1 -> species_2: kf*species_1
In the time interval 0<=time<=timecut, the mass of the component species_1 decreases while the mass of the component species_2 increases. At the point time=timecut, the masses of the components return to their initial values. Two sawtooth patterns are formed on the charts: one sawtooth on chart for species_1 and another inverted sawtooth on chart for species_2.
Then, during the timecon, the masses of components retain their original values: "shelves" are formed. Codes in the Simbiology Builder:
Trigger: time>=timecut
Event FCNS:
kf=0
species_1=1000
species_2=200
If time>=timecut+timecon and kf=0.1, the mass of the species_1 component decreases and the mass of the species_2 component increases. No saw teeth and shelves are formed.
How should the code be written in Simbiology so that the "tooth-shelf" process are repeated n times? programming, cycle MATLAB Answers — New Questions
Check tcpclient connection status
Hi, I’m currently using tcpclient command to establish tcpip communication with an external device (not tcpip() from instrument toolbox).
Sometimes, the connection is not stable and when I write data it returns error: ‘An existing connection was forcibly closed by the remote host’.
Therefore, I want to implement a method to check the connection before I write / read from the connection. However, I just couldn’t find much information regarding tcpclient.
I have attempted the following:
% connect
t=tcpclient(‘172.1.1.102′,50000,’Timeout’,1,’ConnectTimeout’,3);
Here, before running the I deliberately disconnected Ethernet cable just want to test trigger the error:
% My intention: try a write / read to check if an error returns
try
write(t,0);
read(t);
disp(‘send succesfull’);
catch ME
disp(‘connection lost’);
disp(ME.identifier);
end
For the first run ‘An existing connection was forcibly closed by the remote host’ still appears in the command window and the ‘send successful’ message is printed, catch statement is skipped. However, a second run will jump into catch statement though.
If I run the try-catch step by step, when it reaches ‘write(t,0)’ statement it returns the ”An existing … remote host”, and continue to ‘read(t)’ statement, and jumps into catch statement.
I couldn’t quite understand why this happened.
Thanks for your help very much!Hi, I’m currently using tcpclient command to establish tcpip communication with an external device (not tcpip() from instrument toolbox).
Sometimes, the connection is not stable and when I write data it returns error: ‘An existing connection was forcibly closed by the remote host’.
Therefore, I want to implement a method to check the connection before I write / read from the connection. However, I just couldn’t find much information regarding tcpclient.
I have attempted the following:
% connect
t=tcpclient(‘172.1.1.102′,50000,’Timeout’,1,’ConnectTimeout’,3);
Here, before running the I deliberately disconnected Ethernet cable just want to test trigger the error:
% My intention: try a write / read to check if an error returns
try
write(t,0);
read(t);
disp(‘send succesfull’);
catch ME
disp(‘connection lost’);
disp(ME.identifier);
end
For the first run ‘An existing connection was forcibly closed by the remote host’ still appears in the command window and the ‘send successful’ message is printed, catch statement is skipped. However, a second run will jump into catch statement though.
If I run the try-catch step by step, when it reaches ‘write(t,0)’ statement it returns the ”An existing … remote host”, and continue to ‘read(t)’ statement, and jumps into catch statement.
I couldn’t quite understand why this happened.
Thanks for your help very much! Hi, I’m currently using tcpclient command to establish tcpip communication with an external device (not tcpip() from instrument toolbox).
Sometimes, the connection is not stable and when I write data it returns error: ‘An existing connection was forcibly closed by the remote host’.
Therefore, I want to implement a method to check the connection before I write / read from the connection. However, I just couldn’t find much information regarding tcpclient.
I have attempted the following:
% connect
t=tcpclient(‘172.1.1.102′,50000,’Timeout’,1,’ConnectTimeout’,3);
Here, before running the I deliberately disconnected Ethernet cable just want to test trigger the error:
% My intention: try a write / read to check if an error returns
try
write(t,0);
read(t);
disp(‘send succesfull’);
catch ME
disp(‘connection lost’);
disp(ME.identifier);
end
For the first run ‘An existing connection was forcibly closed by the remote host’ still appears in the command window and the ‘send successful’ message is printed, catch statement is skipped. However, a second run will jump into catch statement though.
If I run the try-catch step by step, when it reaches ‘write(t,0)’ statement it returns the ”An existing … remote host”, and continue to ‘read(t)’ statement, and jumps into catch statement.
I couldn’t quite understand why this happened.
Thanks for your help very much! matlab, tcpip, tcpclient, connection MATLAB Answers — New Questions
How to export 500 images in one file
I have around 500 images which I want to export into one .xls .word or .pdf in 3 collums. I tried putting them all in one figure but then they become extremely small. If I create many separete figures by 3, I don´t know how to export them all into one file. I tried putting all of the images into table but then the table doesn´t generate because I run out of memorry. If I were to guess, it most likely tries to put every single value of the picture into a separated cell.
How do I make pictures in the table to be saved in their pictural form?
clear all; clc; close all;
dir_img_AP=dir(‘**/NUSCH*AP/**/*.jpg’);
dir_img_JS=dir(‘**/NUSCH*JS/**/*.jpg’);
dir_img_LZ=dir(‘**/NUSCH*LZ/**/*.jpg’);
n_img_AP=numel(dir_img_AP);
n_img_JS=numel(dir_img_JS);
n_img_LZ=numel(dir_img_LZ);
n_img=max([n_img_AP,n_img_JS,n_img_LZ]);
T=cell(n_img,1);
for i=1:n_img_AP
file_path_AP=[dir_img_AP(i).folder, ‘/’,dir_img_AP(i).name];
filename_AP = dir_img_AP(i).name;
pic_AP = imread(filename_AP);
T{i,1} = pic_AP;
end
for i=1:n_img_JS
file_path_JS=[dir_img_JS(i).folder, ‘/’,dir_img_JS(i).name];
filename_JS = dir_img_JS(i).name;
pic_JS = imread(filename_JS);
T{i,2} = pic_JS;
end
for i=1:n_img_LZ
file_path_LZ=[dir_img_LZ(i).folder, ‘/’,dir_img_LZ(i).name];
filename_LZ = dir_img_LZ(i).name;
pic_LZ = imread(filename_LZ);
T{i,3} = pic_LZ;
end
table=cell2table(T);
arr = table2array(table);
% imshow(arr);
f_name=’pic.xls’;
% writetable(table,f_name)I have around 500 images which I want to export into one .xls .word or .pdf in 3 collums. I tried putting them all in one figure but then they become extremely small. If I create many separete figures by 3, I don´t know how to export them all into one file. I tried putting all of the images into table but then the table doesn´t generate because I run out of memorry. If I were to guess, it most likely tries to put every single value of the picture into a separated cell.
How do I make pictures in the table to be saved in their pictural form?
clear all; clc; close all;
dir_img_AP=dir(‘**/NUSCH*AP/**/*.jpg’);
dir_img_JS=dir(‘**/NUSCH*JS/**/*.jpg’);
dir_img_LZ=dir(‘**/NUSCH*LZ/**/*.jpg’);
n_img_AP=numel(dir_img_AP);
n_img_JS=numel(dir_img_JS);
n_img_LZ=numel(dir_img_LZ);
n_img=max([n_img_AP,n_img_JS,n_img_LZ]);
T=cell(n_img,1);
for i=1:n_img_AP
file_path_AP=[dir_img_AP(i).folder, ‘/’,dir_img_AP(i).name];
filename_AP = dir_img_AP(i).name;
pic_AP = imread(filename_AP);
T{i,1} = pic_AP;
end
for i=1:n_img_JS
file_path_JS=[dir_img_JS(i).folder, ‘/’,dir_img_JS(i).name];
filename_JS = dir_img_JS(i).name;
pic_JS = imread(filename_JS);
T{i,2} = pic_JS;
end
for i=1:n_img_LZ
file_path_LZ=[dir_img_LZ(i).folder, ‘/’,dir_img_LZ(i).name];
filename_LZ = dir_img_LZ(i).name;
pic_LZ = imread(filename_LZ);
T{i,3} = pic_LZ;
end
table=cell2table(T);
arr = table2array(table);
% imshow(arr);
f_name=’pic.xls’;
% writetable(table,f_name) I have around 500 images which I want to export into one .xls .word or .pdf in 3 collums. I tried putting them all in one figure but then they become extremely small. If I create many separete figures by 3, I don´t know how to export them all into one file. I tried putting all of the images into table but then the table doesn´t generate because I run out of memorry. If I were to guess, it most likely tries to put every single value of the picture into a separated cell.
How do I make pictures in the table to be saved in their pictural form?
clear all; clc; close all;
dir_img_AP=dir(‘**/NUSCH*AP/**/*.jpg’);
dir_img_JS=dir(‘**/NUSCH*JS/**/*.jpg’);
dir_img_LZ=dir(‘**/NUSCH*LZ/**/*.jpg’);
n_img_AP=numel(dir_img_AP);
n_img_JS=numel(dir_img_JS);
n_img_LZ=numel(dir_img_LZ);
n_img=max([n_img_AP,n_img_JS,n_img_LZ]);
T=cell(n_img,1);
for i=1:n_img_AP
file_path_AP=[dir_img_AP(i).folder, ‘/’,dir_img_AP(i).name];
filename_AP = dir_img_AP(i).name;
pic_AP = imread(filename_AP);
T{i,1} = pic_AP;
end
for i=1:n_img_JS
file_path_JS=[dir_img_JS(i).folder, ‘/’,dir_img_JS(i).name];
filename_JS = dir_img_JS(i).name;
pic_JS = imread(filename_JS);
T{i,2} = pic_JS;
end
for i=1:n_img_LZ
file_path_LZ=[dir_img_LZ(i).folder, ‘/’,dir_img_LZ(i).name];
filename_LZ = dir_img_LZ(i).name;
pic_LZ = imread(filename_LZ);
T{i,3} = pic_LZ;
end
table=cell2table(T);
arr = table2array(table);
% imshow(arr);
f_name=’pic.xls’;
% writetable(table,f_name) database, export, image MATLAB Answers — New Questions
Not for profit frustrations
Hi,
I really need some help.
I have attempted to get this account for my not for profit.
Filled everything in
We are a registered charity
Had information from registration information… And nothing else.
Cant find anywhere to see how my application is going, I’ve been trying to sort this for months (since May)
Phone line never goes passed the automated system, people on Facebook messenger unable to help and suggested I try here.
Please someone help.
Hi, I really need some help. I have attempted to get this account for my not for profit. Filled everything inWe are a registered charity Had information from registration information… And nothing else. Cant find anywhere to see how my application is going, I’ve been trying to sort this for months (since May) Phone line never goes passed the automated system, people on Facebook messenger unable to help and suggested I try here. Please someone help. Read More
腾龙娱乐微开户4766168在页面中
实际的生产环境中,IoT 设备可以生成大量的数据。 为了减少上传的数据量或降低控制策略的延时,有时必须在设备端对数据进行实时分析或处理。Azure Stream Analytics 服务就是很好的解决方案之一,用户可以从Azure Portal中创建Azure Stream Analytics 服务,然后在 Azure IoTHub 中将其设置为 IoT Edge Module 并部署到Azure IoT Edge设备上。本文将演示如何创建Azure Stream Analytics Job, 并将其部署到 IoT Edge 设备上。
1. 创建存储账户
首先,在 Azure 门户中,转到“New”,在搜索框输入“Storage”,选择“Storage account – Blob,file, table, queue”。
然后,在“Create Storage Account ”中,输入存储帐户的名称,选择存储IoTHub的同一位置(这里为East Asia),然后选择“Create”。 请记下该名称供稍后使用。
接着,转到刚刚创建的存储帐户,选择“Blob Service”。为Azure Stream Analytics 模块创建一个新容器用于存储数据,将访问级别设置为“Container”,选择“确定”。
2. 创建Azure Stream Analytics Job
首先,在 Azure 门户中,转到“Create” > “Internet of Things”,然后选择“Stream Analytics Job”。
然后,在“New Stream Analytics Job”中执行以下操作:在“Job name”框中键入作业名称;在”Hosting Environment”下,选择“Edge”;在剩余字段中使用默认值。
接着,在所创建作业中的“Job Topology”下,依次选择“Input”-“Add”。在“Input alias”框中,输入 temperature。在“Source Type”框中,选择“Data stream”。在剩余字段中使用默认值。
接下来,在所创建作业中的“Job Topology”下,依次选择“Output”-“Add”, 在“输出别名”框中,键入 alert,在剩余字段中使用默认值。之后选择“创建” 。
最后,在在所创建作业中的“Job Topology”下,依次选择“Query”-“Add”, 加入以下SQL语句并保存
SELECT
‘reset’ AS command
INTO
alert
FROM
temperature TIMESTAMP BY timeCreated
GROUP BY TumblingWindow(second,30)
HAVING Avg(machine.temperature) > 70
3. 部署Stream Analytics Job
首先,在 Azure Portal 的 IoTHub页面内,转到“IoT Edge”并打开 IoT Edge 设备的详细信息页。
选择“Set Modules”,并确保已经按照之前文章中的步骤添加了tempSensor模块,因为这里的Azure Stream Analytics模块是针对tempSensor模块产生的数据来进行实时分析的。
在“Add Modules”页面,选择“Import Azure Stream Analytics IoT Edge Module”,
在接下来的Edge Deployment页面,选择之前创建好的Stream Analytics – Edge Job,注意,这里要选择之前第一部分已经创建好的存储账户和Container,点击保存,如下图所示。
之后,将一下代码复制到Routes,将{moduleName}替换为复制的模块名称:
{
“routes”: {
“telemetryToCloud”: “FROM /messages/modules/tempSensor/* INTO $upstream”,
“alertsToCloud”: “FROM /messages/modules/{moduleName}/* INTO $upstream”,
“alertsToReset”: “FROM /messages/modules/{moduleName}/* INTO BrokeredEndpoint(“/modules/tempSensor/inputs/control”)”,
“telemetryToAsa”: “FROM /messages/modules/tempSensor/* INTO BrokeredEndpoint(“/modules/{moduleName}/inputs/temperature”)”
}
}
选择下一步,然后Submit。返回到“设备详细信息”页,并选择“刷新”。应会看到新的流分析模块已经在列表中,但是状态还是处于Pending Deployment。
一段时间以后,等该Module部署到设备以后,刷新列表,可以发现,EdgeASA已经处于running状态。
回到Putty工具,利用“docker logs -f {moduleName} ”指令(其中,{moduleName} 用刚刚部署的流分析模块的名称代替),就可以查看流分析的日志信息。
至此,我们完成了存储账户的创建、Azure Stream Analytics Job的创建和Azure Stream Analytics Job的部署与运行。
实际的生产环境中,IoT 设备可以生成大量的数据。 为了减少上传的数据量或降低控制策略的延时,有时必须在设备端对数据进行实时分析或处理。Azure Stream Analytics 服务就是很好的解决方案之一,用户可以从Azure Portal中创建Azure Stream Analytics 服务,然后在 Azure IoTHub 中将其设置为 IoT Edge Module 并部署到Azure IoT Edge设备上。本文将演示如何创建Azure Stream Analytics Job, 并将其部署到 IoT Edge 设备上。1. 创建存储账户 首先,在 Azure 门户中,转到“New”,在搜索框输入“Storage”,选择“Storage account – Blob,file, table, queue”。 然后,在“Create Storage Account ”中,输入存储帐户的名称,选择存储IoTHub的同一位置(这里为East Asia),然后选择“Create”。 请记下该名称供稍后使用。 接着,转到刚刚创建的存储帐户,选择“Blob Service”。为Azure Stream Analytics 模块创建一个新容器用于存储数据,将访问级别设置为“Container”,选择“确定”。 2. 创建Azure Stream Analytics Job 首先,在 Azure 门户中,转到“Create” > “Internet of Things”,然后选择“Stream Analytics Job”。 然后,在“New Stream Analytics Job”中执行以下操作:在“Job name”框中键入作业名称;在”Hosting Environment”下,选择“Edge”;在剩余字段中使用默认值。 接着,在所创建作业中的“Job Topology”下,依次选择“Input”-“Add”。在“Input alias”框中,输入 temperature。在“Source Type”框中,选择“Data stream”。在剩余字段中使用默认值。 接下来,在所创建作业中的“Job Topology”下,依次选择“Output”-“Add”, 在“输出别名”框中,键入 alert,在剩余字段中使用默认值。之后选择“创建” 。 最后,在在所创建作业中的“Job Topology”下,依次选择“Query”-“Add”, 加入以下SQL语句并保存SELECT ‘reset’ AS commandINTO alertFROM temperature TIMESTAMP BY timeCreatedGROUP BY TumblingWindow(second,30)HAVING Avg(machine.temperature) > 703. 部署Stream Analytics Job 首先,在 Azure Portal 的 IoTHub页面内,转到“IoT Edge”并打开 IoT Edge 设备的详细信息页。 选择“Set Modules”,并确保已经按照之前文章中的步骤添加了tempSensor模块,因为这里的Azure Stream Analytics模块是针对tempSensor模块产生的数据来进行实时分析的。 在“Add Modules”页面,选择“Import Azure Stream Analytics IoT Edge Module”, 在接下来的Edge Deployment页面,选择之前创建好的Stream Analytics – Edge Job,注意,这里要选择之前第一部分已经创建好的存储账户和Container,点击保存,如下图所示。 之后,将一下代码复制到Routes,将{moduleName}替换为复制的模块名称:{ “routes”: { “telemetryToCloud”: “FROM /messages/modules/tempSensor/* INTO $upstream”, “alertsToCloud”: “FROM /messages/modules/{moduleName}/* INTO $upstream”, “alertsToReset”: “FROM /messages/modules/{moduleName}/* INTO BrokeredEndpoint(“/modules/tempSensor/inputs/control”)”, “telemetryToAsa”: “FROM /messages/modules/tempSensor/* INTO BrokeredEndpoint(“/modules/{moduleName}/inputs/temperature”)” }} 选择下一步,然后Submit。返回到“设备详细信息”页,并选择“刷新”。应会看到新的流分析模块已经在列表中,但是状态还是处于Pending Deployment。 一段时间以后,等该Module部署到设备以后,刷新列表,可以发现,EdgeASA已经处于running状态。 回到Putty工具,利用“docker logs -f {moduleName} ”指令(其中,{moduleName} 用刚刚部署的流分析模块的名称代替),就可以查看流分析的日志信息。 至此,我们完成了存储账户的创建、Azure Stream Analytics Job的创建和Azure Stream Analytics Job的部署与运行。 Read More
store images in a table
Hello,
I have three images and want to store them in a table. I wrote this in command line:
dinfo = dir(‘*.jpg’);
T = table();
for K = 1 : length(dinfo)
filename = dinfo(K).name;
filecontent = imread(filename);
T{filename,1} = filecontent;
end
It gives the error:
To assign to or create a variable in a table, the number of rows must match the height of the table.
Secondly, I want to make my three images equal in size, as we have to make the size of variables in rows equal for tables.
Help needed. Thanks in advance.Hello,
I have three images and want to store them in a table. I wrote this in command line:
dinfo = dir(‘*.jpg’);
T = table();
for K = 1 : length(dinfo)
filename = dinfo(K).name;
filecontent = imread(filename);
T{filename,1} = filecontent;
end
It gives the error:
To assign to or create a variable in a table, the number of rows must match the height of the table.
Secondly, I want to make my three images equal in size, as we have to make the size of variables in rows equal for tables.
Help needed. Thanks in advance. Hello,
I have three images and want to store them in a table. I wrote this in command line:
dinfo = dir(‘*.jpg’);
T = table();
for K = 1 : length(dinfo)
filename = dinfo(K).name;
filecontent = imread(filename);
T{filename,1} = filecontent;
end
It gives the error:
To assign to or create a variable in a table, the number of rows must match the height of the table.
Secondly, I want to make my three images equal in size, as we have to make the size of variables in rows equal for tables.
Help needed. Thanks in advance. matlab tables, table, database MATLAB Answers — New Questions
Planner and Project Plan 3
Does the Microsoft Project Management Plan 3 included Microsoft Office 365 Email?
Does the Microsoft Project Management Plan 3 included Microsoft Office 365 Email? Read More
Unable to find copilot button in office app
Hi,
I was using office 365 and today i have purchased Copilot Pro license but not getting copilot button in any office app, also not getting in Add ins.please help
Hi, I was using office 365 and today i have purchased Copilot Pro license but not getting copilot button in any office app, also not getting in Add ins.please help Read More
Cannot run kernel – Simulink Desktop Real-time
When I try to use the Desktop-Real-Time/Stream input in the simulink, and start a simulation, it apears a error message like "cannot acess kernel". Why do this happen? How it can be solved? Thanks!
The error message is: "Hardware time cannot be allocated. Real time kernel cannot run"When I try to use the Desktop-Real-Time/Stream input in the simulink, and start a simulation, it apears a error message like "cannot acess kernel". Why do this happen? How it can be solved? Thanks!
The error message is: "Hardware time cannot be allocated. Real time kernel cannot run" When I try to use the Desktop-Real-Time/Stream input in the simulink, and start a simulation, it apears a error message like "cannot acess kernel". Why do this happen? How it can be solved? Thanks!
The error message is: "Hardware time cannot be allocated. Real time kernel cannot run" simulink, kernel MATLAB Answers — New Questions
problem in simulink (FOPID controller)
Derivative of state ‘1’ in block ‘FOPIDC/Fractional PID controller1/Fractional derivative1/Transfer
Fcn1′ at time 3.2188803386168852 is not finite. The simulation will be stopped. There may be a
singularity in the solution. If not, try reducing the step size (either by reducing the fixed step
size or by tightening the error tolerances)
how can I solve this errorDerivative of state ‘1’ in block ‘FOPIDC/Fractional PID controller1/Fractional derivative1/Transfer
Fcn1′ at time 3.2188803386168852 is not finite. The simulation will be stopped. There may be a
singularity in the solution. If not, try reducing the step size (either by reducing the fixed step
size or by tightening the error tolerances)
how can I solve this error Derivative of state ‘1’ in block ‘FOPIDC/Fractional PID controller1/Fractional derivative1/Transfer
Fcn1′ at time 3.2188803386168852 is not finite. The simulation will be stopped. There may be a
singularity in the solution. If not, try reducing the step size (either by reducing the fixed step
size or by tightening the error tolerances)
how can I solve this error fopid MATLAB Answers — New Questions