Month: September 2024
Edge browser in android only Chinese virsion in website
I use Edge browser on Android phone, the application is in English but when browsing websites the Chinese version of the websites appears and this annoys me, even the add-on settings are in Chinese
I use Edge browser on Android phone, the application is in English but when browsing websites the Chinese version of the websites appears and this annoys me, even the add-on settings are in Chinese Read More
Hi, does anyone know how to generate the graph as shown below based on a torus? Thank you so much.
Post Content Post Content torus MATLAB Answers — New Questions
For loop won’t display all 10 images in the subplot
%% 1.1 – Load and Prepare Data Set
clear;
clc;
B = load(‘images.mat’).image_data’; % Loads image file and transposes
C = mat2gray(B); % Converts images to grayscale
% Loop to generate and display images
for i = 1:10
im = reshape(C(:,i), [37, 50])’; % Reshape and store the image
subplot(10, 1, i); % Create a 10×1 grid of subplots
imshow(im, []); % Display each image with scaling
end
The above turns the colunms of a correctly sized matrix into images. When run I’m only getting 9 images of the neccessary 10. I’m thinking there’s some quirk where the firs column isn’t running but I’m unsure. I’m running it in matlab live in a browser window.%% 1.1 – Load and Prepare Data Set
clear;
clc;
B = load(‘images.mat’).image_data’; % Loads image file and transposes
C = mat2gray(B); % Converts images to grayscale
% Loop to generate and display images
for i = 1:10
im = reshape(C(:,i), [37, 50])’; % Reshape and store the image
subplot(10, 1, i); % Create a 10×1 grid of subplots
imshow(im, []); % Display each image with scaling
end
The above turns the colunms of a correctly sized matrix into images. When run I’m only getting 9 images of the neccessary 10. I’m thinking there’s some quirk where the firs column isn’t running but I’m unsure. I’m running it in matlab live in a browser window. %% 1.1 – Load and Prepare Data Set
clear;
clc;
B = load(‘images.mat’).image_data’; % Loads image file and transposes
C = mat2gray(B); % Converts images to grayscale
% Loop to generate and display images
for i = 1:10
im = reshape(C(:,i), [37, 50])’; % Reshape and store the image
subplot(10, 1, i); % Create a 10×1 grid of subplots
imshow(im, []); % Display each image with scaling
end
The above turns the colunms of a correctly sized matrix into images. When run I’m only getting 9 images of the neccessary 10. I’m thinking there’s some quirk where the firs column isn’t running but I’m unsure. I’m running it in matlab live in a browser window. for loop MATLAB Answers — New Questions
How to convert two nested for-loops to one parfor loop.
I have the following code. I want to get it in one parfor loop.
clear; clc;
% number of points:
Nx = 80;
Ny = 90;
xs = linspace(-2*pi/(3),4*pi/(3),Nx);
ys = linspace(-2*pi/(sqrt(3)),2*pi/(sqrt(3)),Ny);
% Allocate memory
ZZ = zeros(Nx,Ny,8);
XX = zeros(Nx,Ny);
YY = zeros(Nx,Ny);
for ix = 1:Nx
x = xs(ix);
for iy = 1:Ny
y = ys(iy);
FUN = fun(x,y);
% sort eigenvalues:
[~,D] = eig(FUN);
[D,I] = sort(diag(real(D)),’descend’);
evals = diag(D);
% store data:
ZZ(ix,iy,:) = diag(evals);
XX(ix,iy) = x;
YY(ix,iy) = y;
end
end
%% Plot figure
figure;
tiled = tiledlayout(2,2,"TileSpacing","tight","Padding","compact");
for q = 1:2:8
nexttile
surf(XX,YY,ZZ(:,:,q),’LineStyle’,’none’,’FaceColor’,’interp’);
view(2)
axis([-2*pi/(3) 4*pi/(3) -2*pi/(sqrt(3)) +2*pi/(sqrt(3))])
box on
grid off
axis square
colorbar
end
%%
function out = fun(x,y)
out = [ 3, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0
0, -3, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5
– 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, -1, -2*2^(1/2), – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0
0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, -2*2^(1/2), 1, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5
– 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, -1, 2^(1/2) – 6^(1/2)*1i, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0
0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 2^(1/2) + 6^(1/2)*1i, 1, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5
– 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, -1, 2^(1/2) + 6^(1/2)*1i
0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 2^(1/2) – 6^(1/2)*1i, 1
];
endI have the following code. I want to get it in one parfor loop.
clear; clc;
% number of points:
Nx = 80;
Ny = 90;
xs = linspace(-2*pi/(3),4*pi/(3),Nx);
ys = linspace(-2*pi/(sqrt(3)),2*pi/(sqrt(3)),Ny);
% Allocate memory
ZZ = zeros(Nx,Ny,8);
XX = zeros(Nx,Ny);
YY = zeros(Nx,Ny);
for ix = 1:Nx
x = xs(ix);
for iy = 1:Ny
y = ys(iy);
FUN = fun(x,y);
% sort eigenvalues:
[~,D] = eig(FUN);
[D,I] = sort(diag(real(D)),’descend’);
evals = diag(D);
% store data:
ZZ(ix,iy,:) = diag(evals);
XX(ix,iy) = x;
YY(ix,iy) = y;
end
end
%% Plot figure
figure;
tiled = tiledlayout(2,2,"TileSpacing","tight","Padding","compact");
for q = 1:2:8
nexttile
surf(XX,YY,ZZ(:,:,q),’LineStyle’,’none’,’FaceColor’,’interp’);
view(2)
axis([-2*pi/(3) 4*pi/(3) -2*pi/(sqrt(3)) +2*pi/(sqrt(3))])
box on
grid off
axis square
colorbar
end
%%
function out = fun(x,y)
out = [ 3, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0
0, -3, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5
– 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, -1, -2*2^(1/2), – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0
0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, -2*2^(1/2), 1, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5
– 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, -1, 2^(1/2) – 6^(1/2)*1i, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0
0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 2^(1/2) + 6^(1/2)*1i, 1, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5
– 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, -1, 2^(1/2) + 6^(1/2)*1i
0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 2^(1/2) – 6^(1/2)*1i, 1
];
end I have the following code. I want to get it in one parfor loop.
clear; clc;
% number of points:
Nx = 80;
Ny = 90;
xs = linspace(-2*pi/(3),4*pi/(3),Nx);
ys = linspace(-2*pi/(sqrt(3)),2*pi/(sqrt(3)),Ny);
% Allocate memory
ZZ = zeros(Nx,Ny,8);
XX = zeros(Nx,Ny);
YY = zeros(Nx,Ny);
for ix = 1:Nx
x = xs(ix);
for iy = 1:Ny
y = ys(iy);
FUN = fun(x,y);
% sort eigenvalues:
[~,D] = eig(FUN);
[D,I] = sort(diag(real(D)),’descend’);
evals = diag(D);
% store data:
ZZ(ix,iy,:) = diag(evals);
XX(ix,iy) = x;
YY(ix,iy) = y;
end
end
%% Plot figure
figure;
tiled = tiledlayout(2,2,"TileSpacing","tight","Padding","compact");
for q = 1:2:8
nexttile
surf(XX,YY,ZZ(:,:,q),’LineStyle’,’none’,’FaceColor’,’interp’);
view(2)
axis([-2*pi/(3) 4*pi/(3) -2*pi/(sqrt(3)) +2*pi/(sqrt(3))])
box on
grid off
axis square
colorbar
end
%%
function out = fun(x,y)
out = [ 3, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0
0, -3, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5
– 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, -1, -2*2^(1/2), – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0
0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, -2*2^(1/2), 1, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5
– 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, -1, 2^(1/2) – 6^(1/2)*1i, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0
0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 2^(1/2) + 6^(1/2)*1i, 1, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5
– 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 0, -1, 2^(1/2) + 6^(1/2)*1i
0, – 2*cos(x/2) – (3*cos((3^(1/2)*y)/2))/5, 0, – 2*cos(x/4 – (3^(1/2)*y)/4) – (3*cos((3*x)/4 + (3^(1/2)*y)/4))/5, 0, – 2*cos(x/4 + (3^(1/2)*y)/4) – (3*cos((3*x)/4 – (3^(1/2)*y)/4))/5, 2^(1/2) – 6^(1/2)*1i, 1
];
end parfor MATLAB Answers — New Questions
Tech Talks presents: Announcing a new Learn module
Join us on Thursday, October 3rd at 8am PT as Daniel Laskewitz, Senior Cloud Advocate, Power Platform, presents ‘Announcing a new Learn module: Use service principal authentication in custom connectors‘.
Call to Action:
Click on the link to save the calendar invite: https://aka.ms/TechTalksInvite
View past recordings (sign in required): https://aka.ms/TechTalksRecording
Join us on Thursday, October 3rd at 8am PT as Daniel Laskewitz, Senior Cloud Advocate, Power Platform, presents ‘Announcing a new Learn module: Use service principal authentication in custom connectors’.
Call to Action:
Click on the link to save the calendar invite: https://aka.ms/TechTalksInvite
View past recordings (sign in required): https://aka.ms/TechTalksRecording Read More
Today I Borked OneDrive Sync on MacOS. Here’s How I Did It and How I Fixed It
TL;DR – a short story of how I broke sync on my Macbook and why it required a full re-sync. Hopefully this helps someone down the line.
Backstory
I’ve been slowly moving all of my uploaded photos and videos to my Macbook for the past week. For the most part, things were going well until I made a small change with a OneDrive/SharePoint site and shortcut that seemed to break the sync tool to the point of requiring me to re-sync everything fresh.
What Broke?
The sync tool stopped syncing and nothing I did could get it to start again.
How Did this Happen?
Essentially, I deleted a SharePoint site that still has a shortcut in my OneDrive library. The sync tool picked up that the Shortcuts were no longer working and offered to “remove” the shortcuts for me, so I went for it.
The tool essentially quiet-quit from there. I quit/re-opened the app, but the sync would never start-up again.
I then removed the shortcuts via the web app (which I probably should have done in the first place), but the sync app wouldn’t pick up the changes. That’s when I knew it was truly borked.
Restarting my computer couldn’t even solve the issue. It took a full re-sync to get back into business, which thankfully went smoothly.
Lesson Learned
Remove shortcuts from the OneDrive web app, not the sync app.
TL;DR – a short story of how I broke sync on my Macbook and why it required a full re-sync. Hopefully this helps someone down the line. BackstoryI’ve been slowly moving all of my uploaded photos and videos to my Macbook for the past week. For the most part, things were going well until I made a small change with a OneDrive/SharePoint site and shortcut that seemed to break the sync tool to the point of requiring me to re-sync everything fresh. What Broke?The sync tool stopped syncing and nothing I did could get it to start again. How Did this Happen?Essentially, I deleted a SharePoint site that still has a shortcut in my OneDrive library. The sync tool picked up that the Shortcuts were no longer working and offered to “remove” the shortcuts for me, so I went for it. The tool essentially quiet-quit from there. I quit/re-opened the app, but the sync would never start-up again. I then removed the shortcuts via the web app (which I probably should have done in the first place), but the sync app wouldn’t pick up the changes. That’s when I knew it was truly borked. Restarting my computer couldn’t even solve the issue. It took a full re-sync to get back into business, which thankfully went smoothly. Lesson LearnedRemove shortcuts from the OneDrive web app, not the sync app. Read More
Microsoft لاتدفع مقدم الشيخ الروحاني السالمي ∫٠٠٩٠٥٠٧٤٤٧٥٥٥٥∫ اعمال روحانية مجربة جلب الحبيب \The
I tried to create a blog on Microsoft 365
And we were unable to do so.
How can I create aشيخ روحاني الامارات Microsoft blog that’
Microsoft Office
can be archived in or on search engines
Does this mean that Iدبي رقم ساحر have to resort to SharePoint?
Can I جلب الحبيب العنيد through cloud storage in Microsoft Office,
create pages or blogs Microsoft Office that are nrlسحر التفريق compatible with an archive
for search engines for Windows or other global browsers?
I tried to create a blog on Microsoft 365And we were unable to do so.How can I create aشيخ روحاني الامارات Microsoft blog that’Microsoft Officecan be archived in or on search enginesDoes this mean that Iدبي رقم ساحر have to resort to SharePoint?Can I جلب الحبيب العنيد through cloud storage in Microsoft Office,create pages or blogs Microsoft Office that are nrlسحر التفريق compatible with an archivefor search engines for Windows or other global browsers? Read More
Write a code in Matlab to generate a realistic synthetic ECG signal (which includes the noise aspect) , demonstrate Visualization of the signal in both the time and frequency
It must include the noise aspect, can l have a sample of the codeIt must include the noise aspect, can l have a sample of the code It must include the noise aspect, can l have a sample of the code kz MATLAB Answers — New Questions
JSON Syntax Error in Simulink Arduino Setup with Flatpak
On NixOS (glnxa64), when I have Flatpak enabled, I will receive an error from the following:
Install Simulink Support Package for Arduino Hardware add-on
Start Hardware Setup wizard in said add-on
Get to the stage where the wizard prompts me to Connect an Arduino Board and is detecting boards
Receive error "JSON syntax error at line 1 (character 1), expected ‘false’ but found ‘flatpak’"
There seem to be no log created for this error (or for the Hardware Setup wizard in general), so it’s been difficult for me to debug the exact reason that this is occuring.
The only way I’ve found to work around this error is to remove Flatpak from my system during Hardware Setup, and re-enable it later. Though there is no guarantee that Arduino support in Simulink will continue to work after I’ve re-enabled Flatpak (I’ve not tested), so I thought it’s important nevertheless for me to raise this issue.On NixOS (glnxa64), when I have Flatpak enabled, I will receive an error from the following:
Install Simulink Support Package for Arduino Hardware add-on
Start Hardware Setup wizard in said add-on
Get to the stage where the wizard prompts me to Connect an Arduino Board and is detecting boards
Receive error "JSON syntax error at line 1 (character 1), expected ‘false’ but found ‘flatpak’"
There seem to be no log created for this error (or for the Hardware Setup wizard in general), so it’s been difficult for me to debug the exact reason that this is occuring.
The only way I’ve found to work around this error is to remove Flatpak from my system during Hardware Setup, and re-enable it later. Though there is no guarantee that Arduino support in Simulink will continue to work after I’ve re-enabled Flatpak (I’ve not tested), so I thought it’s important nevertheless for me to raise this issue. On NixOS (glnxa64), when I have Flatpak enabled, I will receive an error from the following:
Install Simulink Support Package for Arduino Hardware add-on
Start Hardware Setup wizard in said add-on
Get to the stage where the wizard prompts me to Connect an Arduino Board and is detecting boards
Receive error "JSON syntax error at line 1 (character 1), expected ‘false’ but found ‘flatpak’"
There seem to be no log created for this error (or for the Hardware Setup wizard in general), so it’s been difficult for me to debug the exact reason that this is occuring.
The only way I’ve found to work around this error is to remove Flatpak from my system during Hardware Setup, and re-enable it later. Though there is no guarantee that Arduino support in Simulink will continue to work after I’ve re-enabled Flatpak (I’ve not tested), so I thought it’s important nevertheless for me to raise this issue. arduino, simulink, support package, hardware setup MATLAB Answers — New Questions
Any alternative for diode to make the model linear for real-time simulation?
Hello,
I am optimizing matlab/simulink model to run in real-time.
To make the model less computationally expensive, I’m optimizing the model like replacing the switches with variable resistance.
I was wondering if anybody has any suggestions for me to replace the diodes with a linear component.
Please let me know.
Thanks in advanceHello,
I am optimizing matlab/simulink model to run in real-time.
To make the model less computationally expensive, I’m optimizing the model like replacing the switches with variable resistance.
I was wondering if anybody has any suggestions for me to replace the diodes with a linear component.
Please let me know.
Thanks in advance Hello,
I am optimizing matlab/simulink model to run in real-time.
To make the model less computationally expensive, I’m optimizing the model like replacing the switches with variable resistance.
I was wondering if anybody has any suggestions for me to replace the diodes with a linear component.
Please let me know.
Thanks in advance real-time simulation, optimization, diode MATLAB Answers — New Questions
Custom Sugeno Fuzzy Model
How can I use custom output fuctions instead of ‘linear’ and ‘contant’ in a Sugeno Model?How can I use custom output fuctions instead of ‘linear’ and ‘contant’ in a Sugeno Model? How can I use custom output fuctions instead of ‘linear’ and ‘contant’ in a Sugeno Model? fuzzy MATLAB Answers — New Questions
Deployed Matlab function with strage errors: functions not found
Hi there,
I have a new company PC and had to install MATLAB on this PC. I’m currently facing some strange behaviour when deploying my functions and tools written with MATLAB.
I’m using ether MATLAB 2015aSP1 or 2015b as those two versions were the last providing 32bit support. The programs had to run also on older machine PCs therefore this restriction.
However when deploying even a simple function or small tool I always get some strange errors like the self written functions are not found (those functions are in a folder known to MATLAB). When running the functions or programs by MATLAB it works fine. The deployed version does not run.
I’ve installed the latest update for both MATLAB versions.
Im Using Windows 10 Enterprise (Version 10.019045). The MATLAB version is 8.5.1.959712 (R2015a) Service Pack 1 Update 3.
The first error is in which I run with startup.m
savepath(‘pathdef.m’);
The error says "Error using savepath. Too many input arguments"
Canceling out this line I get errors on other lines. It seems that the depolyed version does not find the folder with all the user functions.
The make it more complicated: on my old company PC it worked fine.
Kind regards,
ChristianHi there,
I have a new company PC and had to install MATLAB on this PC. I’m currently facing some strange behaviour when deploying my functions and tools written with MATLAB.
I’m using ether MATLAB 2015aSP1 or 2015b as those two versions were the last providing 32bit support. The programs had to run also on older machine PCs therefore this restriction.
However when deploying even a simple function or small tool I always get some strange errors like the self written functions are not found (those functions are in a folder known to MATLAB). When running the functions or programs by MATLAB it works fine. The deployed version does not run.
I’ve installed the latest update for both MATLAB versions.
Im Using Windows 10 Enterprise (Version 10.019045). The MATLAB version is 8.5.1.959712 (R2015a) Service Pack 1 Update 3.
The first error is in which I run with startup.m
savepath(‘pathdef.m’);
The error says "Error using savepath. Too many input arguments"
Canceling out this line I get errors on other lines. It seems that the depolyed version does not find the folder with all the user functions.
The make it more complicated: on my old company PC it worked fine.
Kind regards,
Christian Hi there,
I have a new company PC and had to install MATLAB on this PC. I’m currently facing some strange behaviour when deploying my functions and tools written with MATLAB.
I’m using ether MATLAB 2015aSP1 or 2015b as those two versions were the last providing 32bit support. The programs had to run also on older machine PCs therefore this restriction.
However when deploying even a simple function or small tool I always get some strange errors like the self written functions are not found (those functions are in a folder known to MATLAB). When running the functions or programs by MATLAB it works fine. The deployed version does not run.
I’ve installed the latest update for both MATLAB versions.
Im Using Windows 10 Enterprise (Version 10.019045). The MATLAB version is 8.5.1.959712 (R2015a) Service Pack 1 Update 3.
The first error is in which I run with startup.m
savepath(‘pathdef.m’);
The error says "Error using savepath. Too many input arguments"
Canceling out this line I get errors on other lines. It seems that the depolyed version does not find the folder with all the user functions.
The make it more complicated: on my old company PC it worked fine.
Kind regards,
Christian mcc, deploy, pathdef, savepath, startup, compiler MATLAB Answers — New Questions
Cannot get fmincon to work
Hello, I am trying to find the max value of a function of 5 variables with all of them constrained between 2 values. However, I do not have experience using this function and I can’t find any good information to use it properly in this scenario either in the MatLab help page, nor in any online tutorial.
As you can see in the code, the function I want to optimize is P, and the variables are V, na, nd, wn and wp.
Apologies if the code is too hard to understand.
clear
close
clc
format long
%% Variables
dp = 11.6;
taup = 3710e-6;
dn = 2;
taun = 371e-6;
Jl = 50e-3;
ni = 9.696e9;
q = 1.602176634e-19;
k = 1.3880649e-23;
T = 300;
ep = 1.035918e-12;
vint = @(na,nd) k.*T/q.*log((na.*nd)./ni^2);
xn = @(na,nd) sqrt((2.*ep.*vint(na,nd).*na)./(q.*nd.*(na+nd)));
xp = @(na,nd) sqrt((2.*ep.*vint(na,nd).*nd)./(q.*na.*(na+nd)));
dnxp = @(V,na) ni^2./na.*(exp(q*V./(k*T))-1);
dpxn = @(V,nd) ni^2./nd.*(exp(q*V./(k*T))-1);
%% Functions
C1 = @(V,na,nd,wn) dnxp(V,na)./(-exp((-2.*wn-xp(na,nd))./sqrt(dn*taun))+exp(xp(na,nd)./sqrt(dn*taun)));
C3 = @(V,na,nd,wp) dpxn(V,nd)./(exp(-xn(na,nd)./sqrt(taup*dp))-exp((2.*wp+xn(na,nd))./sqrt(taup*dp)));
Jn = @(x,V,na,nd,wn) q*sqrt(dn/taun).*C1(V,na,nd,wn).*(exp((-2.*wn-x)./sqrt(dn*taun))+exp(x./sqrt(dn*taun)));
Jp = @(x,V,na,nd,wp) -q*sqrt(dp/taup).*C3(V,na,nd,wp).*(exp(x./sqrt(taup*dp))+exp((2.*wp-x)./sqrt(taup*dp)));
Jd = @(V,na,nd,wn,wp) Jp(-xn(na,nd),V,na,nd,wn)+Jn(xp(na,nd),V,na,nd,wp);
J = @(V,na,nd,wn,wp) Jl-Jd(V,na,nd,wn,wp);
P = @(V,na,nd,wn,wp) J(V,na,nd,wn,wp).*V;
%% Boundaries
wn = [0.05e-4, 0.75e-4];
wp = [100e-4, 200e-4];
nd = [1e18, 5e20];
na = [1e14, 1e16];
V = [0, 0.52];
P0 = [(V(1)+V(2))/2; (wn(1)+wn(2))/2; (wp(1)+wp(2))/2; (nd(1)+nd(2))/2; (na(1)+na(2))/2];
%% Optimization
mx = fmincon(-P(V,wn,wp,nd,na),P0,[],[],[],[],[min(V),wn(1),wp(1),nd(1),na(1)],[max(V),wn(2),wp(2),nd(2),na(2)]);Hello, I am trying to find the max value of a function of 5 variables with all of them constrained between 2 values. However, I do not have experience using this function and I can’t find any good information to use it properly in this scenario either in the MatLab help page, nor in any online tutorial.
As you can see in the code, the function I want to optimize is P, and the variables are V, na, nd, wn and wp.
Apologies if the code is too hard to understand.
clear
close
clc
format long
%% Variables
dp = 11.6;
taup = 3710e-6;
dn = 2;
taun = 371e-6;
Jl = 50e-3;
ni = 9.696e9;
q = 1.602176634e-19;
k = 1.3880649e-23;
T = 300;
ep = 1.035918e-12;
vint = @(na,nd) k.*T/q.*log((na.*nd)./ni^2);
xn = @(na,nd) sqrt((2.*ep.*vint(na,nd).*na)./(q.*nd.*(na+nd)));
xp = @(na,nd) sqrt((2.*ep.*vint(na,nd).*nd)./(q.*na.*(na+nd)));
dnxp = @(V,na) ni^2./na.*(exp(q*V./(k*T))-1);
dpxn = @(V,nd) ni^2./nd.*(exp(q*V./(k*T))-1);
%% Functions
C1 = @(V,na,nd,wn) dnxp(V,na)./(-exp((-2.*wn-xp(na,nd))./sqrt(dn*taun))+exp(xp(na,nd)./sqrt(dn*taun)));
C3 = @(V,na,nd,wp) dpxn(V,nd)./(exp(-xn(na,nd)./sqrt(taup*dp))-exp((2.*wp+xn(na,nd))./sqrt(taup*dp)));
Jn = @(x,V,na,nd,wn) q*sqrt(dn/taun).*C1(V,na,nd,wn).*(exp((-2.*wn-x)./sqrt(dn*taun))+exp(x./sqrt(dn*taun)));
Jp = @(x,V,na,nd,wp) -q*sqrt(dp/taup).*C3(V,na,nd,wp).*(exp(x./sqrt(taup*dp))+exp((2.*wp-x)./sqrt(taup*dp)));
Jd = @(V,na,nd,wn,wp) Jp(-xn(na,nd),V,na,nd,wn)+Jn(xp(na,nd),V,na,nd,wp);
J = @(V,na,nd,wn,wp) Jl-Jd(V,na,nd,wn,wp);
P = @(V,na,nd,wn,wp) J(V,na,nd,wn,wp).*V;
%% Boundaries
wn = [0.05e-4, 0.75e-4];
wp = [100e-4, 200e-4];
nd = [1e18, 5e20];
na = [1e14, 1e16];
V = [0, 0.52];
P0 = [(V(1)+V(2))/2; (wn(1)+wn(2))/2; (wp(1)+wp(2))/2; (nd(1)+nd(2))/2; (na(1)+na(2))/2];
%% Optimization
mx = fmincon(-P(V,wn,wp,nd,na),P0,[],[],[],[],[min(V),wn(1),wp(1),nd(1),na(1)],[max(V),wn(2),wp(2),nd(2),na(2)]); Hello, I am trying to find the max value of a function of 5 variables with all of them constrained between 2 values. However, I do not have experience using this function and I can’t find any good information to use it properly in this scenario either in the MatLab help page, nor in any online tutorial.
As you can see in the code, the function I want to optimize is P, and the variables are V, na, nd, wn and wp.
Apologies if the code is too hard to understand.
clear
close
clc
format long
%% Variables
dp = 11.6;
taup = 3710e-6;
dn = 2;
taun = 371e-6;
Jl = 50e-3;
ni = 9.696e9;
q = 1.602176634e-19;
k = 1.3880649e-23;
T = 300;
ep = 1.035918e-12;
vint = @(na,nd) k.*T/q.*log((na.*nd)./ni^2);
xn = @(na,nd) sqrt((2.*ep.*vint(na,nd).*na)./(q.*nd.*(na+nd)));
xp = @(na,nd) sqrt((2.*ep.*vint(na,nd).*nd)./(q.*na.*(na+nd)));
dnxp = @(V,na) ni^2./na.*(exp(q*V./(k*T))-1);
dpxn = @(V,nd) ni^2./nd.*(exp(q*V./(k*T))-1);
%% Functions
C1 = @(V,na,nd,wn) dnxp(V,na)./(-exp((-2.*wn-xp(na,nd))./sqrt(dn*taun))+exp(xp(na,nd)./sqrt(dn*taun)));
C3 = @(V,na,nd,wp) dpxn(V,nd)./(exp(-xn(na,nd)./sqrt(taup*dp))-exp((2.*wp+xn(na,nd))./sqrt(taup*dp)));
Jn = @(x,V,na,nd,wn) q*sqrt(dn/taun).*C1(V,na,nd,wn).*(exp((-2.*wn-x)./sqrt(dn*taun))+exp(x./sqrt(dn*taun)));
Jp = @(x,V,na,nd,wp) -q*sqrt(dp/taup).*C3(V,na,nd,wp).*(exp(x./sqrt(taup*dp))+exp((2.*wp-x)./sqrt(taup*dp)));
Jd = @(V,na,nd,wn,wp) Jp(-xn(na,nd),V,na,nd,wn)+Jn(xp(na,nd),V,na,nd,wp);
J = @(V,na,nd,wn,wp) Jl-Jd(V,na,nd,wn,wp);
P = @(V,na,nd,wn,wp) J(V,na,nd,wn,wp).*V;
%% Boundaries
wn = [0.05e-4, 0.75e-4];
wp = [100e-4, 200e-4];
nd = [1e18, 5e20];
na = [1e14, 1e16];
V = [0, 0.52];
P0 = [(V(1)+V(2))/2; (wn(1)+wn(2))/2; (wp(1)+wp(2))/2; (nd(1)+nd(2))/2; (na(1)+na(2))/2];
%% Optimization
mx = fmincon(-P(V,wn,wp,nd,na),P0,[],[],[],[],[min(V),wn(1),wp(1),nd(1),na(1)],[max(V),wn(2),wp(2),nd(2),na(2)]); optimization, fmincon MATLAB Answers — New Questions
Error in Integrator block
Error:An error occurred during simulation and the simulation was terminated
Caused by:
Derivative of state ‘1’ in block ‘HW02_2024_SimulinkModel/VD model/velocity’ at time 64.05749999999999 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
at my integrator block.Error:An error occurred during simulation and the simulation was terminated
Caused by:
Derivative of state ‘1’ in block ‘HW02_2024_SimulinkModel/VD model/velocity’ at time 64.05749999999999 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
at my integrator block. Error:An error occurred during simulation and the simulation was terminated
Caused by:
Derivative of state ‘1’ in block ‘HW02_2024_SimulinkModel/VD model/velocity’ at time 64.05749999999999 is not finite. The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)
at my integrator block. simulink, matlab compiler MATLAB Answers — New Questions
Too Much Variables in Fuzzy Logic and ANFIS
Hi i have 13 variables and some of them has 5 membership. I can’t define all rules (1 billion rules). How can i define that rules?
And my data has 16000 rows how can i train fis without memory problem?
P.S.I can only use some of GUI’s so please keep it simple.
ThxHi i have 13 variables and some of them has 5 membership. I can’t define all rules (1 billion rules). How can i define that rules?
And my data has 16000 rows how can i train fis without memory problem?
P.S.I can only use some of GUI’s so please keep it simple.
Thx Hi i have 13 variables and some of them has 5 membership. I can’t define all rules (1 billion rules). How can i define that rules?
And my data has 16000 rows how can i train fis without memory problem?
P.S.I can only use some of GUI’s so please keep it simple.
Thx fuzzy, variables, membership, fuzzy rules, anfis MATLAB Answers — New Questions
Calculation not having the desired array size
I am trying to calcumate the Acceleration using a rotational matrix, during the loop the left side is a 3×14074 (good), but the right is (3×3) which I don’t want. How can I fix this so the right side has a matching size? Thanks
% Acc and AngV are sensor data sets and have sizes of 14074×3
% qF is 3x3x14074
g = [0,0,9.81];
xn = zeros(3, length(Acc));
fuse = imufilter(‘SampleRate’,100,’DecimationFactor’,1);
q = fuse(Acc, AngV);
qF = quat2rotm(q);
for i=1:length(AngV)
xn(1:3,:) = qF(:,:,i) .* Acc(i,:)’ – g; % This is where the error arises
end
vi = xn .* dt;
ri = .5 * xn .* (dt^2);
I’ve tried every combination of transforms and reordering that I could think of, everything gives 3×3 or 3×1. Somehow I used to have this work for me, then I woke up and bam, its broken.
Error:
Unable to perform assignment because the size of the left side is 3-by-14074 and the size of the right side is 3-by-3.
Error in RunKalman (line 27)
xn(1:3, 🙂 = qF(:, :, i)’ .* Acc(i, :)’ – g;I am trying to calcumate the Acceleration using a rotational matrix, during the loop the left side is a 3×14074 (good), but the right is (3×3) which I don’t want. How can I fix this so the right side has a matching size? Thanks
% Acc and AngV are sensor data sets and have sizes of 14074×3
% qF is 3x3x14074
g = [0,0,9.81];
xn = zeros(3, length(Acc));
fuse = imufilter(‘SampleRate’,100,’DecimationFactor’,1);
q = fuse(Acc, AngV);
qF = quat2rotm(q);
for i=1:length(AngV)
xn(1:3,:) = qF(:,:,i) .* Acc(i,:)’ – g; % This is where the error arises
end
vi = xn .* dt;
ri = .5 * xn .* (dt^2);
I’ve tried every combination of transforms and reordering that I could think of, everything gives 3×3 or 3×1. Somehow I used to have this work for me, then I woke up and bam, its broken.
Error:
Unable to perform assignment because the size of the left side is 3-by-14074 and the size of the right side is 3-by-3.
Error in RunKalman (line 27)
xn(1:3, 🙂 = qF(:, :, i)’ .* Acc(i, :)’ – g; I am trying to calcumate the Acceleration using a rotational matrix, during the loop the left side is a 3×14074 (good), but the right is (3×3) which I don’t want. How can I fix this so the right side has a matching size? Thanks
% Acc and AngV are sensor data sets and have sizes of 14074×3
% qF is 3x3x14074
g = [0,0,9.81];
xn = zeros(3, length(Acc));
fuse = imufilter(‘SampleRate’,100,’DecimationFactor’,1);
q = fuse(Acc, AngV);
qF = quat2rotm(q);
for i=1:length(AngV)
xn(1:3,:) = qF(:,:,i) .* Acc(i,:)’ – g; % This is where the error arises
end
vi = xn .* dt;
ri = .5 * xn .* (dt^2);
I’ve tried every combination of transforms and reordering that I could think of, everything gives 3×3 or 3×1. Somehow I used to have this work for me, then I woke up and bam, its broken.
Error:
Unable to perform assignment because the size of the left side is 3-by-14074 and the size of the right side is 3-by-3.
Error in RunKalman (line 27)
xn(1:3, 🙂 = qF(:, :, i)’ .* Acc(i, :)’ – g; matrix manipulation, matrix array MATLAB Answers — New Questions
I’m unable to progress to next module in MS Learn (Azure course)
Need help with this please – studying the Azure Fundamentals course and I am unable to see the next button to go to the next module. It is thus not tracking my progress even when I go through the content manually.
Need help with this please – studying the Azure Fundamentals course and I am unable to see the next button to go to the next module. It is thus not tracking my progress even when I go through the content manually. Read More
GET Cross Project Pipeline Permissions on Resources
Hi all
Pipeline permissions: In the first instance of attempting to access a resource, we get a pop up to allow the pipeline to access it. Let’s use a repository resource example: We have a pipeline to which we have granted the permission to access a repository.
– If the YAML is placed within the same project as the repository, the permission into the repository is evident from the Pipeline Permissions section https://dev.azure.com/ORG/PROJECT1/_settings/repositories.
– However, if the YAML is not within the same project, it will not be evident in this page.
Somewhere, somehow, ADO knows a pipeline in project Y has permission to access repository in project X (I assume as it does not re-prompts the same permission pop-up a second time).
API:
Hi all Pipeline permissions: In the first instance of attempting to access a resource, we get a pop up to allow the pipeline to access it. Let’s use a repository resource example: We have a pipeline to which we have granted the permission to access a repository. – If the YAML is placed within the same project as the repository, the permission into the repository is evident from the Pipeline Permissions section https://dev.azure.com/ORG/PROJECT1/_settings/repositories. – However, if the YAML is not within the same project, it will not be evident in this page. Somewhere, somehow, ADO knows a pipeline in project Y has permission to access repository in project X (I assume as it does not re-prompts the same permission pop-up a second time). API: https://dev.azure.com/ORG/PROJECT/_apis/pipelines/pipelinepermissions/repository/REPOSITORYID?api-version=7.1-preview.1 I tried to change the PROJECT id to the project ID of the external project, but no luck. Is there a way to obtain all the pipelines that are permission-ed into a repository, even if they are from other projects? Read More
10-minute intervals under General availability (custom hours)
Hello! Was hoping someone could help me out….was trying to see how i can be able to see 10-minute intervals when im choosing custom hours (under general availability)…as of right now, i can only see intervals of every 30 minutes?
Thanks
Hello! Was hoping someone could help me out….was trying to see how i can be able to see 10-minute intervals when im choosing custom hours (under general availability)…as of right now, i can only see intervals of every 30 minutes?Thanks Read More