Category: News
Cross-section (Need help to correct the code or modify it )
Dear all
I need to correct or modify the following code to give the attached figure: clc
close all;
clear;
% Define the given arrays
x1 =[0, 1, 2, 3, 3.7];
z1 =[6, 6, 6, 6, 6];
x2 =[4.1, 5, 6, 7, 8, 9];
z2 =[4, 4, 4, 4, 4, 4];
x3 =[9, 10, 10, 11,12, 13, 14, 15, 16, 16.4];
z3 =[6, 6, 6, 6, 6, 6, 6, 6, 6, 6];
x4 =[15.3, 16, 17, 18, 19];
z4 =[3, 3, 3, 3, 3];
x =[x1,x2,x3,x4];
z =[z1,z2,z3,z4];
%x = [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21];
%z = [2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 1 1 1 1 1 1];
% Find sudden changes in depth
sudden_changes = diff(z);
% Find indices where sudden changes occur
fault_indices = find(sudden_changes ~= 0) + 1;
% Initialize variables to store fault information
fault_locations = [];
fault_angles = [];
fault_types = {};
% Plot the top of the rock formation
plot(x, z, ‘-o’);
hold on;
grid on;
% Earth’s surface
earth_surface = zeros(size(x));
% Plot fault lines and gather fault information
for i = 1:length(fault_indices)
idx = fault_indices(i);
plot([x(idx-1), x(idx)], [z(idx-1), z(idx)], ‘r–‘);
% Calculate intersection point with Earth’s surface
intersection_x = x(idx-1) – z(idx-1) * (x(idx) – x(idx-1)) / (z(idx) – z(idx-1));
plot(intersection_x, 0, ‘ro’); % Plot intersection point
set(gca, ‘YDir’, ‘reverse’);
% Calculate dip angle using the tan-rule
dip_angle = atand((z(idx) – z(idx-1)) / (x(idx) – x(idx-1)));
% Determine fault type
if dip_angle <= 90
fault_type = ‘Normal’;
plot(intersection_x, 0, ‘go’); % Plot normal fault intersection point
elseif dip_angle > 90
fault_type = ‘Reverse’;
plot(intersection_x, 0, ‘mo’); % Plot reverse fault intersection point
else
fault_type = ‘Strike-Slip’;
end
% Store fault information
fault_locations = [fault_locations; intersection_x];
fault_angles = [fault_angles; dip_angle];
fault_types{end+1} = fault_type;
end
% Display fault information in a table
if isempty(fault_indices)
% Display a message if there are no faults
disp(‘No fault lines detected.’);
else
% Display fault information in a table
T = table(fault_locations, fault_angles, fault_types’, …
‘VariableNames’, {‘Location’, ‘Angle’, ‘Type’});
disp(T);
endDear all
I need to correct or modify the following code to give the attached figure: clc
close all;
clear;
% Define the given arrays
x1 =[0, 1, 2, 3, 3.7];
z1 =[6, 6, 6, 6, 6];
x2 =[4.1, 5, 6, 7, 8, 9];
z2 =[4, 4, 4, 4, 4, 4];
x3 =[9, 10, 10, 11,12, 13, 14, 15, 16, 16.4];
z3 =[6, 6, 6, 6, 6, 6, 6, 6, 6, 6];
x4 =[15.3, 16, 17, 18, 19];
z4 =[3, 3, 3, 3, 3];
x =[x1,x2,x3,x4];
z =[z1,z2,z3,z4];
%x = [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21];
%z = [2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 1 1 1 1 1 1];
% Find sudden changes in depth
sudden_changes = diff(z);
% Find indices where sudden changes occur
fault_indices = find(sudden_changes ~= 0) + 1;
% Initialize variables to store fault information
fault_locations = [];
fault_angles = [];
fault_types = {};
% Plot the top of the rock formation
plot(x, z, ‘-o’);
hold on;
grid on;
% Earth’s surface
earth_surface = zeros(size(x));
% Plot fault lines and gather fault information
for i = 1:length(fault_indices)
idx = fault_indices(i);
plot([x(idx-1), x(idx)], [z(idx-1), z(idx)], ‘r–‘);
% Calculate intersection point with Earth’s surface
intersection_x = x(idx-1) – z(idx-1) * (x(idx) – x(idx-1)) / (z(idx) – z(idx-1));
plot(intersection_x, 0, ‘ro’); % Plot intersection point
set(gca, ‘YDir’, ‘reverse’);
% Calculate dip angle using the tan-rule
dip_angle = atand((z(idx) – z(idx-1)) / (x(idx) – x(idx-1)));
% Determine fault type
if dip_angle <= 90
fault_type = ‘Normal’;
plot(intersection_x, 0, ‘go’); % Plot normal fault intersection point
elseif dip_angle > 90
fault_type = ‘Reverse’;
plot(intersection_x, 0, ‘mo’); % Plot reverse fault intersection point
else
fault_type = ‘Strike-Slip’;
end
% Store fault information
fault_locations = [fault_locations; intersection_x];
fault_angles = [fault_angles; dip_angle];
fault_types{end+1} = fault_type;
end
% Display fault information in a table
if isempty(fault_indices)
% Display a message if there are no faults
disp(‘No fault lines detected.’);
else
% Display fault information in a table
T = table(fault_locations, fault_angles, fault_types’, …
‘VariableNames’, {‘Location’, ‘Angle’, ‘Type’});
disp(T);
end Dear all
I need to correct or modify the following code to give the attached figure: clc
close all;
clear;
% Define the given arrays
x1 =[0, 1, 2, 3, 3.7];
z1 =[6, 6, 6, 6, 6];
x2 =[4.1, 5, 6, 7, 8, 9];
z2 =[4, 4, 4, 4, 4, 4];
x3 =[9, 10, 10, 11,12, 13, 14, 15, 16, 16.4];
z3 =[6, 6, 6, 6, 6, 6, 6, 6, 6, 6];
x4 =[15.3, 16, 17, 18, 19];
z4 =[3, 3, 3, 3, 3];
x =[x1,x2,x3,x4];
z =[z1,z2,z3,z4];
%x = [0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21];
%z = [2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 1 1 1 1 1 1];
% Find sudden changes in depth
sudden_changes = diff(z);
% Find indices where sudden changes occur
fault_indices = find(sudden_changes ~= 0) + 1;
% Initialize variables to store fault information
fault_locations = [];
fault_angles = [];
fault_types = {};
% Plot the top of the rock formation
plot(x, z, ‘-o’);
hold on;
grid on;
% Earth’s surface
earth_surface = zeros(size(x));
% Plot fault lines and gather fault information
for i = 1:length(fault_indices)
idx = fault_indices(i);
plot([x(idx-1), x(idx)], [z(idx-1), z(idx)], ‘r–‘);
% Calculate intersection point with Earth’s surface
intersection_x = x(idx-1) – z(idx-1) * (x(idx) – x(idx-1)) / (z(idx) – z(idx-1));
plot(intersection_x, 0, ‘ro’); % Plot intersection point
set(gca, ‘YDir’, ‘reverse’);
% Calculate dip angle using the tan-rule
dip_angle = atand((z(idx) – z(idx-1)) / (x(idx) – x(idx-1)));
% Determine fault type
if dip_angle <= 90
fault_type = ‘Normal’;
plot(intersection_x, 0, ‘go’); % Plot normal fault intersection point
elseif dip_angle > 90
fault_type = ‘Reverse’;
plot(intersection_x, 0, ‘mo’); % Plot reverse fault intersection point
else
fault_type = ‘Strike-Slip’;
end
% Store fault information
fault_locations = [fault_locations; intersection_x];
fault_angles = [fault_angles; dip_angle];
fault_types{end+1} = fault_type;
end
% Display fault information in a table
if isempty(fault_indices)
% Display a message if there are no faults
disp(‘No fault lines detected.’);
else
% Display fault information in a table
T = table(fault_locations, fault_angles, fault_types’, …
‘VariableNames’, {‘Location’, ‘Angle’, ‘Type’});
disp(T);
end cross-section, dip angle, location MATLAB Answers — New Questions
A question from an artical “Isocost Lines Describe the Cellular Economy of Genetic Circuits”
Here is the link of this artical’s supplementary information:
https://www.cell.com/cms/10.1016/j.bpj.2015.06.034/attachment/4346d19d-fad3-4cb8-87d3-8d4c7baa6cc9/mmc1.pdf
How they achieve this linear constraint, the alpha and beta?
I am new in math so if there are codes provived, I will be appreciated.Here is the link of this artical’s supplementary information:
https://www.cell.com/cms/10.1016/j.bpj.2015.06.034/attachment/4346d19d-fad3-4cb8-87d3-8d4c7baa6cc9/mmc1.pdf
How they achieve this linear constraint, the alpha and beta?
I am new in math so if there are codes provived, I will be appreciated. Here is the link of this artical’s supplementary information:
https://www.cell.com/cms/10.1016/j.bpj.2015.06.034/attachment/4346d19d-fad3-4cb8-87d3-8d4c7baa6cc9/mmc1.pdf
How they achieve this linear constraint, the alpha and beta?
I am new in math so if there are codes provived, I will be appreciated. computational biology MATLAB Answers — New Questions
How to download Spotify to MP3 (high quality version) on Windows 11?
Hello everyone,
I wanted to download Spotify songs to listen to while driving. But I have tried many methods but cannot download high-quality Spotify songs. Is there any solution? I’m currently using Windows 11. Thanks for any advice.
Sincerely,
Hazel
Hello everyone,I wanted to download Spotify songs to listen to while driving. But I have tried many methods but cannot download high-quality Spotify songs. Is there any solution? I’m currently using Windows 11. Thanks for any advice. Sincerely,Hazel Read More
Prioritize Security Incidents Based on Data Importance | Microsoft Defender with Microsoft Purview
Prioritize incidents based on data significance, detect insider risks, and adapt protections in real-time with Microsoft Defender XDR and Microsoft Purview. Customize thresholds and risk indicators to detect anomalous behavior and prevent potential breaches with Adaptive Protection. Receive real-time DLP alerts triggered by policy matches, ensuring immediate action to safeguard sensitive data. Gain comprehensive visibility into threats and enforce policies across all devices and applications.
Sravan Kumar Mera, Principal Product Manager for Microsoft Purview shares how to stay ahead of evolving threats and maintain data integrity.
Identify and protect sensitive data.
Prioritize and contain incidents based on insider risks and the importance of the data. Check out Microsoft Defender XDR with Microsoft Purview context.
Automate blocks to resources for elevated risk insiders or compromised accounts.
Use the new Conditional Access policies that now assess Insider Risk from Microsoft Purview. And see it all within your Microsoft Defender incidents.
Define labels and policies for sensitive information.
Enable automatic enforcement across apps and devices that can also be analyzed in Microsoft Defender incidents. Set up a data security foundation with Microsoft Purview.
Watch our full video here:
QUICK LINKS:
00:00 — Prioritize security incidents based on data importance
00:42 — High severity multistage incident
01:29 — DLP alerts
02:24 — Insider risk activity summary
03:30 — Set up data security foundation
04:47 — Adaptive Protection
05:50 — DLP policy & Conditional Access
06:33 — Wrap up
Link References
Get started at https://purview.microsoft.com
Watch our data security playlist at https://aka.ms/datasecuritymechanics
Unfamiliar with Microsoft Mechanics?
As Microsoft’s official video series for IT, you can watch and share valuable content and demos of current and upcoming tech from the people who build it at Microsoft.
Subscribe to our YouTube: https://www.youtube.com/c/MicrosoftMechanicsSeries
Talk with other IT Pros, join us on the Microsoft Tech Community: https://techcommunity.microsoft.com/t5/microsoft-mechanics-blog/bg-p/MicrosoftMechanicsBlog
Watch or listen from anywhere, subscribe to our podcast: https://microsoftmechanics.libsyn.com/podcast
Keep getting this insider knowledge, join us on social:
Follow us on Twitter: https://twitter.com/MSFTMechanics
Share knowledge on LinkedIn: https://www.linkedin.com/company/microsoft-mechanics/
Enjoy us on Instagram: https://www.instagram.com/msftmechanics/
Loosen up with us on TikTok: https://www.tiktok.com/@msftmechanics
Video Transcript:
-Your data is the primary target in most security incidents, but when an incident occurs, do you have the information you need to prioritize incidents and contain them based on the importance of the data itself?
-Well, this hasn’t been an easy problem to solve for, which is why we are making this easier with the fusion of Microsoft Defender XDR to detect and respond to security incidents with signals infused from Microsoft Purview for the identification and protection of your sensitive data.
-This native integration first helps you to quickly prioritize active incidents, based on the importance of compromised data, and display that detail in context, as you investigate and contain threats in Microsoft Defender. Let me show you an example from Microsoft Defender of how these natively integrated solutions work in action.
-Here in the Incidents view, I’ll dig into this high severity multi-stage incident involving initial access and data exfiltration. One of the best ways to follow a multi-stage attack is by using the Attack Story timeline on the left.
-And here we can see from these first couple of email alerts that Megan Bowen was phished and most likely her Contoso credentials were stolen by an external attacker. Importantly, here the integrated signal from Microsoft Purview has triggered multiple data loss prevention, or DLP, alerts for sharing payment cards, then a few PowerPoint presentations. You might notice that this attack spans over a couple of days, and these actions therefore could be considered normal use for Megan. Let’s dig into this DLP alert.
-We can see that the attacker is actually using Megan’s credentials to access her managed Cloud PC in Windows 365 to remain undetected. And you can see that a ZIP file was uploaded to a personal cloud storage location. And there’s even more to it.
-If I head over to the details on the right, and scroll all the way down to the bottom, the incident has been flagged with high insider risk severity. And by the way, on the back end in Microsoft Purview, Megan’s insider risk level is now elevated, but more on that in a second.
-This is important because, if you’re new to Insider Risk Management in Microsoft Purview, this can be set up to flag potentially risky activities either by users inside your organization, or, as in the case of persistent attacks where someone’s identity may have been hijacked, it can flag a sequence of potentially risky activities that may lead to a data security incident. I’ll show you the controls for setting that up in a moment.
-For now, still in Microsoft Defender, let’s drill into Megan’s insider risk activity summary And we can see the story unfold. The user utilizing Megan’s credentials began by downgrading labels in files on a SharePoint site. This is interesting because it shows one of the techniques the attacker is using to stay under the radar and out of sight.
-For example, a file might be labeled as Confidential and manually downgraded to General to bypass the protections scoped to Confidential files. In fact, going back to the Activity timeline view in Defender, we can see, files were then downloaded to a managed device, which, in our case, is the Windows 365 Cloud PC. These sensitive files were zipped and then uploaded onto personal cloud storage outside of our management boundary.
-And because on the back end Megan’s insider risk level is elevated, and based on configured protections, further activities are now blocked outright. So, I’ve shown how the fusion between Microsoft Defender XDR and the data security solutions in Microsoft Purview automatically contained the attack while providing full visibility into the sensitive data involved in the incident.
-Now let me show you how sensitive data signals and their protections from Microsoft Purview are established, so that they can be surfaced in Microsoft Defender XDR. If you’re new to this, it all starts with setting up your data security foundation in Microsoft Purview. Here labels and classifications for your data can be configured in the Microsoft Purview portal.
-I have labels defined for everything from personal to highly confidential information Protection policies can then be automatically triggered and enforced based on these labels and more than 300 sensitive information types, spanning account numbers, addresses, ID numbers, and more.
-Additionally, these policies can also leverage automatic file classifications, which leverage AI to determine the type of content within the files, like source code, financial information, healthcare, legal files, and others.
-In fact, the policies you set in Microsoft Purview can be enforced on your managed devices, while using Microsoft 365 apps, even third-party apps like Adobe Acrobat for PDFs, and as you work with files in the browser. And with everything set up, the signals derived from policy matches will flow directly into Microsoft Defender.
-And by the way, to learn more about data security and your options, we’ve created an entire playlist with deep dives at aka.ms/datasecuritymechanics. Now let’s look at what made it possible to trigger the protections based on Megan’s elevated insider risk level. This was made possible by a capability in Microsoft Purview, known as Adaptive Protection, where protections automatically adapt according to a user’s changing risk profile, based on signals from Insider Risk Management, which are assessed in real-time.
-To set up Adaptive Protection, you will establish the thresholds at each risk level. For example, you have a threshold that you can establish for minor risk, another for moderate risk, and, finally, elevated risk. These thresholds align with the risk indicators you define. And there are dozens that you can choose from, and you can also create custom ones.
-For example, when the attacker downgraded the file labels to make them appear less sensitive, this is the risk indicator that was triggered. In fact, there are many risk indicators that you can define as part of Insider Risk Management policies for assessing risky behavior. These even include machine learning-based comparisons of a user’s activity versus their peers to flag any unusual behaviors.
-And as risky activities meet your defined threshold levels, the protections can adapt with DLP policy enforcement or with Conditional Access controls. For example, access was blocked to resources once Megan’s insider risk level shifted to elevated.
-What made this possible is a new Insider Risk condition in Microsoft Entra Conditional Access, which checks insider risk level in real time during authentication. This policy will apply to any user with elevated insider risk. And if it finds a match, like in our case, under Grant, it’s been configured to block access to corporate resources.
-So, even though we haven’t yet reset Megan’s credentials, if the attacker tries to use them, they’ll get this message and be blocked. Importantly, the policy protections you set and its corresponding signal from Microsoft Purview flows directly into Microsoft Defender XDR to help you assess the value of compromised data and even contain attacks using Conditional Access controls.
-To get started, head over to purview.microsoft.com And subscribe to Microsoft Mechanics for the latest updates. Thanks for watching!
Microsoft Tech Community – Latest Blogs –Read More
Very important questions BEFORE I install full version of Windows 11 Enterprise
The ONLY way I will consider going to Windows 11 is the Enterprise Edition (64-bit ISO). I have some questions. I use Steam for games. Furthermore, I use Office 365. Will both those programs, games, my nVidia RTX graphics card work as normal, just like in Windows 10 Pro and 11 Pro??? And eventually I may want to use a local account only. But I know if I install and use Office 365 I will have to sign in to download and install or check my account profile, payments, etc.
The ONLY way I will consider going to Windows 11 is the Enterprise Edition (64-bit ISO). I have some questions. I use Steam for games. Furthermore, I use Office 365. Will both those programs, games, my nVidia RTX graphics card work as normal, just like in Windows 10 Pro and 11 Pro??? And eventually I may want to use a local account only. But I know if I install and use Office 365 I will have to sign in to download and install or check my account profile, payments, etc. Read More
How do I use the buffer function to operate real time on EEG signal files?
Hello, I’ve got a code where I detect signals through thresholding, but I’d like for the thresholding to reapply to the signal every 40 seconds or so if I enter a 5 minute signal. I’ve found buffering can help with this, but I am having some issues applying it. I want to segment the signal into 40 second segments (can be overlapping or non overlapping), however since the original signal (300 seconds) has been multiplied by the frequency 256, it is now 76800 values and I’m slightly confused. I am not sure which variables to alter, and the wiki example doesn’t seem to apply to my signal type. I help appreciate some help understanding how the function works and how to apply if possible.
eegsignal = (data_array2(710656:787456)); %signal to be inserted around 5 mins long
%contains non-seizure and then seizure
fs = 256;
frame_length = 40
signal_length = 300*256
sig = buffer(1:76800,40);
n = 5;
p = 1;
opt = -5;
z = [];
for i = 1:size(sig,2)
x = sig(:,i);
[y,z,oppt] = buffer([z;x],n,p,opt);
if i <= 4
disp(‘no seizure’)
end
opt = oppt;
endHello, I’ve got a code where I detect signals through thresholding, but I’d like for the thresholding to reapply to the signal every 40 seconds or so if I enter a 5 minute signal. I’ve found buffering can help with this, but I am having some issues applying it. I want to segment the signal into 40 second segments (can be overlapping or non overlapping), however since the original signal (300 seconds) has been multiplied by the frequency 256, it is now 76800 values and I’m slightly confused. I am not sure which variables to alter, and the wiki example doesn’t seem to apply to my signal type. I help appreciate some help understanding how the function works and how to apply if possible.
eegsignal = (data_array2(710656:787456)); %signal to be inserted around 5 mins long
%contains non-seizure and then seizure
fs = 256;
frame_length = 40
signal_length = 300*256
sig = buffer(1:76800,40);
n = 5;
p = 1;
opt = -5;
z = [];
for i = 1:size(sig,2)
x = sig(:,i);
[y,z,oppt] = buffer([z;x],n,p,opt);
if i <= 4
disp(‘no seizure’)
end
opt = oppt;
end Hello, I’ve got a code where I detect signals through thresholding, but I’d like for the thresholding to reapply to the signal every 40 seconds or so if I enter a 5 minute signal. I’ve found buffering can help with this, but I am having some issues applying it. I want to segment the signal into 40 second segments (can be overlapping or non overlapping), however since the original signal (300 seconds) has been multiplied by the frequency 256, it is now 76800 values and I’m slightly confused. I am not sure which variables to alter, and the wiki example doesn’t seem to apply to my signal type. I help appreciate some help understanding how the function works and how to apply if possible.
eegsignal = (data_array2(710656:787456)); %signal to be inserted around 5 mins long
%contains non-seizure and then seizure
fs = 256;
frame_length = 40
signal_length = 300*256
sig = buffer(1:76800,40);
n = 5;
p = 1;
opt = -5;
z = [];
for i = 1:size(sig,2)
x = sig(:,i);
[y,z,oppt] = buffer([z;x],n,p,opt);
if i <= 4
disp(‘no seizure’)
end
opt = oppt;
end buffer, real time, function, eeg, image segmentation MATLAB Answers — New Questions
High fluctuation in Q0 value for TD3 agent while training.
I am training a TD3 RL agent for pick and place robot. The reward function is, reward = exp(-E/d) where E is the total energy consumed where the trajectory is complete and d is the distance of the object from the end-effector. The training went smoothly while using DQN agent but it fails when DDPG, TD3 are used. What could be the reasion for this? I used the following code for agent creation.
obsInfo = rlNumericSpec([34 1]);
actInfo = rlNumericSpec([14 1], …
LowerLimit=-1, …
UpperLimit= 1);
env = rlFunctionEnv(obsInfo,actInfo,"KondoStepFunction","KondoResetFunction");
agent = rlTD3Agent(obsInfo,actInfo);I am training a TD3 RL agent for pick and place robot. The reward function is, reward = exp(-E/d) where E is the total energy consumed where the trajectory is complete and d is the distance of the object from the end-effector. The training went smoothly while using DQN agent but it fails when DDPG, TD3 are used. What could be the reasion for this? I used the following code for agent creation.
obsInfo = rlNumericSpec([34 1]);
actInfo = rlNumericSpec([14 1], …
LowerLimit=-1, …
UpperLimit= 1);
env = rlFunctionEnv(obsInfo,actInfo,"KondoStepFunction","KondoResetFunction");
agent = rlTD3Agent(obsInfo,actInfo); I am training a TD3 RL agent for pick and place robot. The reward function is, reward = exp(-E/d) where E is the total energy consumed where the trajectory is complete and d is the distance of the object from the end-effector. The training went smoothly while using DQN agent but it fails when DDPG, TD3 are used. What could be the reasion for this? I used the following code for agent creation.
obsInfo = rlNumericSpec([34 1]);
actInfo = rlNumericSpec([14 1], …
LowerLimit=-1, …
UpperLimit= 1);
env = rlFunctionEnv(obsInfo,actInfo,"KondoStepFunction","KondoResetFunction");
agent = rlTD3Agent(obsInfo,actInfo); #robotics, #reinforcement learning, #matlab MATLAB Answers — New Questions
full list of M365 Copilot training and badges
Does a list of M365 Copilot training courses and badges exist?
Ideally, this would include learning goals for each course, and release/maintenance plans (inc. how often the quiz will update).
I want to understand if we can use MS Copilot badges for a genAI certification project I’m working on.
Thanks!
Does a list of M365 Copilot training courses and badges exist? Ideally, this would include learning goals for each course, and release/maintenance plans (inc. how often the quiz will update). I want to understand if we can use MS Copilot badges for a genAI certification project I’m working on.Thanks! Read More
Login failed for user ”. ClientConnectionId:dad1cf40-fedd-4779-a402-d018ddd61d80
I am passing user in connection details like this but getting Login failed for user ”. ClientConnectionId:dad1cf40-fedd-4779-a402-d018ddd61d80
SQLServerDataSource ds = new SQLServerDataSource();
ds.setServerName(“”); // Replace with your server name
ds.setDatabaseName(“”); // Replace with your database
ds.setUser(“**********”);
I am passing user in connection details like this but getting Login failed for user ”. ClientConnectionId:dad1cf40-fedd-4779-a402-d018ddd61d80 SQLServerDataSource ds = new SQLServerDataSource();ds.setServerName(“”); // Replace with your server nameds.setDatabaseName(“”); // Replace with your databaseds.setUser(“**********”); Read More
How do I disable notification center while using MHS until user enters session?
We are currently using Managed Home Screen for some android devices that are basically being used as office phones. We want them to be pretty locked down until a frontline worker needs to make calls, so we are having everyone log in to use the app. We want the users to be able to see and respond to notifications (texts and calls using a third-party VOIP app). We also want calls to come in whether or not someone is signed in. The issue comes in with the texting. When someone texts in the notification appears in the notification center when nobody is logged in and actually opens the full app. So someone could pick up the phone and bypass logging in if there is a notification in the notification center.
How do we disable the notification center until a user logs in without losing incoming call functionality? I understand some of the onus is probably on the app developers, but it would also behave exactly how we want if we could just keep the notification center from opening until a session starts.
Any ideas?
We are currently using Managed Home Screen for some android devices that are basically being used as office phones. We want them to be pretty locked down until a frontline worker needs to make calls, so we are having everyone log in to use the app. We want the users to be able to see and respond to notifications (texts and calls using a third-party VOIP app). We also want calls to come in whether or not someone is signed in. The issue comes in with the texting. When someone texts in the notification appears in the notification center when nobody is logged in and actually opens the full app. So someone could pick up the phone and bypass logging in if there is a notification in the notification center. How do we disable the notification center until a user logs in without losing incoming call functionality? I understand some of the onus is probably on the app developers, but it would also behave exactly how we want if we could just keep the notification center from opening until a session starts.Any ideas? Read More
Custom Scripting for Solution Gallery
Hi all,
I am learning some of the technical side of SharePoint and have a quick question. If I were to create a new site and wanted to upload a custom file as the template for the new site, would I need to have custom scripting enabled for the whole tenant?
My understanding is that it would be good to have it on in case any custom features would cause errors if turned off. I would be going through the solution gallery to upload this file.
Thank you for your help.
Hi all, I am learning some of the technical side of SharePoint and have a quick question. If I were to create a new site and wanted to upload a custom file as the template for the new site, would I need to have custom scripting enabled for the whole tenant? My understanding is that it would be good to have it on in case any custom features would cause errors if turned off. I would be going through the solution gallery to upload this file. Thank you for your help. Read More
Export Simulink Model as Standalone FMU – [FATAL][FMICAPI] Could not load the DLL: module not found. [FATAL][FMUCHK] Could not create the DLL loading mechanism(C-API) for CoSi
Hello everyone!
I exported a simulink model as a standalone FMU (FMI version 2.0). The model uses a variable step solver.
Re – Importing this FMU into simulink works quite fine, but I want to use it in python. My tool of choice is the "fmpy" library. When I want to simulate the model in python using simulate_fmu(‘NEWmodel2Export.fmu’), I get the following error message:
Exception: Failed to load shared library C:UsersjakobAppDataLocalTemptmpt98a7m_2binarieswin64NEWmodel2Export.dll. Could not find module ‘C:UsersjakobAppDataLocalTemptmpt98a7m_2binarieswin64NEWmodel2Export.dll’ (or one of its dependencies). Try using the full path with constructor syntax.
I also checked the FMU by using the FMUChecker 2.0.4. It returns the following (fatal) error messages, which could be dependent in my opinion:
[INFO][FMUCHK] No input data provided. In case of simulation initial values from FMU will be used.
[INFO][FMUCHK] Printing output file header
"time","h_Laufrad","mL"
[INFO][FMUCHK] Model identifier for CoSimulation: NEWmodel2Export
[INFO][FMILIB] Loading ‘win64’ binary with ‘default’ platform types
[FATAL][FMICAPI] Could not load the DLL: Das angegebene Modul wurde nicht gefunden.
[FATAL][FMUCHK] Could not create the DLL loading mechanism(C-API) for CoSimulation.
FMU check summary:
FMU reported:
0 warning(s) and error(s)
Checker reported:
0 Warning(s)
2 Error(s)
2 Fatal error(s) occurred during processing
I think that this might have something to do with the usage of the variable step solver.
Thank you very much in advance!Hello everyone!
I exported a simulink model as a standalone FMU (FMI version 2.0). The model uses a variable step solver.
Re – Importing this FMU into simulink works quite fine, but I want to use it in python. My tool of choice is the "fmpy" library. When I want to simulate the model in python using simulate_fmu(‘NEWmodel2Export.fmu’), I get the following error message:
Exception: Failed to load shared library C:UsersjakobAppDataLocalTemptmpt98a7m_2binarieswin64NEWmodel2Export.dll. Could not find module ‘C:UsersjakobAppDataLocalTemptmpt98a7m_2binarieswin64NEWmodel2Export.dll’ (or one of its dependencies). Try using the full path with constructor syntax.
I also checked the FMU by using the FMUChecker 2.0.4. It returns the following (fatal) error messages, which could be dependent in my opinion:
[INFO][FMUCHK] No input data provided. In case of simulation initial values from FMU will be used.
[INFO][FMUCHK] Printing output file header
"time","h_Laufrad","mL"
[INFO][FMUCHK] Model identifier for CoSimulation: NEWmodel2Export
[INFO][FMILIB] Loading ‘win64’ binary with ‘default’ platform types
[FATAL][FMICAPI] Could not load the DLL: Das angegebene Modul wurde nicht gefunden.
[FATAL][FMUCHK] Could not create the DLL loading mechanism(C-API) for CoSimulation.
FMU check summary:
FMU reported:
0 warning(s) and error(s)
Checker reported:
0 Warning(s)
2 Error(s)
2 Fatal error(s) occurred during processing
I think that this might have something to do with the usage of the variable step solver.
Thank you very much in advance! Hello everyone!
I exported a simulink model as a standalone FMU (FMI version 2.0). The model uses a variable step solver.
Re – Importing this FMU into simulink works quite fine, but I want to use it in python. My tool of choice is the "fmpy" library. When I want to simulate the model in python using simulate_fmu(‘NEWmodel2Export.fmu’), I get the following error message:
Exception: Failed to load shared library C:UsersjakobAppDataLocalTemptmpt98a7m_2binarieswin64NEWmodel2Export.dll. Could not find module ‘C:UsersjakobAppDataLocalTemptmpt98a7m_2binarieswin64NEWmodel2Export.dll’ (or one of its dependencies). Try using the full path with constructor syntax.
I also checked the FMU by using the FMUChecker 2.0.4. It returns the following (fatal) error messages, which could be dependent in my opinion:
[INFO][FMUCHK] No input data provided. In case of simulation initial values from FMU will be used.
[INFO][FMUCHK] Printing output file header
"time","h_Laufrad","mL"
[INFO][FMUCHK] Model identifier for CoSimulation: NEWmodel2Export
[INFO][FMILIB] Loading ‘win64’ binary with ‘default’ platform types
[FATAL][FMICAPI] Could not load the DLL: Das angegebene Modul wurde nicht gefunden.
[FATAL][FMUCHK] Could not create the DLL loading mechanism(C-API) for CoSimulation.
FMU check summary:
FMU reported:
0 warning(s) and error(s)
Checker reported:
0 Warning(s)
2 Error(s)
2 Fatal error(s) occurred during processing
I think that this might have something to do with the usage of the variable step solver.
Thank you very much in advance! standalone fmu, dll missing, variable step solver, could not create the dll loading mechanism(c-api), [fatal][fmicapi] could not load the dll: MATLAB Answers — New Questions
Invalid setting in ‘file/powergui’ for parameter ‘Value” caused by index position 1 exceeds array bounds. index must be not exceed 2.
Post Content Post Content discrete block MATLAB Answers — New Questions
Getting an error using writebmp (line 14) Expected X to be one of these types: logical, uint8, single, double
I am new to MATLAB and am getting the above error in my code. In my code, I read an altered (steganographic) image and extract a few bits from it. The embedding process went smoothly, but I am having some issues with the code’s extraction.
Here’s the code link https://drive.mathworks.com/sharing/5c7d84a6-d359-4856-9515-c637b9a7964dI am new to MATLAB and am getting the above error in my code. In my code, I read an altered (steganographic) image and extract a few bits from it. The embedding process went smoothly, but I am having some issues with the code’s extraction.
Here’s the code link https://drive.mathworks.com/sharing/5c7d84a6-d359-4856-9515-c637b9a7964d I am new to MATLAB and am getting the above error in my code. In my code, I read an altered (steganographic) image and extract a few bits from it. The embedding process went smoothly, but I am having some issues with the code’s extraction.
Here’s the code link https://drive.mathworks.com/sharing/5c7d84a6-d359-4856-9515-c637b9a7964d image processing, digital image processing, matlab code, matlab basics MATLAB Answers — New Questions
alt-enter (cell line breaks) works with the “right” ALT key, but not with the “left” ALT key
just wondering if there is a fix to this, perhaps settings. Is there a way to check if the left ALT key is the problem?
just wondering if there is a fix to this, perhaps settings. Is there a way to check if the left ALT key is the problem? Read More
How to use measured variables in simscape multibody
I’m pretty new to Simscape Multibody and self-taught. I’m trying to create the model of a 2DOF RR articulated arm with gravity compensation through the use of cable and spring (not yet modeled because i have some prior issues).
I want to impose cable length constant (I don’t think there’s a simple action to do it) and to do so i’m measuring the wrap angles of spool and pulley, as you can see in the slx attached. The problem is that i have to run the program first with the subsystem commented out to create the variables’ WA_spool1 and WA_perno1, and then i can generate the two rigid transforms in the subsystem and measure cable length.
Is it possible to use those variables in real time inside the simscape program, considering also their time dependency, without exporting them first to the workspace?I’m pretty new to Simscape Multibody and self-taught. I’m trying to create the model of a 2DOF RR articulated arm with gravity compensation through the use of cable and spring (not yet modeled because i have some prior issues).
I want to impose cable length constant (I don’t think there’s a simple action to do it) and to do so i’m measuring the wrap angles of spool and pulley, as you can see in the slx attached. The problem is that i have to run the program first with the subsystem commented out to create the variables’ WA_spool1 and WA_perno1, and then i can generate the two rigid transforms in the subsystem and measure cable length.
Is it possible to use those variables in real time inside the simscape program, considering also their time dependency, without exporting them first to the workspace? I’m pretty new to Simscape Multibody and self-taught. I’m trying to create the model of a 2DOF RR articulated arm with gravity compensation through the use of cable and spring (not yet modeled because i have some prior issues).
I want to impose cable length constant (I don’t think there’s a simple action to do it) and to do so i’m measuring the wrap angles of spool and pulley, as you can see in the slx attached. The problem is that i have to run the program first with the subsystem commented out to create the variables’ WA_spool1 and WA_perno1, and then i can generate the two rigid transforms in the subsystem and measure cable length.
Is it possible to use those variables in real time inside the simscape program, considering also their time dependency, without exporting them first to the workspace? simscape, multibody MATLAB Answers — New Questions
Issues with script writing mixed text/numeric data to file as a table
Hello, I am new to MATLAB and need to use a user-defined function IPtoCK to convert a set of people’s height and weight in inches and pounds to centimeters and kilograms, respectively, but then write the resulting data as well as calculated BMIs and BMI categories (i.e. underweight, normal, overweight, obese) into a formatted table in a text file. My user defined function works well enough but the output written to BMI.txt is not formatted correctly with one decimal place for all numeric values as I need them to be, no matter how I specify. They also only export some of the height data in centimeters to the text document, and in a matrix that appears to be of inconsistent delimiters and dimensions(?). I decided to enter the category entries as character arrays rather than strings so that they are all 1×1 vector containers rather than string arrays of various sizes, but I am also unsure of how to write the character arrays into a column vector in order to concatenate it onto the table with the numeric values, or otherwise have it show up as the last column in BMI.txt. Any advice would be appreciated! Thank you!!
Here is what the code writes to BMI.txt:
Height(cm) Weight(kg) BMI Category
148.0 171.0 177.0162.0 169.0 173.0164.0 170.0 174.0161.0 178.0 181.0173.0 170.0 158.0175.0 158.0 186.0175.0 173.0 166.0148.0 158.0 174.0194.0 177.0 173.0165.0 171.0 180.0167.0 189.0 158.0166.0 171.0 150.0176.0 171.0 171.0178.0 180.0 178.0165.0 170.0 174.0157.0 160.0 166.0171.0 188.0 45.2 72.0 66.8 75.9 70.4 67.6 66.9 66.4 79.7 58.2 62.2 77.8 82.9 56.1 55.6 79.7 43.0 86.1 77.4 70.8 57.0 50.3 58.1 78.1 94.1 68.8 83.4 62.2 60.1 70.3 71.3 84.3 64.1 64.0 89.1 40.5 67.4 66.5 68.0 86.7 76.7 71.8 63.2 73.0 63.4 60.0 46.9 62.7 59.0 74.4 20.6 24.6 21.3 28.9 24.6 22.6 24.9 23.0 26.3 22.5 19.6 23.7 27.7 19.4 22.3 26.0 17.2 24.9 25.3 23.7 20.7 23.0 23.3 25.8 25.0 22.0 27.9 22.8 20.6 21.7 25.6 23.6 25.7 23.2 30.5 18.0 21.8 22.7 23.3 27.4 23.7 22.7 23.2 25.3 20.9 24.3 18.3 22.8 20.2 21.0
And here is my code:
IP=readmatrix(‘HeightWeightIP.txt’);
format shortG
INCHES=[IP(:,1)];
POUNDS=[IP(:,2)];
I=INCHES;
P=POUNDS;
[C,K]=IPtoCK(INCHES,POUNDS);
CENTIMETERS=C;
KILOGRAMS=K;
BMI=[KILOGRAMS./(0.01.*CENTIMETERS).^2];
for CK=[1:length(BMI)]
if BMI(CK)<18.5
Category="underweight";
elseif BMI(CK)>=18.5 & BMI(CK)<25
Category="normal";
elseif BMI(CK)>=25 & BMI(CK)<30
Category="overweight";
else
Category="obese";
end
BMICAT=[BMI(CK)]
end
fid=fopen(‘BMI.txt’,’w’);
fprintf(fid, ‘Height(cm) Weight(kg) BMI Categoryn’)
fprintf(fid, ‘%5.1f %4.1f %4.1f’, CENTIMETERS, KILOGRAMS, BMI)Hello, I am new to MATLAB and need to use a user-defined function IPtoCK to convert a set of people’s height and weight in inches and pounds to centimeters and kilograms, respectively, but then write the resulting data as well as calculated BMIs and BMI categories (i.e. underweight, normal, overweight, obese) into a formatted table in a text file. My user defined function works well enough but the output written to BMI.txt is not formatted correctly with one decimal place for all numeric values as I need them to be, no matter how I specify. They also only export some of the height data in centimeters to the text document, and in a matrix that appears to be of inconsistent delimiters and dimensions(?). I decided to enter the category entries as character arrays rather than strings so that they are all 1×1 vector containers rather than string arrays of various sizes, but I am also unsure of how to write the character arrays into a column vector in order to concatenate it onto the table with the numeric values, or otherwise have it show up as the last column in BMI.txt. Any advice would be appreciated! Thank you!!
Here is what the code writes to BMI.txt:
Height(cm) Weight(kg) BMI Category
148.0 171.0 177.0162.0 169.0 173.0164.0 170.0 174.0161.0 178.0 181.0173.0 170.0 158.0175.0 158.0 186.0175.0 173.0 166.0148.0 158.0 174.0194.0 177.0 173.0165.0 171.0 180.0167.0 189.0 158.0166.0 171.0 150.0176.0 171.0 171.0178.0 180.0 178.0165.0 170.0 174.0157.0 160.0 166.0171.0 188.0 45.2 72.0 66.8 75.9 70.4 67.6 66.9 66.4 79.7 58.2 62.2 77.8 82.9 56.1 55.6 79.7 43.0 86.1 77.4 70.8 57.0 50.3 58.1 78.1 94.1 68.8 83.4 62.2 60.1 70.3 71.3 84.3 64.1 64.0 89.1 40.5 67.4 66.5 68.0 86.7 76.7 71.8 63.2 73.0 63.4 60.0 46.9 62.7 59.0 74.4 20.6 24.6 21.3 28.9 24.6 22.6 24.9 23.0 26.3 22.5 19.6 23.7 27.7 19.4 22.3 26.0 17.2 24.9 25.3 23.7 20.7 23.0 23.3 25.8 25.0 22.0 27.9 22.8 20.6 21.7 25.6 23.6 25.7 23.2 30.5 18.0 21.8 22.7 23.3 27.4 23.7 22.7 23.2 25.3 20.9 24.3 18.3 22.8 20.2 21.0
And here is my code:
IP=readmatrix(‘HeightWeightIP.txt’);
format shortG
INCHES=[IP(:,1)];
POUNDS=[IP(:,2)];
I=INCHES;
P=POUNDS;
[C,K]=IPtoCK(INCHES,POUNDS);
CENTIMETERS=C;
KILOGRAMS=K;
BMI=[KILOGRAMS./(0.01.*CENTIMETERS).^2];
for CK=[1:length(BMI)]
if BMI(CK)<18.5
Category="underweight";
elseif BMI(CK)>=18.5 & BMI(CK)<25
Category="normal";
elseif BMI(CK)>=25 & BMI(CK)<30
Category="overweight";
else
Category="obese";
end
BMICAT=[BMI(CK)]
end
fid=fopen(‘BMI.txt’,’w’);
fprintf(fid, ‘Height(cm) Weight(kg) BMI Categoryn’)
fprintf(fid, ‘%5.1f %4.1f %4.1f’, CENTIMETERS, KILOGRAMS, BMI) Hello, I am new to MATLAB and need to use a user-defined function IPtoCK to convert a set of people’s height and weight in inches and pounds to centimeters and kilograms, respectively, but then write the resulting data as well as calculated BMIs and BMI categories (i.e. underweight, normal, overweight, obese) into a formatted table in a text file. My user defined function works well enough but the output written to BMI.txt is not formatted correctly with one decimal place for all numeric values as I need them to be, no matter how I specify. They also only export some of the height data in centimeters to the text document, and in a matrix that appears to be of inconsistent delimiters and dimensions(?). I decided to enter the category entries as character arrays rather than strings so that they are all 1×1 vector containers rather than string arrays of various sizes, but I am also unsure of how to write the character arrays into a column vector in order to concatenate it onto the table with the numeric values, or otherwise have it show up as the last column in BMI.txt. Any advice would be appreciated! Thank you!!
Here is what the code writes to BMI.txt:
Height(cm) Weight(kg) BMI Category
148.0 171.0 177.0162.0 169.0 173.0164.0 170.0 174.0161.0 178.0 181.0173.0 170.0 158.0175.0 158.0 186.0175.0 173.0 166.0148.0 158.0 174.0194.0 177.0 173.0165.0 171.0 180.0167.0 189.0 158.0166.0 171.0 150.0176.0 171.0 171.0178.0 180.0 178.0165.0 170.0 174.0157.0 160.0 166.0171.0 188.0 45.2 72.0 66.8 75.9 70.4 67.6 66.9 66.4 79.7 58.2 62.2 77.8 82.9 56.1 55.6 79.7 43.0 86.1 77.4 70.8 57.0 50.3 58.1 78.1 94.1 68.8 83.4 62.2 60.1 70.3 71.3 84.3 64.1 64.0 89.1 40.5 67.4 66.5 68.0 86.7 76.7 71.8 63.2 73.0 63.4 60.0 46.9 62.7 59.0 74.4 20.6 24.6 21.3 28.9 24.6 22.6 24.9 23.0 26.3 22.5 19.6 23.7 27.7 19.4 22.3 26.0 17.2 24.9 25.3 23.7 20.7 23.0 23.3 25.8 25.0 22.0 27.9 22.8 20.6 21.7 25.6 23.6 25.7 23.2 30.5 18.0 21.8 22.7 23.3 27.4 23.7 22.7 23.2 25.3 20.9 24.3 18.3 22.8 20.2 21.0
And here is my code:
IP=readmatrix(‘HeightWeightIP.txt’);
format shortG
INCHES=[IP(:,1)];
POUNDS=[IP(:,2)];
I=INCHES;
P=POUNDS;
[C,K]=IPtoCK(INCHES,POUNDS);
CENTIMETERS=C;
KILOGRAMS=K;
BMI=[KILOGRAMS./(0.01.*CENTIMETERS).^2];
for CK=[1:length(BMI)]
if BMI(CK)<18.5
Category="underweight";
elseif BMI(CK)>=18.5 & BMI(CK)<25
Category="normal";
elseif BMI(CK)>=25 & BMI(CK)<30
Category="overweight";
else
Category="obese";
end
BMICAT=[BMI(CK)]
end
fid=fopen(‘BMI.txt’,’w’);
fprintf(fid, ‘Height(cm) Weight(kg) BMI Categoryn’)
fprintf(fid, ‘%5.1f %4.1f %4.1f’, CENTIMETERS, KILOGRAMS, BMI) character arrays MATLAB Answers — New Questions
User-defined monthly loan payment function issues
Hello! I am trying to create a very simple user-defined function to calculate monthly payments on a loan, but I am unsure why my function is returning "0". I am sure it must be a silly formatting error, but I would appreciate any help pointing out my mistake! Thank you!
% amort returns monthly payment of a loan given the loan amount, annual interest
% rate, and length of loan
% P=loan amount
% r=annual interest rate (in percent)
% N=length of loan in years
function [M]=amort(P,r,N)
M=P*((r/1200)/(1-(1+(r/1200)))^((-12)*N))Hello! I am trying to create a very simple user-defined function to calculate monthly payments on a loan, but I am unsure why my function is returning "0". I am sure it must be a silly formatting error, but I would appreciate any help pointing out my mistake! Thank you!
% amort returns monthly payment of a loan given the loan amount, annual interest
% rate, and length of loan
% P=loan amount
% r=annual interest rate (in percent)
% N=length of loan in years
function [M]=amort(P,r,N)
M=P*((r/1200)/(1-(1+(r/1200)))^((-12)*N)) Hello! I am trying to create a very simple user-defined function to calculate monthly payments on a loan, but I am unsure why my function is returning "0". I am sure it must be a silly formatting error, but I would appreciate any help pointing out my mistake! Thank you!
% amort returns monthly payment of a loan given the loan amount, annual interest
% rate, and length of loan
% P=loan amount
% r=annual interest rate (in percent)
% N=length of loan in years
function [M]=amort(P,r,N)
M=P*((r/1200)/(1-(1+(r/1200)))^((-12)*N)) user-defined function MATLAB Answers — New Questions
I don’t know what I’m wrong..
years = [1000, 1650, 1800, 1900, 1950, 1960, 1970, 1980, 1990];
population = [0.34, 0.545, 0.907, 1.61, 2.51, 3.15, 3.65, 4.2, 5.3];
x = years;
y = population;
A = [ones(length(x), 1), x’];
b = y’ ./ (1 + x’);
[Q, R] = householderQR(A);
c1 = Q’ * b;
c1 = c1(1:2);
x_hh = R c1;
tt = linspace(min(x), max(x), 100);
yy = (x_hh(1) + x_hh(2)*tt) ./ (1 + tt);
clf;
hold on;
plot(tt, yy, ‘LineWidth’, 2);
plot(x, y, ‘k*’, ‘MarkerSize’, 10, ‘LineWidth’, 2);
hold off;
grid on;
legend(‘Fitting Curve’, ‘Data Points’);
title(‘World Population Fitting Using Householder QR Factorization’);
xlabel(‘Year’);
ylabel(‘Population (billions)’);
function [Q, R] = householderQR(A)
[m, n] = size(A);
Q = eye(m);
R = A;
for k = 1:n
% Step 1: Define alpha
alpha = -sign(R(k, k)) * norm(R(k:m, k));
% Step 2: Define v
v = R(k:m, k);
v(1) = v(1) – alpha;
v = v / norm(v);
% Step 3: Define H
H = eye(m-k+1) – 2 * (v * v’);
H_full = eye(m);
H_full(k:m, k:m) = H;
% Step 4: Update R and Q
R = H_full * R;
Q = Q * H_full’;
end
% Adjust R to be upper triangular of size n x n
R = R(1:n, :);
end
What I wrote is the code of the below question.
A quick way of finding a function of the form f(x) ≈ (a + bx) / (1 + cx) is to apply the least squares method to the problem (1+cx)f(x) ≈ (a+bx). Use this technique to fit the world population (billions) data given using Householder QR method (without using built-in functions). Make a plot of the original data points along with resulting curve.
I don’t know why my code of my plot is not working. Could someone modify my code to work well?years = [1000, 1650, 1800, 1900, 1950, 1960, 1970, 1980, 1990];
population = [0.34, 0.545, 0.907, 1.61, 2.51, 3.15, 3.65, 4.2, 5.3];
x = years;
y = population;
A = [ones(length(x), 1), x’];
b = y’ ./ (1 + x’);
[Q, R] = householderQR(A);
c1 = Q’ * b;
c1 = c1(1:2);
x_hh = R c1;
tt = linspace(min(x), max(x), 100);
yy = (x_hh(1) + x_hh(2)*tt) ./ (1 + tt);
clf;
hold on;
plot(tt, yy, ‘LineWidth’, 2);
plot(x, y, ‘k*’, ‘MarkerSize’, 10, ‘LineWidth’, 2);
hold off;
grid on;
legend(‘Fitting Curve’, ‘Data Points’);
title(‘World Population Fitting Using Householder QR Factorization’);
xlabel(‘Year’);
ylabel(‘Population (billions)’);
function [Q, R] = householderQR(A)
[m, n] = size(A);
Q = eye(m);
R = A;
for k = 1:n
% Step 1: Define alpha
alpha = -sign(R(k, k)) * norm(R(k:m, k));
% Step 2: Define v
v = R(k:m, k);
v(1) = v(1) – alpha;
v = v / norm(v);
% Step 3: Define H
H = eye(m-k+1) – 2 * (v * v’);
H_full = eye(m);
H_full(k:m, k:m) = H;
% Step 4: Update R and Q
R = H_full * R;
Q = Q * H_full’;
end
% Adjust R to be upper triangular of size n x n
R = R(1:n, :);
end
What I wrote is the code of the below question.
A quick way of finding a function of the form f(x) ≈ (a + bx) / (1 + cx) is to apply the least squares method to the problem (1+cx)f(x) ≈ (a+bx). Use this technique to fit the world population (billions) data given using Householder QR method (without using built-in functions). Make a plot of the original data points along with resulting curve.
I don’t know why my code of my plot is not working. Could someone modify my code to work well? years = [1000, 1650, 1800, 1900, 1950, 1960, 1970, 1980, 1990];
population = [0.34, 0.545, 0.907, 1.61, 2.51, 3.15, 3.65, 4.2, 5.3];
x = years;
y = population;
A = [ones(length(x), 1), x’];
b = y’ ./ (1 + x’);
[Q, R] = householderQR(A);
c1 = Q’ * b;
c1 = c1(1:2);
x_hh = R c1;
tt = linspace(min(x), max(x), 100);
yy = (x_hh(1) + x_hh(2)*tt) ./ (1 + tt);
clf;
hold on;
plot(tt, yy, ‘LineWidth’, 2);
plot(x, y, ‘k*’, ‘MarkerSize’, 10, ‘LineWidth’, 2);
hold off;
grid on;
legend(‘Fitting Curve’, ‘Data Points’);
title(‘World Population Fitting Using Householder QR Factorization’);
xlabel(‘Year’);
ylabel(‘Population (billions)’);
function [Q, R] = householderQR(A)
[m, n] = size(A);
Q = eye(m);
R = A;
for k = 1:n
% Step 1: Define alpha
alpha = -sign(R(k, k)) * norm(R(k:m, k));
% Step 2: Define v
v = R(k:m, k);
v(1) = v(1) – alpha;
v = v / norm(v);
% Step 3: Define H
H = eye(m-k+1) – 2 * (v * v’);
H_full = eye(m);
H_full(k:m, k:m) = H;
% Step 4: Update R and Q
R = H_full * R;
Q = Q * H_full’;
end
% Adjust R to be upper triangular of size n x n
R = R(1:n, :);
end
What I wrote is the code of the below question.
A quick way of finding a function of the form f(x) ≈ (a + bx) / (1 + cx) is to apply the least squares method to the problem (1+cx)f(x) ≈ (a+bx). Use this technique to fit the world population (billions) data given using Householder QR method (without using built-in functions). Make a plot of the original data points along with resulting curve.
I don’t know why my code of my plot is not working. Could someone modify my code to work well? householderqr, least square method MATLAB Answers — New Questions
Ridiculously large driver install
Been on a skype call with my mum today because her C: drive was full, and we were trying to free up some space. During the usual DiskCleanups etc. we came across this.
The driver seems to be inconsequential, might have been something my Dad put there, maybe connected to mum’s original record player she got to hook up to the computer, I don’t know.
While it seems removing the driver will be fine, the reported size is giving me pause; how do I find out how a simple driver is taking up 41.2GB, yes GB, not MB, on the C drive. That’s more than a Witcher 3 install and half of Cyberpunk 2077 for a driver! So I want to make sure it’s not going to take a chunk of my mums data with it when it’s removed.
Best way to figure this out?
Been on a skype call with my mum today because her C: drive was full, and we were trying to free up some space. During the usual DiskCleanups etc. we came across this. The driver seems to be inconsequential, might have been something my Dad put there, maybe connected to mum’s original record player she got to hook up to the computer, I don’t know. While it seems removing the driver will be fine, the reported size is giving me pause; how do I find out how a simple driver is taking up 41.2GB, yes GB, not MB, on the C drive. That’s more than a Witcher 3 install and half of Cyberpunk 2077 for a driver! So I want to make sure it’s not going to take a chunk of my mums data with it when it’s removed. Best way to figure this out? Read More