Month: June 2024
Error in legends of subplots using a for loop
I want legends g_1=fr(1), g_1=fr(2), g_1=fr(3) for each plots in each window ha(kk). I am doing some mistake in legends, but couldn’t figured it out. Any suggestions please. Thanks.
[ha, pos]= tight_subplot(4,3,[.1 .15],[.13 .01],[.13 .1]);
fr=([0.1, 0.5, 1]);
[h0, h1]=size(fr);
% for jj=1:h1
for jj=1:3
for kk=1:12
lin={‘–‘,’-.’,’:’};
axes(ha(kk));
x=load(sprintf(‘frq_%d%d.dat’,jj,kk));
x1(jj)=loglog(x(:,33),x(:,kk+5),’linestyle’,lin{jj},’LineWidth’, 2.5);
hold on
ylabel([ha(1),ha(4), ha(7),ha(10)],’Deltaomega_{}’)
xlabel([ha(10), ha(11),ha(12)],’Deltaomega_{o}’)
% legend([x1([1 2 3])],{‘$g_1=fr(%d)$’,jj},’Fontsize’,34,’Location’,’northwest’,’Interpreter’, ‘latex’);
legend([x1([jj])],{‘rm{"$g_1{‘+fr{jj}+’}$"}’},’Fontsize’,34,’Location’,’northwest’,’Interpreter’, ‘latex’);
legend(‘boxoff’)
end
endI want legends g_1=fr(1), g_1=fr(2), g_1=fr(3) for each plots in each window ha(kk). I am doing some mistake in legends, but couldn’t figured it out. Any suggestions please. Thanks.
[ha, pos]= tight_subplot(4,3,[.1 .15],[.13 .01],[.13 .1]);
fr=([0.1, 0.5, 1]);
[h0, h1]=size(fr);
% for jj=1:h1
for jj=1:3
for kk=1:12
lin={‘–‘,’-.’,’:’};
axes(ha(kk));
x=load(sprintf(‘frq_%d%d.dat’,jj,kk));
x1(jj)=loglog(x(:,33),x(:,kk+5),’linestyle’,lin{jj},’LineWidth’, 2.5);
hold on
ylabel([ha(1),ha(4), ha(7),ha(10)],’Deltaomega_{}’)
xlabel([ha(10), ha(11),ha(12)],’Deltaomega_{o}’)
% legend([x1([1 2 3])],{‘$g_1=fr(%d)$’,jj},’Fontsize’,34,’Location’,’northwest’,’Interpreter’, ‘latex’);
legend([x1([jj])],{‘rm{"$g_1{‘+fr{jj}+’}$"}’},’Fontsize’,34,’Location’,’northwest’,’Interpreter’, ‘latex’);
legend(‘boxoff’)
end
end I want legends g_1=fr(1), g_1=fr(2), g_1=fr(3) for each plots in each window ha(kk). I am doing some mistake in legends, but couldn’t figured it out. Any suggestions please. Thanks.
[ha, pos]= tight_subplot(4,3,[.1 .15],[.13 .01],[.13 .1]);
fr=([0.1, 0.5, 1]);
[h0, h1]=size(fr);
% for jj=1:h1
for jj=1:3
for kk=1:12
lin={‘–‘,’-.’,’:’};
axes(ha(kk));
x=load(sprintf(‘frq_%d%d.dat’,jj,kk));
x1(jj)=loglog(x(:,33),x(:,kk+5),’linestyle’,lin{jj},’LineWidth’, 2.5);
hold on
ylabel([ha(1),ha(4), ha(7),ha(10)],’Deltaomega_{}’)
xlabel([ha(10), ha(11),ha(12)],’Deltaomega_{o}’)
% legend([x1([1 2 3])],{‘$g_1=fr(%d)$’,jj},’Fontsize’,34,’Location’,’northwest’,’Interpreter’, ‘latex’);
legend([x1([jj])],{‘rm{"$g_1{‘+fr{jj}+’}$"}’},’Fontsize’,34,’Location’,’northwest’,’Interpreter’, ‘latex’);
legend(‘boxoff’)
end
end plotting, subplot, legend, for loop MATLAB Answers — New Questions
why is 2D deformation plot in pdeplot samller with larger DefromationScaleFactor
I’ve used both pdeplot3d and pdeplot to show deformation after structure analysis. The DeformationScaleFactor is used to scale the distortion of the final picture plotted. I’ve noticed for pdeplot3d, a larger DeformationScaleFacotor means larger distortion. The online documents can clearly show it, https://ww2.mathworks.cn/help/pde/ug/pdeplot3d.html?s_tid=doc_ta#d126e109923. However, in 2d pdeplot, a larger DeformationScaleFactor will result in a smaller distortion. https://ww2.mathworks.cn/help/pde/ug/pdeplot.html?searchHighlight=pdeplot&s_tid=srchtitle_support_results_1_pdeplot. Is there any explaination on this comparison?
I caputured two pictures both function for convinience.
pdeplot3d case: larger DeformationScaleFactor larger distortion:
pdeplot case: larger DeformationScaleFactor smaller distortion:I’ve used both pdeplot3d and pdeplot to show deformation after structure analysis. The DeformationScaleFactor is used to scale the distortion of the final picture plotted. I’ve noticed for pdeplot3d, a larger DeformationScaleFacotor means larger distortion. The online documents can clearly show it, https://ww2.mathworks.cn/help/pde/ug/pdeplot3d.html?s_tid=doc_ta#d126e109923. However, in 2d pdeplot, a larger DeformationScaleFactor will result in a smaller distortion. https://ww2.mathworks.cn/help/pde/ug/pdeplot.html?searchHighlight=pdeplot&s_tid=srchtitle_support_results_1_pdeplot. Is there any explaination on this comparison?
I caputured two pictures both function for convinience.
pdeplot3d case: larger DeformationScaleFactor larger distortion:
pdeplot case: larger DeformationScaleFactor smaller distortion: I’ve used both pdeplot3d and pdeplot to show deformation after structure analysis. The DeformationScaleFactor is used to scale the distortion of the final picture plotted. I’ve noticed for pdeplot3d, a larger DeformationScaleFacotor means larger distortion. The online documents can clearly show it, https://ww2.mathworks.cn/help/pde/ug/pdeplot3d.html?s_tid=doc_ta#d126e109923. However, in 2d pdeplot, a larger DeformationScaleFactor will result in a smaller distortion. https://ww2.mathworks.cn/help/pde/ug/pdeplot.html?searchHighlight=pdeplot&s_tid=srchtitle_support_results_1_pdeplot. Is there any explaination on this comparison?
I caputured two pictures both function for convinience.
pdeplot3d case: larger DeformationScaleFactor larger distortion:
pdeplot case: larger DeformationScaleFactor smaller distortion: deformationscalefactor, pdeplot, pdeplot3d MATLAB Answers — New Questions
Tiledlayout: Make Plots of unequal width
Hello,
I want to use tiledlayout to place multiple graphs of unequal width. An example of what I’m trying to do is below. Using the figure command only seems to edit the entire box and I’m not sure how to make the tiledlayout command do what I want
Current figure:
Desired appearance (expertly edited using MS Paint)
Example code:
figure(‘Units’,’normalized’,’Position’,[0.5,0.4,.5,.5]);
tiledlayout(1,2,’TileSpacing’,’Compact’,’Padding’,’Compact’)
nexttile
plot(foo,bar)
%formatting stuff
nexttile
plot (foo2,bar2)
%formatting stuffHello,
I want to use tiledlayout to place multiple graphs of unequal width. An example of what I’m trying to do is below. Using the figure command only seems to edit the entire box and I’m not sure how to make the tiledlayout command do what I want
Current figure:
Desired appearance (expertly edited using MS Paint)
Example code:
figure(‘Units’,’normalized’,’Position’,[0.5,0.4,.5,.5]);
tiledlayout(1,2,’TileSpacing’,’Compact’,’Padding’,’Compact’)
nexttile
plot(foo,bar)
%formatting stuff
nexttile
plot (foo2,bar2)
%formatting stuff Hello,
I want to use tiledlayout to place multiple graphs of unequal width. An example of what I’m trying to do is below. Using the figure command only seems to edit the entire box and I’m not sure how to make the tiledlayout command do what I want
Current figure:
Desired appearance (expertly edited using MS Paint)
Example code:
figure(‘Units’,’normalized’,’Position’,[0.5,0.4,.5,.5]);
tiledlayout(1,2,’TileSpacing’,’Compact’,’Padding’,’Compact’)
nexttile
plot(foo,bar)
%formatting stuff
nexttile
plot (foo2,bar2)
%formatting stuff tiledlayout, plot dimensions MATLAB Answers — New Questions
Discrepancy Between VTT File Timestamps and Actual Audio Timestamps
The timestamps in VTT files do not always match the actual audio timestamps. This discrepancy varies from video to video and can be off by about 1 second. This issue arises because the timing of the speech in the VTT file is not perfectly synchronized with the actual audio. When editing videos or creating subtitles, it is important to account for this discrepancy and make necessary adjustments.
The timestamps in VTT files do not always match the actual audio timestamps. This discrepancy varies from video to video and can be off by about 1 second. This issue arises because the timing of the speech in the VTT file is not perfectly synchronized with the actual audio. When editing videos or creating subtitles, it is important to account for this discrepancy and make necessary adjustments. Read More
No video output in computer
I have a old Dell optiplex 3020 SFF with a i3 4060 an hdd and using the integrated onboard graphics. So few days ago I observed if I shutdown the computer and then booted it up it was stuck on windows logo and there was no more disk activity, so I just heard powered it of and then it started again. Today the same happened so I did the same, and now the pc doesn’t show any video output. The dell logo isn’t showing either and there IS DISK ACTIVITY AND EVEN NETWORK ACTIVITY. But I don’t Know. Like there is literally no video output it’s just blank screen.I tried getting into bios but obviously there was no video output. Also I thought that there was a bios corruption,( which in case was not possible because there was even network activity)so I removed the ram and turn on the computer and it even gave me a beep code. So confused right now…I even tried win+ctrl+shift+B just in case. But main issue is that there is no video activity. Also the hard drive activity is constant.also funny thing, I started the computer and let it be for 3-4 minutes then put in my windows password, then Spotify was put to autostart so just clicked media resume keys on my keyboard and **bleep**! The song also plays there isn’t just any video output. From what I guess there is no bios corruption whatsoever.
Any help is really appreciated asap
I have a old Dell optiplex 3020 SFF with a i3 4060 an hdd and using the integrated onboard graphics. So few days ago I observed if I shutdown the computer and then booted it up it was stuck on windows logo and there was no more disk activity, so I just heard powered it of and then it started again. Today the same happened so I did the same, and now the pc doesn’t show any video output. The dell logo isn’t showing either and there IS DISK ACTIVITY AND EVEN NETWORK ACTIVITY. But I don’t Know. Like there is literally no video output it’s just blank screen.I tried getting into bios but obviously there was no video output. Also I thought that there was a bios corruption,( which in case was not possible because there was even network activity)so I removed the ram and turn on the computer and it even gave me a beep code. So confused right now…I even tried win+ctrl+shift+B just in case. But main issue is that there is no video activity. Also the hard drive activity is constant.also funny thing, I started the computer and let it be for 3-4 minutes then put in my windows password, then Spotify was put to autostart so just clicked media resume keys on my keyboard and **bleep**! The song also plays there isn’t just any video output. From what I guess there is no bios corruption whatsoever. Any help is really appreciated asap Read More
Can not download all file
I can not download all file on OneDrive , but i can download before
2024.06.13
I can not download all file on OneDrive , but i can download before 2024.06.13 Read More
What List permission for users have no inherent list permission, just when an item is Shared
I have a Power Apps Gallery that points to a fairly simple SP List.
We only want users to see items they have submitted.
So we don’t give them any list-level permissions. Our App/workflows do a Share to grant users Read access to their own items.
The problem is if nothing has been shared with them, the Gallery throws an error saying the user doesn’t have access to the list.
If I grant even Read access as a permission, it gives the user Read access to everything in the list. Yes, I can manage that in the app programmatically with a filter. But I’d rather put that on Sharepoint to manage.
So how can I configure the List (or the app gallery?) so that if the user doesn’t have any items Shared to them, they just get a blank gallery instead of an error message?
I have a Power Apps Gallery that points to a fairly simple SP List.We only want users to see items they have submitted. So we don’t give them any list-level permissions. Our App/workflows do a Share to grant users Read access to their own items. The problem is if nothing has been shared with them, the Gallery throws an error saying the user doesn’t have access to the list. If I grant even Read access as a permission, it gives the user Read access to everything in the list. Yes, I can manage that in the app programmatically with a filter. But I’d rather put that on Sharepoint to manage. So how can I configure the List (or the app gallery?) so that if the user doesn’t have any items Shared to them, they just get a blank gallery instead of an error message? Read More
Windows repair version
After leaving the insiders program I noticed and update called windows repair version and I was wondering if i need to install it.
After leaving the insiders program I noticed and update called windows repair version and I was wondering if i need to install it. Read More
PID Controller Gain adjust
Hallo Jungs bitte jemand mir helfen?: habe einen pid-Regler für ein Selfdriving car entwickeln. das Problem ist das Fahrzeug fährt nicht in Centerline wie geplann und nach änderung der Strecke, wird der Fehler noch schlimer. kann jemand mir helfen?
function LateralLongitudinal_Controller(obj, cte)
kp_lat = 0.08; % Parameter für laterale Regelung
kd_lat = 0.8;
ki_lat = 0.000002;
kp_lon = 0.1; % Parameter für longitudinale Regelung
kd_lon = 0.01;
ki_lon = 0.000001;
dcte = cte – obj.old_cte;
obj.cte_intergral = obj.cte_intergral + cte;
% Anti-Windup für den integralen Anteil
obj.cte_intergral = max(-obj.steering_angle_limit / ki_lat, min(obj.steering_angle_limit / ki_lat, obj.cte_intergral));
obj.old_cte = cte;
% Lateral Control (quer)
steering = kp_lat * cte + kd_lat * dcte + ki_lat * obj.cte_intergral;
% Begrenzen Sie den Lenkwinkel
steering = max(-obj.steering_angle_limit, min(obj.steering_angle_limit, steering));
% Longitudinal Control (längs)
desired_velocity = obj.max_velocity; % Setzen Sie die gewünschte Geschwindigkeit
velocity_error = desired_velocity – obj.states(4);
% Fügen Sie die max_acceleration-Eigenschaft hinzu
max_acceleration = 10.0; % Setzen Sie hier den gewünschten maximalen Beschleunigungswert ein
% Reduziere die Geschwindigkeit in der Nähe von Kurven
curvature_threshold = 0.4; % Setzen Sie den Krümmungsschwellenwert ein
if abs(cte) > curvature_threshold
desired_velocity = 10 * obj.max_velocity; % Reduziere die Geschwindigkeit in der Nähe von Kurven
end
acceleration = kp_lon * velocity_error + kd_lon * obj.states(4) + ki_lon * sum(obj.states(1:4));
% Begrenzen Sie die Beschleunigung
acceleration = max(-max_acceleration, min(max_acceleration, acceleration));
control_signal = [steering, acceleration];
obj.update_input(control_signal);
endHallo Jungs bitte jemand mir helfen?: habe einen pid-Regler für ein Selfdriving car entwickeln. das Problem ist das Fahrzeug fährt nicht in Centerline wie geplann und nach änderung der Strecke, wird der Fehler noch schlimer. kann jemand mir helfen?
function LateralLongitudinal_Controller(obj, cte)
kp_lat = 0.08; % Parameter für laterale Regelung
kd_lat = 0.8;
ki_lat = 0.000002;
kp_lon = 0.1; % Parameter für longitudinale Regelung
kd_lon = 0.01;
ki_lon = 0.000001;
dcte = cte – obj.old_cte;
obj.cte_intergral = obj.cte_intergral + cte;
% Anti-Windup für den integralen Anteil
obj.cte_intergral = max(-obj.steering_angle_limit / ki_lat, min(obj.steering_angle_limit / ki_lat, obj.cte_intergral));
obj.old_cte = cte;
% Lateral Control (quer)
steering = kp_lat * cte + kd_lat * dcte + ki_lat * obj.cte_intergral;
% Begrenzen Sie den Lenkwinkel
steering = max(-obj.steering_angle_limit, min(obj.steering_angle_limit, steering));
% Longitudinal Control (längs)
desired_velocity = obj.max_velocity; % Setzen Sie die gewünschte Geschwindigkeit
velocity_error = desired_velocity – obj.states(4);
% Fügen Sie die max_acceleration-Eigenschaft hinzu
max_acceleration = 10.0; % Setzen Sie hier den gewünschten maximalen Beschleunigungswert ein
% Reduziere die Geschwindigkeit in der Nähe von Kurven
curvature_threshold = 0.4; % Setzen Sie den Krümmungsschwellenwert ein
if abs(cte) > curvature_threshold
desired_velocity = 10 * obj.max_velocity; % Reduziere die Geschwindigkeit in der Nähe von Kurven
end
acceleration = kp_lon * velocity_error + kd_lon * obj.states(4) + ki_lon * sum(obj.states(1:4));
% Begrenzen Sie die Beschleunigung
acceleration = max(-max_acceleration, min(max_acceleration, acceleration));
control_signal = [steering, acceleration];
obj.update_input(control_signal);
end Hallo Jungs bitte jemand mir helfen?: habe einen pid-Regler für ein Selfdriving car entwickeln. das Problem ist das Fahrzeug fährt nicht in Centerline wie geplann und nach änderung der Strecke, wird der Fehler noch schlimer. kann jemand mir helfen?
function LateralLongitudinal_Controller(obj, cte)
kp_lat = 0.08; % Parameter für laterale Regelung
kd_lat = 0.8;
ki_lat = 0.000002;
kp_lon = 0.1; % Parameter für longitudinale Regelung
kd_lon = 0.01;
ki_lon = 0.000001;
dcte = cte – obj.old_cte;
obj.cte_intergral = obj.cte_intergral + cte;
% Anti-Windup für den integralen Anteil
obj.cte_intergral = max(-obj.steering_angle_limit / ki_lat, min(obj.steering_angle_limit / ki_lat, obj.cte_intergral));
obj.old_cte = cte;
% Lateral Control (quer)
steering = kp_lat * cte + kd_lat * dcte + ki_lat * obj.cte_intergral;
% Begrenzen Sie den Lenkwinkel
steering = max(-obj.steering_angle_limit, min(obj.steering_angle_limit, steering));
% Longitudinal Control (längs)
desired_velocity = obj.max_velocity; % Setzen Sie die gewünschte Geschwindigkeit
velocity_error = desired_velocity – obj.states(4);
% Fügen Sie die max_acceleration-Eigenschaft hinzu
max_acceleration = 10.0; % Setzen Sie hier den gewünschten maximalen Beschleunigungswert ein
% Reduziere die Geschwindigkeit in der Nähe von Kurven
curvature_threshold = 0.4; % Setzen Sie den Krümmungsschwellenwert ein
if abs(cte) > curvature_threshold
desired_velocity = 10 * obj.max_velocity; % Reduziere die Geschwindigkeit in der Nähe von Kurven
end
acceleration = kp_lon * velocity_error + kd_lon * obj.states(4) + ki_lon * sum(obj.states(1:4));
% Begrenzen Sie die Beschleunigung
acceleration = max(-max_acceleration, min(max_acceleration, acceleration));
control_signal = [steering, acceleration];
obj.update_input(control_signal);
end pid controller MATLAB Answers — New Questions
How to move colorbar in scatter3 plot and keep it inside the figure
After adding title to the colorbar of a scatter3 plot, I realized the formatting is all wonky.
Looking online, I moved the colorbar to southoutside, and was able to move the colorbar by setting its second position, see code below, but it simply moves the colorbar out of the window instead and can no longer be seen.
Based on another answer, I tried to move the axes of the scatter3 plot, since in that case, moving the axes forced the figure window to resize, but it failed – scatter3’s axes doesn’t seem to have position property, which makes sense, given the type of figure.
So I am at a loss. I could move the parts manually, and then resize the main plot area, but I would love to be able to do it with the script since I would need to process many figures like this. Does anyone have any suggestions?
importdata(‘GNDout.mat’);
x = GNDout(:,1);
y = GNDout(:,2);
z = GNDout(:,3);
value2 = GNDout(:,17)-min(GNDout(:,17));
figure;
S = 50;
scatter3(x,y,z,S,value2/1e14,’filled’);
xlabel(‘x’);
ylabel(‘y’);
zlabel(‘z’);
axis equal;
cb = colorbar(‘Location’,’Southoutside’);
cb.Position(2) = cb.Position(2)-0.5;
title(cb, ‘rho_{GND} [10^{14} m^{-2}]’);
Attached is the data GNDout. Thanks in advance!After adding title to the colorbar of a scatter3 plot, I realized the formatting is all wonky.
Looking online, I moved the colorbar to southoutside, and was able to move the colorbar by setting its second position, see code below, but it simply moves the colorbar out of the window instead and can no longer be seen.
Based on another answer, I tried to move the axes of the scatter3 plot, since in that case, moving the axes forced the figure window to resize, but it failed – scatter3’s axes doesn’t seem to have position property, which makes sense, given the type of figure.
So I am at a loss. I could move the parts manually, and then resize the main plot area, but I would love to be able to do it with the script since I would need to process many figures like this. Does anyone have any suggestions?
importdata(‘GNDout.mat’);
x = GNDout(:,1);
y = GNDout(:,2);
z = GNDout(:,3);
value2 = GNDout(:,17)-min(GNDout(:,17));
figure;
S = 50;
scatter3(x,y,z,S,value2/1e14,’filled’);
xlabel(‘x’);
ylabel(‘y’);
zlabel(‘z’);
axis equal;
cb = colorbar(‘Location’,’Southoutside’);
cb.Position(2) = cb.Position(2)-0.5;
title(cb, ‘rho_{GND} [10^{14} m^{-2}]’);
Attached is the data GNDout. Thanks in advance! After adding title to the colorbar of a scatter3 plot, I realized the formatting is all wonky.
Looking online, I moved the colorbar to southoutside, and was able to move the colorbar by setting its second position, see code below, but it simply moves the colorbar out of the window instead and can no longer be seen.
Based on another answer, I tried to move the axes of the scatter3 plot, since in that case, moving the axes forced the figure window to resize, but it failed – scatter3’s axes doesn’t seem to have position property, which makes sense, given the type of figure.
So I am at a loss. I could move the parts manually, and then resize the main plot area, but I would love to be able to do it with the script since I would need to process many figures like this. Does anyone have any suggestions?
importdata(‘GNDout.mat’);
x = GNDout(:,1);
y = GNDout(:,2);
z = GNDout(:,3);
value2 = GNDout(:,17)-min(GNDout(:,17));
figure;
S = 50;
scatter3(x,y,z,S,value2/1e14,’filled’);
xlabel(‘x’);
ylabel(‘y’);
zlabel(‘z’);
axis equal;
cb = colorbar(‘Location’,’Southoutside’);
cb.Position(2) = cb.Position(2)-0.5;
title(cb, ‘rho_{GND} [10^{14} m^{-2}]’);
Attached is the data GNDout. Thanks in advance! plotting, figure MATLAB Answers — New Questions
How can I install and run .NET Framework v4 on Windows 11?
Hello, I need help installing .NET Framework version v4.0.30319. Once it is installed I try to run it but it asks me to “Turn Windows features on or off in the Control Panel.” It is from this step that I don’t know what to do. I’m speak spanish but i can comunicate also in English
Hello, I need help installing .NET Framework version v4.0.30319. Once it is installed I try to run it but it asks me to “Turn Windows features on or off in the Control Panel.” It is from this step that I don’t know what to do. I’m speak spanish but i can comunicate also in English Read More
Web Developers/ Stalkers Pod Caster with Fire Wall Intelligence Sic Individuals
Good Evening All, I came across this tech community before to get some assistance to get a Key logger off my system, I’m not that dumb when it comes to computer and I can pretty much handle it little but at one tile I was studying for My A+, But that not why I’m here. I’m here because Copilot and My Current training By Baxter Clewis Academy helped me get rid him just now, my assignment was to study the Microsoft Firewall and try to apply them to fix this one that needed to reconfigure, but mine needed it first, So I worked on my own first.
What I wanted to say to all of you here: It would have been so nice if one you would have stepped up to help me, I have been watched via my TV, I have had my pictures of my body stolen, I have my grandkids pictures taken when they were playing on my phone or just sitting here watching a movie at my computer, so now their Dad won’t allow them to come to my Home and that breaks my heart. I have had my information sold on the black market. I have had all my Dad’s Information wiped clean From the Va’s Office who I lost twice on 9/11 the first the planes hit the towers because he had a meeting in one of the Towers that he skipped and on 9/11 2017 when died. I have had all these terrible things done to me by this hacker/ web developer (and do you know how I know this person is a web developer because the program stop doing things it had no reason to so that meant the codes were overwritten by Python or SQL) that has had a great time destroyer my life. Do you know who taught me that Merit America.
You all may be these super intelligent people with all this knowledge about computers but were was your human compassion for a stranger, a woman. I didn’t do nothing to nobody I came in here and begged for help and I was to the point where I was suicidal, I was going crazy trying to go to school writing whole papers at night to wake up and have them deleted. Or submitting papers that had none of the words I wrote on them. To having my passwords changed to my bank accounts to being locked out of my computers to getting out the shower and my TV flickering on and off in bedroom as I try and ger dressed. To having my Alexa say weird things to me in the middle of the night, changing my radio station. I dealt with for the last 18 months, Until I got mad and said if they learned how to do to to me, I can learn how to undo it to me. This isn’t an inspirational story, no not at all see because the very same email I used to sign up with is the very same one the hacker enjoys playing with. If you don’t believe me, contact him @ email address removed for privacy reasons (its the alias to this one) his favorite is email address removed for privacy reasons. He’ll play with you he’s quite entertained by destroying your mindset, please don’t be a woman he’ll really get you. Don’t have cameras either, I have yet to get back into my ring camera. Just thought I dropped and give you smart people a run for your money. Since it took me 18 months to free myself just wanted to see if any of you were smarter than him. Try him! good luck
Good Evening All, I came across this tech community before to get some assistance to get a Key logger off my system, I’m not that dumb when it comes to computer and I can pretty much handle it little but at one tile I was studying for My A+, But that not why I’m here. I’m here because Copilot and My Current training By Baxter Clewis Academy helped me get rid him just now, my assignment was to study the Microsoft Firewall and try to apply them to fix this one that needed to reconfigure, but mine needed it first, So I worked on my own first. What I wanted to say to all of you here: It would have been so nice if one you would have stepped up to help me, I have been watched via my TV, I have had my pictures of my body stolen, I have my grandkids pictures taken when they were playing on my phone or just sitting here watching a movie at my computer, so now their Dad won’t allow them to come to my Home and that breaks my heart. I have had my information sold on the black market. I have had all my Dad’s Information wiped clean From the Va’s Office who I lost twice on 9/11 the first the planes hit the towers because he had a meeting in one of the Towers that he skipped and on 9/11 2017 when died. I have had all these terrible things done to me by this hacker/ web developer (and do you know how I know this person is a web developer because the program stop doing things it had no reason to so that meant the codes were overwritten by Python or SQL) that has had a great time destroyer my life. Do you know who taught me that Merit America. You all may be these super intelligent people with all this knowledge about computers but were was your human compassion for a stranger, a woman. I didn’t do nothing to nobody I came in here and begged for help and I was to the point where I was suicidal, I was going crazy trying to go to school writing whole papers at night to wake up and have them deleted. Or submitting papers that had none of the words I wrote on them. To having my passwords changed to my bank accounts to being locked out of my computers to getting out the shower and my TV flickering on and off in bedroom as I try and ger dressed. To having my Alexa say weird things to me in the middle of the night, changing my radio station. I dealt with for the last 18 months, Until I got mad and said if they learned how to do to to me, I can learn how to undo it to me. This isn’t an inspirational story, no not at all see because the very same email I used to sign up with is the very same one the hacker enjoys playing with. If you don’t believe me, contact him @ email address removed for privacy reasons (its the alias to this one) his favorite is email address removed for privacy reasons. He’ll play with you he’s quite entertained by destroying your mindset, please don’t be a woman he’ll really get you. Don’t have cameras either, I have yet to get back into my ring camera. Just thought I dropped and give you smart people a run for your money. Since it took me 18 months to free myself just wanted to see if any of you were smarter than him. Try him! good luck Read More
The perpendicular point is not on the proposed line.
I would like to ask what is wrong with my code that the green line is not on the fit line?
Now I have to fit two lines to the given coordinates and calculate their perpendicular distance from the center of the circle. Then their slopes will be based on the data_line1.
% 基準綫坐標
data_line1 = readtable("基準綫.csv");
data_line2 = readtable("基準綫2.csv");
x_line1 = data_line1{7:end, 1};
y_line1 = data_line1{7:end, 2};
x_line2 = data_line2{7:end, 1};
y_line2 = data_line2{7:end, 2};
% 圓心坐標
center_x = 37.5;
center_y = 37.5;
% 擬合第一條綫
x1 = x_line1;
y1 = y_line1;
p_line = polyfit(x1, y1, 1);
slope = p_line(1);
intercept = p_line(2);
A = slope;
B = -1;
C = intercept;
x_foot = (center_x – slope * (center_y – intercept)) / (1 + slope^2);
y_foot = slope * x_foot + intercept;
distance = abs(A * center_x + B * center_y + C) / sqrt(A^2 + B^2);
disp(‘垂直距離1:’);
disp(distance);
% 繪製結果
figure;
hold on;
plot(x1, y1, ‘bo’, ‘DisplayName’, ‘原始數據1’); % 原始數據點
plot(center_x, center_y, ‘rx’, ‘MarkerSize’, 10, ‘DisplayName’, ‘圓心’); % 圓心
% 繪製擬合直線
fitted_x = linspace(min(x_line1), max(x_line1), 100);
fitted_y = polyval(p_line, fitted_x);
plot(fitted_x, fitted_y, ‘k–‘, ‘DisplayName’, ‘擬合直線1’);
% 繪製垂直距離線
plot([center_x, x_foot], [center_y, y_foot], ‘r-‘, ‘DisplayName’, ‘垂直距離1’);
% 擬合第二條綫
x2 = x_line2;
y2 = y_line2;
p2_line = polyfit(x2, y2, 1);
intercept_2 = p2_line(2);
C2 = intercept_2;
x_foot_2 = (center_x – slope * (center_y – intercept_2)) / (1 + slope^2);
y_foot_2 = slope * x_foot_2 + intercept_2;
distance_2 = abs(A * center_x + B * center_y + C2) / sqrt(A^2 + B^2);
disp(‘垂直距離2:’);
disp(distance_2);
% 繪製第二條線和垂直距離線
plot(x2, y2, ‘go’, ‘DisplayName’, ‘原始數據2’); % 原始數據點2
fitted_y2 = polyval(p2_line, fitted_x);
plot(fitted_x, fitted_y2, ‘b–‘, ‘DisplayName’, ‘擬合直線2’);
plot([center_x, x_foot_2], [center_y, y_foot_2], ‘g-‘, ‘DisplayName’, ‘垂直距離2’);
legend;
xlabel(‘X軸’);
ylabel(‘Y軸’);
title(‘從圓心到擬合直綫的垂直距離’);
grid on;
hold off;I would like to ask what is wrong with my code that the green line is not on the fit line?
Now I have to fit two lines to the given coordinates and calculate their perpendicular distance from the center of the circle. Then their slopes will be based on the data_line1.
% 基準綫坐標
data_line1 = readtable("基準綫.csv");
data_line2 = readtable("基準綫2.csv");
x_line1 = data_line1{7:end, 1};
y_line1 = data_line1{7:end, 2};
x_line2 = data_line2{7:end, 1};
y_line2 = data_line2{7:end, 2};
% 圓心坐標
center_x = 37.5;
center_y = 37.5;
% 擬合第一條綫
x1 = x_line1;
y1 = y_line1;
p_line = polyfit(x1, y1, 1);
slope = p_line(1);
intercept = p_line(2);
A = slope;
B = -1;
C = intercept;
x_foot = (center_x – slope * (center_y – intercept)) / (1 + slope^2);
y_foot = slope * x_foot + intercept;
distance = abs(A * center_x + B * center_y + C) / sqrt(A^2 + B^2);
disp(‘垂直距離1:’);
disp(distance);
% 繪製結果
figure;
hold on;
plot(x1, y1, ‘bo’, ‘DisplayName’, ‘原始數據1’); % 原始數據點
plot(center_x, center_y, ‘rx’, ‘MarkerSize’, 10, ‘DisplayName’, ‘圓心’); % 圓心
% 繪製擬合直線
fitted_x = linspace(min(x_line1), max(x_line1), 100);
fitted_y = polyval(p_line, fitted_x);
plot(fitted_x, fitted_y, ‘k–‘, ‘DisplayName’, ‘擬合直線1’);
% 繪製垂直距離線
plot([center_x, x_foot], [center_y, y_foot], ‘r-‘, ‘DisplayName’, ‘垂直距離1’);
% 擬合第二條綫
x2 = x_line2;
y2 = y_line2;
p2_line = polyfit(x2, y2, 1);
intercept_2 = p2_line(2);
C2 = intercept_2;
x_foot_2 = (center_x – slope * (center_y – intercept_2)) / (1 + slope^2);
y_foot_2 = slope * x_foot_2 + intercept_2;
distance_2 = abs(A * center_x + B * center_y + C2) / sqrt(A^2 + B^2);
disp(‘垂直距離2:’);
disp(distance_2);
% 繪製第二條線和垂直距離線
plot(x2, y2, ‘go’, ‘DisplayName’, ‘原始數據2’); % 原始數據點2
fitted_y2 = polyval(p2_line, fitted_x);
plot(fitted_x, fitted_y2, ‘b–‘, ‘DisplayName’, ‘擬合直線2’);
plot([center_x, x_foot_2], [center_y, y_foot_2], ‘g-‘, ‘DisplayName’, ‘垂直距離2’);
legend;
xlabel(‘X軸’);
ylabel(‘Y軸’);
title(‘從圓心到擬合直綫的垂直距離’);
grid on;
hold off; I would like to ask what is wrong with my code that the green line is not on the fit line?
Now I have to fit two lines to the given coordinates and calculate their perpendicular distance from the center of the circle. Then their slopes will be based on the data_line1.
% 基準綫坐標
data_line1 = readtable("基準綫.csv");
data_line2 = readtable("基準綫2.csv");
x_line1 = data_line1{7:end, 1};
y_line1 = data_line1{7:end, 2};
x_line2 = data_line2{7:end, 1};
y_line2 = data_line2{7:end, 2};
% 圓心坐標
center_x = 37.5;
center_y = 37.5;
% 擬合第一條綫
x1 = x_line1;
y1 = y_line1;
p_line = polyfit(x1, y1, 1);
slope = p_line(1);
intercept = p_line(2);
A = slope;
B = -1;
C = intercept;
x_foot = (center_x – slope * (center_y – intercept)) / (1 + slope^2);
y_foot = slope * x_foot + intercept;
distance = abs(A * center_x + B * center_y + C) / sqrt(A^2 + B^2);
disp(‘垂直距離1:’);
disp(distance);
% 繪製結果
figure;
hold on;
plot(x1, y1, ‘bo’, ‘DisplayName’, ‘原始數據1’); % 原始數據點
plot(center_x, center_y, ‘rx’, ‘MarkerSize’, 10, ‘DisplayName’, ‘圓心’); % 圓心
% 繪製擬合直線
fitted_x = linspace(min(x_line1), max(x_line1), 100);
fitted_y = polyval(p_line, fitted_x);
plot(fitted_x, fitted_y, ‘k–‘, ‘DisplayName’, ‘擬合直線1’);
% 繪製垂直距離線
plot([center_x, x_foot], [center_y, y_foot], ‘r-‘, ‘DisplayName’, ‘垂直距離1’);
% 擬合第二條綫
x2 = x_line2;
y2 = y_line2;
p2_line = polyfit(x2, y2, 1);
intercept_2 = p2_line(2);
C2 = intercept_2;
x_foot_2 = (center_x – slope * (center_y – intercept_2)) / (1 + slope^2);
y_foot_2 = slope * x_foot_2 + intercept_2;
distance_2 = abs(A * center_x + B * center_y + C2) / sqrt(A^2 + B^2);
disp(‘垂直距離2:’);
disp(distance_2);
% 繪製第二條線和垂直距離線
plot(x2, y2, ‘go’, ‘DisplayName’, ‘原始數據2’); % 原始數據點2
fitted_y2 = polyval(p2_line, fitted_x);
plot(fitted_x, fitted_y2, ‘b–‘, ‘DisplayName’, ‘擬合直線2’);
plot([center_x, x_foot_2], [center_y, y_foot_2], ‘g-‘, ‘DisplayName’, ‘垂直距離2’);
legend;
xlabel(‘X軸’);
ylabel(‘Y軸’);
title(‘從圓心到擬合直綫的垂直距離’);
grid on;
hold off; polyfit, line MATLAB Answers — New Questions
Best analysis to show how EEG ranges are similar
Hello,
Hoping someone can help! Have samples from EEG from multiple patients over multiple points in time that I want to visually show and quantiatively show and prove over time that these patterns are the same. I am thinking of using a wavelet transform over time. The question is can i amalgamate an entire EEG signal to 1 plot. Or would it be better to isolate this pattern at one electrode and compare between patients?
Thank you!Hello,
Hoping someone can help! Have samples from EEG from multiple patients over multiple points in time that I want to visually show and quantiatively show and prove over time that these patterns are the same. I am thinking of using a wavelet transform over time. The question is can i amalgamate an entire EEG signal to 1 plot. Or would it be better to isolate this pattern at one electrode and compare between patients?
Thank you! Hello,
Hoping someone can help! Have samples from EEG from multiple patients over multiple points in time that I want to visually show and quantiatively show and prove over time that these patterns are the same. I am thinking of using a wavelet transform over time. The question is can i amalgamate an entire EEG signal to 1 plot. Or would it be better to isolate this pattern at one electrode and compare between patients?
Thank you! eeg, medical MATLAB Answers — New Questions
How can I autogenerate cells from one sheet to another ONLY if it’s filled out?
I am trying to auto generate sales orders from an order submission. So, I want the cells to only be filled out if that product is selected and the way I know the product is selected is if there’s a quantity on it. So, I only want the items that have a quantity be autogenerated to the sales order. I REALLY hope I make sense.
So for example, if a customer only wants two items, those will get filled out with a quantity on the order submission then on the second sheet (sales order) I want those items to generate automatically. I would only want the product, price and quantity to fill out.
Is there an IF formula that I can do to help with this?
I am trying to auto generate sales orders from an order submission. So, I want the cells to only be filled out if that product is selected and the way I know the product is selected is if there’s a quantity on it. So, I only want the items that have a quantity be autogenerated to the sales order. I REALLY hope I make sense.So for example, if a customer only wants two items, those will get filled out with a quantity on the order submission then on the second sheet (sales order) I want those items to generate automatically. I would only want the product, price and quantity to fill out. Is there an IF formula that I can do to help with this? Read More
Microsoft Store ‘Something happened on our end’ when trying to download apps
Hello,
When trying to download any apps, this error appears on all local accounts. Troubleshooting does not help and I’ve reinstalled windows as well which did not fix the issue.
Hello,When trying to download any apps, this error appears on all local accounts. Troubleshooting does not help and I’ve reinstalled windows as well which did not fix the issue. Read More
Value to differentiate is not traced. It must be a traced real dlarray scalar. Use dlgradient inside a function called by dlfeval to trace the variables.
Hello, I am working on customizing the loss function to minimize dimensionality by maximizing the Bhattacharyya distance distance.
But it came up with a error shown as:
Incorrect use of dlarray/dlgradient
The requested value was not tracked. It must be a real dlarray scalar for tracking. Please use dlgradient to track variables in the function called by dlfestival.
% Parameter settings
M = 10; % Dimension of input features
N = 50; % Number of samples per class
numEpochs = 100;
learnRate = 0.01;
% Generate example data
X = rand(2*N, M);
X(1:N, 🙂 = X(1:N, 🙂 + 1; % Data for class A
X(N+1:end, 🙂 = X(N+1:end, 🙂 – 1; % Data for class B
% Define the neural network
layers = [
featureInputLayer(M, ‘Normalization’, ‘none’)
fullyConnectedLayer(10)
reluLayer
fullyConnectedLayer(3)
];
dlnet = dlnetwork(layerGraph(layers));
% Custom training loop
for epoch = 1:numEpochs
dlX = dlarray(X’, ‘CB’); % Transpose input data to match network’s expected format
[gradients, loss] = dlfeval(@modelGradients, dlnet, dlX, N);
dlnet = dlupdate(@sgdmupdate, dlnet, gradients, learnRate);
disp([‘Epoch ‘ num2str(epoch) ‘, Loss: ‘ num2str(extractdata(loss))]);
end
% Testing phase
X_test = rand(N, M); % Assume test data is randomly generated
dlX_test = dlarray(X_test’, ‘CB’); % Transpose input data to match network’s expected format
Y_test = predict(dlnet, dlX_test);
disp(‘Dimensionality reduction results during testing:’);
disp(extractdata(Y_test)’);
% Custom loss function
function loss = customLoss(Y, N)
YA = extractdata(Y(:, 1:N))’;
YB = extractdata(Y(:, N+1:end))’;
muA = mean(YA);
muB = mean(YB);
covA = cov(YA);
covB = cov(YB);
covMean = (covA + covB) / 2;
d = 0.25 * (muA – muB) / covMean * (muA – muB)’ + 0.5 * log(det(covMean) / sqrt(det(covA) * det(covB)));
loss = -d; % Maximize Bhattacharyya distance
loss = dlarray(loss); % Ensure loss is a tracked dlarray scalar
end
% Model gradient function
function [gradients, loss] = modelGradients(dlnet, dlX, N)
Y = forward(dlnet, dlX);
loss = customLoss(Y, N);
gradients = dlgradient(loss, dlnet.Learnables);
end
% Update function
function param = sgdmupdate(param, grad, learnRate)
param = param – learnRate * grad;
endHello, I am working on customizing the loss function to minimize dimensionality by maximizing the Bhattacharyya distance distance.
But it came up with a error shown as:
Incorrect use of dlarray/dlgradient
The requested value was not tracked. It must be a real dlarray scalar for tracking. Please use dlgradient to track variables in the function called by dlfestival.
% Parameter settings
M = 10; % Dimension of input features
N = 50; % Number of samples per class
numEpochs = 100;
learnRate = 0.01;
% Generate example data
X = rand(2*N, M);
X(1:N, 🙂 = X(1:N, 🙂 + 1; % Data for class A
X(N+1:end, 🙂 = X(N+1:end, 🙂 – 1; % Data for class B
% Define the neural network
layers = [
featureInputLayer(M, ‘Normalization’, ‘none’)
fullyConnectedLayer(10)
reluLayer
fullyConnectedLayer(3)
];
dlnet = dlnetwork(layerGraph(layers));
% Custom training loop
for epoch = 1:numEpochs
dlX = dlarray(X’, ‘CB’); % Transpose input data to match network’s expected format
[gradients, loss] = dlfeval(@modelGradients, dlnet, dlX, N);
dlnet = dlupdate(@sgdmupdate, dlnet, gradients, learnRate);
disp([‘Epoch ‘ num2str(epoch) ‘, Loss: ‘ num2str(extractdata(loss))]);
end
% Testing phase
X_test = rand(N, M); % Assume test data is randomly generated
dlX_test = dlarray(X_test’, ‘CB’); % Transpose input data to match network’s expected format
Y_test = predict(dlnet, dlX_test);
disp(‘Dimensionality reduction results during testing:’);
disp(extractdata(Y_test)’);
% Custom loss function
function loss = customLoss(Y, N)
YA = extractdata(Y(:, 1:N))’;
YB = extractdata(Y(:, N+1:end))’;
muA = mean(YA);
muB = mean(YB);
covA = cov(YA);
covB = cov(YB);
covMean = (covA + covB) / 2;
d = 0.25 * (muA – muB) / covMean * (muA – muB)’ + 0.5 * log(det(covMean) / sqrt(det(covA) * det(covB)));
loss = -d; % Maximize Bhattacharyya distance
loss = dlarray(loss); % Ensure loss is a tracked dlarray scalar
end
% Model gradient function
function [gradients, loss] = modelGradients(dlnet, dlX, N)
Y = forward(dlnet, dlX);
loss = customLoss(Y, N);
gradients = dlgradient(loss, dlnet.Learnables);
end
% Update function
function param = sgdmupdate(param, grad, learnRate)
param = param – learnRate * grad;
end Hello, I am working on customizing the loss function to minimize dimensionality by maximizing the Bhattacharyya distance distance.
But it came up with a error shown as:
Incorrect use of dlarray/dlgradient
The requested value was not tracked. It must be a real dlarray scalar for tracking. Please use dlgradient to track variables in the function called by dlfestival.
% Parameter settings
M = 10; % Dimension of input features
N = 50; % Number of samples per class
numEpochs = 100;
learnRate = 0.01;
% Generate example data
X = rand(2*N, M);
X(1:N, 🙂 = X(1:N, 🙂 + 1; % Data for class A
X(N+1:end, 🙂 = X(N+1:end, 🙂 – 1; % Data for class B
% Define the neural network
layers = [
featureInputLayer(M, ‘Normalization’, ‘none’)
fullyConnectedLayer(10)
reluLayer
fullyConnectedLayer(3)
];
dlnet = dlnetwork(layerGraph(layers));
% Custom training loop
for epoch = 1:numEpochs
dlX = dlarray(X’, ‘CB’); % Transpose input data to match network’s expected format
[gradients, loss] = dlfeval(@modelGradients, dlnet, dlX, N);
dlnet = dlupdate(@sgdmupdate, dlnet, gradients, learnRate);
disp([‘Epoch ‘ num2str(epoch) ‘, Loss: ‘ num2str(extractdata(loss))]);
end
% Testing phase
X_test = rand(N, M); % Assume test data is randomly generated
dlX_test = dlarray(X_test’, ‘CB’); % Transpose input data to match network’s expected format
Y_test = predict(dlnet, dlX_test);
disp(‘Dimensionality reduction results during testing:’);
disp(extractdata(Y_test)’);
% Custom loss function
function loss = customLoss(Y, N)
YA = extractdata(Y(:, 1:N))’;
YB = extractdata(Y(:, N+1:end))’;
muA = mean(YA);
muB = mean(YB);
covA = cov(YA);
covB = cov(YB);
covMean = (covA + covB) / 2;
d = 0.25 * (muA – muB) / covMean * (muA – muB)’ + 0.5 * log(det(covMean) / sqrt(det(covA) * det(covB)));
loss = -d; % Maximize Bhattacharyya distance
loss = dlarray(loss); % Ensure loss is a tracked dlarray scalar
end
% Model gradient function
function [gradients, loss] = modelGradients(dlnet, dlX, N)
Y = forward(dlnet, dlX);
loss = customLoss(Y, N);
gradients = dlgradient(loss, dlnet.Learnables);
end
% Update function
function param = sgdmupdate(param, grad, learnRate)
param = param – learnRate * grad;
end deep learning MATLAB Answers — New Questions
Incorrect use of dlarray/dlgradient
Hello, I am working on customizing the loss function to minimize dimensionality by maximizing the Bhattacharyya distance distance.
But it came up with a error shown as:
Incorrect use of dlarray/dlgradient
The requested value was not tracked. It must be a real dlarray scalar for tracking. Please use dlgradient to track variables in the function called by dlfestival.
% Parameter settings
M = 10; % Dimension of input features
N = 50; % Number of samples per class
numEpochs = 100;
learnRate = 0.01;
% Generate example data
X = rand(2*N, M);
X(1:N, 🙂 = X(1:N, 🙂 + 1; % Data for class A
X(N+1:end, 🙂 = X(N+1:end, 🙂 – 1; % Data for class B
% Define the neural network
layers = [
featureInputLayer(M, ‘Normalization’, ‘none’)
fullyConnectedLayer(10)
reluLayer
fullyConnectedLayer(3)
];
dlnet = dlnetwork(layerGraph(layers));
% Custom training loop
for epoch = 1:numEpochs
dlX = dlarray(X’, ‘CB’); % Transpose input data to match network’s expected format
[gradients, loss] = dlfeval(@modelGradients, dlnet, dlX, N);
dlnet = dlupdate(@sgdmupdate, dlnet, gradients, learnRate);
disp([‘Epoch ‘ num2str(epoch) ‘, Loss: ‘ num2str(extractdata(loss))]);
end
% Testing phase
X_test = rand(N, M); % Assume test data is randomly generated
dlX_test = dlarray(X_test’, ‘CB’); % Transpose input data to match network’s expected format
Y_test = predict(dlnet, dlX_test);
disp(‘Dimensionality reduction results during testing:’);
disp(extractdata(Y_test)’);
% Custom loss function
function loss = customLoss(Y, N)
YA = extractdata(Y(:, 1:N))’;
YB = extractdata(Y(:, N+1:end))’;
muA = mean(YA);
muB = mean(YB);
covA = cov(YA);
covB = cov(YB);
covMean = (covA + covB) / 2;
d = 0.25 * (muA – muB) / covMean * (muA – muB)’ + 0.5 * log(det(covMean) / sqrt(det(covA) * det(covB)));
loss = -d; % Maximize Bhattacharyya distance
loss = dlarray(loss); % Ensure loss is a tracked dlarray scalar
end
% Model gradient function
function [gradients, loss] = modelGradients(dlnet, dlX, N)
Y = forward(dlnet, dlX);
loss = customLoss(Y, N);
gradients = dlgradient(loss, dlnet.Learnables);
end
% Update function
function param = sgdmupdate(param, grad, learnRate)
param = param – learnRate * grad;
endHello, I am working on customizing the loss function to minimize dimensionality by maximizing the Bhattacharyya distance distance.
But it came up with a error shown as:
Incorrect use of dlarray/dlgradient
The requested value was not tracked. It must be a real dlarray scalar for tracking. Please use dlgradient to track variables in the function called by dlfestival.
% Parameter settings
M = 10; % Dimension of input features
N = 50; % Number of samples per class
numEpochs = 100;
learnRate = 0.01;
% Generate example data
X = rand(2*N, M);
X(1:N, 🙂 = X(1:N, 🙂 + 1; % Data for class A
X(N+1:end, 🙂 = X(N+1:end, 🙂 – 1; % Data for class B
% Define the neural network
layers = [
featureInputLayer(M, ‘Normalization’, ‘none’)
fullyConnectedLayer(10)
reluLayer
fullyConnectedLayer(3)
];
dlnet = dlnetwork(layerGraph(layers));
% Custom training loop
for epoch = 1:numEpochs
dlX = dlarray(X’, ‘CB’); % Transpose input data to match network’s expected format
[gradients, loss] = dlfeval(@modelGradients, dlnet, dlX, N);
dlnet = dlupdate(@sgdmupdate, dlnet, gradients, learnRate);
disp([‘Epoch ‘ num2str(epoch) ‘, Loss: ‘ num2str(extractdata(loss))]);
end
% Testing phase
X_test = rand(N, M); % Assume test data is randomly generated
dlX_test = dlarray(X_test’, ‘CB’); % Transpose input data to match network’s expected format
Y_test = predict(dlnet, dlX_test);
disp(‘Dimensionality reduction results during testing:’);
disp(extractdata(Y_test)’);
% Custom loss function
function loss = customLoss(Y, N)
YA = extractdata(Y(:, 1:N))’;
YB = extractdata(Y(:, N+1:end))’;
muA = mean(YA);
muB = mean(YB);
covA = cov(YA);
covB = cov(YB);
covMean = (covA + covB) / 2;
d = 0.25 * (muA – muB) / covMean * (muA – muB)’ + 0.5 * log(det(covMean) / sqrt(det(covA) * det(covB)));
loss = -d; % Maximize Bhattacharyya distance
loss = dlarray(loss); % Ensure loss is a tracked dlarray scalar
end
% Model gradient function
function [gradients, loss] = modelGradients(dlnet, dlX, N)
Y = forward(dlnet, dlX);
loss = customLoss(Y, N);
gradients = dlgradient(loss, dlnet.Learnables);
end
% Update function
function param = sgdmupdate(param, grad, learnRate)
param = param – learnRate * grad;
end Hello, I am working on customizing the loss function to minimize dimensionality by maximizing the Bhattacharyya distance distance.
But it came up with a error shown as:
Incorrect use of dlarray/dlgradient
The requested value was not tracked. It must be a real dlarray scalar for tracking. Please use dlgradient to track variables in the function called by dlfestival.
% Parameter settings
M = 10; % Dimension of input features
N = 50; % Number of samples per class
numEpochs = 100;
learnRate = 0.01;
% Generate example data
X = rand(2*N, M);
X(1:N, 🙂 = X(1:N, 🙂 + 1; % Data for class A
X(N+1:end, 🙂 = X(N+1:end, 🙂 – 1; % Data for class B
% Define the neural network
layers = [
featureInputLayer(M, ‘Normalization’, ‘none’)
fullyConnectedLayer(10)
reluLayer
fullyConnectedLayer(3)
];
dlnet = dlnetwork(layerGraph(layers));
% Custom training loop
for epoch = 1:numEpochs
dlX = dlarray(X’, ‘CB’); % Transpose input data to match network’s expected format
[gradients, loss] = dlfeval(@modelGradients, dlnet, dlX, N);
dlnet = dlupdate(@sgdmupdate, dlnet, gradients, learnRate);
disp([‘Epoch ‘ num2str(epoch) ‘, Loss: ‘ num2str(extractdata(loss))]);
end
% Testing phase
X_test = rand(N, M); % Assume test data is randomly generated
dlX_test = dlarray(X_test’, ‘CB’); % Transpose input data to match network’s expected format
Y_test = predict(dlnet, dlX_test);
disp(‘Dimensionality reduction results during testing:’);
disp(extractdata(Y_test)’);
% Custom loss function
function loss = customLoss(Y, N)
YA = extractdata(Y(:, 1:N))’;
YB = extractdata(Y(:, N+1:end))’;
muA = mean(YA);
muB = mean(YB);
covA = cov(YA);
covB = cov(YB);
covMean = (covA + covB) / 2;
d = 0.25 * (muA – muB) / covMean * (muA – muB)’ + 0.5 * log(det(covMean) / sqrt(det(covA) * det(covB)));
loss = -d; % Maximize Bhattacharyya distance
loss = dlarray(loss); % Ensure loss is a tracked dlarray scalar
end
% Model gradient function
function [gradients, loss] = modelGradients(dlnet, dlX, N)
Y = forward(dlnet, dlX);
loss = customLoss(Y, N);
gradients = dlgradient(loss, dlnet.Learnables);
end
% Update function
function param = sgdmupdate(param, grad, learnRate)
param = param – learnRate * grad;
end deep learning MATLAB Answers — New Questions
M365 Developers Update | June 2024 Edition
In this monthly blog series focused on M365, we will be sharing product updates, notable reads, and other new resources that can be leveraged by developers who are building apps for the commercial marketplace.
Spotlight
Discover the power of customization with Microsoft Copilot extensions. Get Started.
Watch our foundational Build breakout session for a comprehensive guide to customizing Microsoft Copilot. View on demand >>
Learn how you can build Copilot extensions to enrich and Microsoft Copilot. Watch how >>
Build your own custom copilots for Microsoft Teams with the Teams AI Library and Teams Toolkit for Visual Studio Code, now generally available. Try it now >>
Expand the knowledge of Copilot for Microsoft 365 with Microsoft Graph connectors to build custom solutions leveraging the data and services in Microsoft Graph APIs. Get the updates >>
Learn
Read about the new tools coming to Microsoft Teams to help support developer productivity and collaboration. See what’s new >>
Microsoft Loop provides a central and flexible place for your work to help you stay in sync and on track. Discover how >>
Dive into the new capabilities and features for Office Add-ins development announced at Build. Learn more >>
Get started leveraging AI to elevate your custom Microsoft Mesh experience with the Mesh Toolkit. Read how >>
Online Training
Catch up on Microsoft Build 2024: View our breakout sessions on demand.
Collection of free Microsoft Copilot prompts: A new community-led repository set to transform your workflow.
Copilot for Microsoft 365: Try our newest learning paths to dive into Copilot for Microsoft 365 and explore different options for extending it.
Community calls: Learn from our experts on a variety of Microsoft 365 platform topics
Microsoft Tech Community – Latest Blogs –Read More
Converting Unix Timestamp to Date Time
Hi,
I’m trying to convert Unix time stamps to date time. So far I have tried:
date_time=(timestamp_array./86400000) + datetime(1970,1,1);
This seems to work find, except that my first measurment was 2123 seconds off. I looked at a few other times and they were 2122 seconds off, 2125 seconds off, etc. I’m not sure what could be causing this discrepancy.
Here is my original time data:
And here is what I am getting after I use my code:
Any insights would be much appreciated!!
(I had to divide my timestamps by 86400000 instead of 86400 becuase all my timestamsps have 3 extra zeros for some reason. Also, all measurements are on the same day if that makes any difference)Hi,
I’m trying to convert Unix time stamps to date time. So far I have tried:
date_time=(timestamp_array./86400000) + datetime(1970,1,1);
This seems to work find, except that my first measurment was 2123 seconds off. I looked at a few other times and they were 2122 seconds off, 2125 seconds off, etc. I’m not sure what could be causing this discrepancy.
Here is my original time data:
And here is what I am getting after I use my code:
Any insights would be much appreciated!!
(I had to divide my timestamps by 86400000 instead of 86400 becuase all my timestamsps have 3 extra zeros for some reason. Also, all measurements are on the same day if that makes any difference) Hi,
I’m trying to convert Unix time stamps to date time. So far I have tried:
date_time=(timestamp_array./86400000) + datetime(1970,1,1);
This seems to work find, except that my first measurment was 2123 seconds off. I looked at a few other times and they were 2122 seconds off, 2125 seconds off, etc. I’m not sure what could be causing this discrepancy.
Here is my original time data:
And here is what I am getting after I use my code:
Any insights would be much appreciated!!
(I had to divide my timestamps by 86400000 instead of 86400 becuase all my timestamsps have 3 extra zeros for some reason. Also, all measurements are on the same day if that makes any difference) datetime, unix, datenum, time series MATLAB Answers — New Questions