Month: July 2024
Correcting the error in Alamouti code (2 x 1)
I trying to code Alamouti code for BPSK in Rayleigh fading channel for BER simulation.There is a matrix dimention mismatch in decode section.I tried to correct it ,but it did not work.
Need your help to correct it.Thank you
clear all;
close all;
clc;
Ps = 1;%Transmit power
N = 10^6; % number of bits or symbols
NR = 1;
num_runs = 10;
snr_dB = -3:10 ; % in dB
rand(‘seed’,1); % initializing the rand() function so that random bits produced are same in every simulation
randn(‘seed’,1);
% Transmitter
x_data1 = rand(1,N/2)>0.5;
x_data2 = rand(1,N/2)>0.5;
binaryData = [x_data1; x_data2];
BPSK_data1 = 2*x_data1 – 1;
BPSK_data2 = 2*x_data2 – 1;
% BPSK modulation – 2×500000 matrix
BPSK_data =[BPSK_data1; BPSK_data2];
n1 = AWGN(1);
n2 = AWGN(1);
h1 = Rayleigh(1);
h2 = Rayleigh(1);
SNR = 10.^(snr_dB/10);
Noise_power = zeros(1,length(snr_dB));
for k = 1:length(snr_dB)
% Add complex AWGN noise power
Noise_power = Ps./SNR(k);
% In the first time slot, the received signal
y1 = h1.*BPSK_data1 + h2.*BPSK_data2 + n1;
% In the first time slot, the received signal
y2 = h1.*(-conj(BPSK_data2)) + h2.*(conj(BPSK_data1)) + n2;
%Rayleigh fading channel – 2×1 matrix
H = [h1 h2 ; conj(h2) -conj(h1)];
%Decode the sysmbols – ZF decoder
x1_hat = pinv(H).*y1;
x2_hat = pinv(H).*conj(y2);
rx_bits = [x1_hat;x2_hat];
rx_bits = real(rx_bits) > 0;
% Count errors
nErr(k) = size(find(binaryData – rx_bits),1);
end
% counting the errors
ber = nErr/N; % simulated ber
figure(1);
semilogy(snr_dB,ber,’b.-‘);
% axis([0 10 10^-4 0.6])
grid on;
legend( ‘MIMO – BER’);
xlabel(‘SNR[dB]’);
ylabel(‘Bit Error Rate’);
title(‘BER for MIMO-BPSK’);
%%%%% AWGN noise %%%%%
function n = AWGN(N)
n = rand(1,N);
end
%%%%% Rayleigh channel %%%%%%
function h = Rayleigh(N);
x = sqrt(1/2).*rand(1,N);
y = sqrt(1/2).*rand(1,N);
h = abs(x + i*y);
endI trying to code Alamouti code for BPSK in Rayleigh fading channel for BER simulation.There is a matrix dimention mismatch in decode section.I tried to correct it ,but it did not work.
Need your help to correct it.Thank you
clear all;
close all;
clc;
Ps = 1;%Transmit power
N = 10^6; % number of bits or symbols
NR = 1;
num_runs = 10;
snr_dB = -3:10 ; % in dB
rand(‘seed’,1); % initializing the rand() function so that random bits produced are same in every simulation
randn(‘seed’,1);
% Transmitter
x_data1 = rand(1,N/2)>0.5;
x_data2 = rand(1,N/2)>0.5;
binaryData = [x_data1; x_data2];
BPSK_data1 = 2*x_data1 – 1;
BPSK_data2 = 2*x_data2 – 1;
% BPSK modulation – 2×500000 matrix
BPSK_data =[BPSK_data1; BPSK_data2];
n1 = AWGN(1);
n2 = AWGN(1);
h1 = Rayleigh(1);
h2 = Rayleigh(1);
SNR = 10.^(snr_dB/10);
Noise_power = zeros(1,length(snr_dB));
for k = 1:length(snr_dB)
% Add complex AWGN noise power
Noise_power = Ps./SNR(k);
% In the first time slot, the received signal
y1 = h1.*BPSK_data1 + h2.*BPSK_data2 + n1;
% In the first time slot, the received signal
y2 = h1.*(-conj(BPSK_data2)) + h2.*(conj(BPSK_data1)) + n2;
%Rayleigh fading channel – 2×1 matrix
H = [h1 h2 ; conj(h2) -conj(h1)];
%Decode the sysmbols – ZF decoder
x1_hat = pinv(H).*y1;
x2_hat = pinv(H).*conj(y2);
rx_bits = [x1_hat;x2_hat];
rx_bits = real(rx_bits) > 0;
% Count errors
nErr(k) = size(find(binaryData – rx_bits),1);
end
% counting the errors
ber = nErr/N; % simulated ber
figure(1);
semilogy(snr_dB,ber,’b.-‘);
% axis([0 10 10^-4 0.6])
grid on;
legend( ‘MIMO – BER’);
xlabel(‘SNR[dB]’);
ylabel(‘Bit Error Rate’);
title(‘BER for MIMO-BPSK’);
%%%%% AWGN noise %%%%%
function n = AWGN(N)
n = rand(1,N);
end
%%%%% Rayleigh channel %%%%%%
function h = Rayleigh(N);
x = sqrt(1/2).*rand(1,N);
y = sqrt(1/2).*rand(1,N);
h = abs(x + i*y);
end I trying to code Alamouti code for BPSK in Rayleigh fading channel for BER simulation.There is a matrix dimention mismatch in decode section.I tried to correct it ,but it did not work.
Need your help to correct it.Thank you
clear all;
close all;
clc;
Ps = 1;%Transmit power
N = 10^6; % number of bits or symbols
NR = 1;
num_runs = 10;
snr_dB = -3:10 ; % in dB
rand(‘seed’,1); % initializing the rand() function so that random bits produced are same in every simulation
randn(‘seed’,1);
% Transmitter
x_data1 = rand(1,N/2)>0.5;
x_data2 = rand(1,N/2)>0.5;
binaryData = [x_data1; x_data2];
BPSK_data1 = 2*x_data1 – 1;
BPSK_data2 = 2*x_data2 – 1;
% BPSK modulation – 2×500000 matrix
BPSK_data =[BPSK_data1; BPSK_data2];
n1 = AWGN(1);
n2 = AWGN(1);
h1 = Rayleigh(1);
h2 = Rayleigh(1);
SNR = 10.^(snr_dB/10);
Noise_power = zeros(1,length(snr_dB));
for k = 1:length(snr_dB)
% Add complex AWGN noise power
Noise_power = Ps./SNR(k);
% In the first time slot, the received signal
y1 = h1.*BPSK_data1 + h2.*BPSK_data2 + n1;
% In the first time slot, the received signal
y2 = h1.*(-conj(BPSK_data2)) + h2.*(conj(BPSK_data1)) + n2;
%Rayleigh fading channel – 2×1 matrix
H = [h1 h2 ; conj(h2) -conj(h1)];
%Decode the sysmbols – ZF decoder
x1_hat = pinv(H).*y1;
x2_hat = pinv(H).*conj(y2);
rx_bits = [x1_hat;x2_hat];
rx_bits = real(rx_bits) > 0;
% Count errors
nErr(k) = size(find(binaryData – rx_bits),1);
end
% counting the errors
ber = nErr/N; % simulated ber
figure(1);
semilogy(snr_dB,ber,’b.-‘);
% axis([0 10 10^-4 0.6])
grid on;
legend( ‘MIMO – BER’);
xlabel(‘SNR[dB]’);
ylabel(‘Bit Error Rate’);
title(‘BER for MIMO-BPSK’);
%%%%% AWGN noise %%%%%
function n = AWGN(N)
n = rand(1,N);
end
%%%%% Rayleigh channel %%%%%%
function h = Rayleigh(N);
x = sqrt(1/2).*rand(1,N);
y = sqrt(1/2).*rand(1,N);
h = abs(x + i*y);
end matlab, mimo, wireless, alamouti code MATLAB Answers — New Questions
how to make task in simulink
I’m trying to create a motor control simulation.
I would like to implement functions according to the execution cycle as if configuring actual motor control embedded software.
For example, I want to configure the current control subsystem so that this subsystem runs at a 1ms task, and the speed control subsystem calculates at a 5ms task.
How can I use Simulink to implement something like the example?I’m trying to create a motor control simulation.
I would like to implement functions according to the execution cycle as if configuring actual motor control embedded software.
For example, I want to configure the current control subsystem so that this subsystem runs at a 1ms task, and the speed control subsystem calculates at a 5ms task.
How can I use Simulink to implement something like the example? I’m trying to create a motor control simulation.
I would like to implement functions according to the execution cycle as if configuring actual motor control embedded software.
For example, I want to configure the current control subsystem so that this subsystem runs at a 1ms task, and the speed control subsystem calculates at a 5ms task.
How can I use Simulink to implement something like the example? simulink, task MATLAB Answers — New Questions
Is Warehouse management APIs are available in business central?
Hi Team,
I have use case like to enter goods item level and need to store it in business central.Like i need to do like to create purchase order from invoice document and do inventory put Away through API .Create PO API is there.Please guide me to get inventory put-away API?
Thanks,
Ardra
Hi Team, I have use case like to enter goods item level and need to store it in business central.Like i need to do like to create purchase order from invoice document and do inventory put Away through API .Create PO API is there.Please guide me to get inventory put-away API? Thanks,Ardra Read More
Is it possible to show the “All Documents” view in a SharePoint Library only to admins
Hello All,
There is a Document Library “working documents” that has two views. One is the “All Documents” view which shows all the documents uploaded by all people. There is another view “My Documents” that I created, which only shows documents uploaded by me (I have filtered this My Documents view to only show ones by me)
The requirement is as follows :
-The “All Documents” view should not be seen by any regular user. It should only be visible by admins (For eg, users belong to a specific M365 group or specific users)
-So the goal is when a user accesses this library to upload documents, they should not see “All documents” view, and just be defaulted to the “my documents” view
Please advice how can we achieve this and hide the All docs view for uploading users, and show it only for a specific group of people like admins
Hello All, There is a Document Library “working documents” that has two views. One is the “All Documents” view which shows all the documents uploaded by all people. There is another view “My Documents” that I created, which only shows documents uploaded by me (I have filtered this My Documents view to only show ones by me)The requirement is as follows : -The “All Documents” view should not be seen by any regular user. It should only be visible by admins (For eg, users belong to a specific M365 group or specific users)-So the goal is when a user accesses this library to upload documents, they should not see “All documents” view, and just be defaulted to the “my documents” viewPlease advice how can we achieve this and hide the All docs view for uploading users, and show it only for a specific group of people like admins Read More
The specified user does not have a valid profile
-Some users get “The specified user does not have a valid profile” error(Win 11), To give more context online updates are typically not allowed within org unless a permission is given, When we did install windows updates, and rebooted a few times, issue was resolved, Question is this is a known issue, Did not seem to find any relevant information in the KB articles for updates addressing this specific issue so not sure what the root cause of the issue is and what exactly solved it. Any help is appreciated. Note: Some articles refer to MS store however it is not relevant and not logged in before or after the issue has been resolved. This error appears for certain users ,prevents them from launching Teams, Outlook , all windows apps in general It typically occurs on Windows machines.For e.g. Read More
Deep Linking for an In-App Admin Approval Screen in Power Apps
Deep linking is a powerful feature that enables users to access specific screens or forms within a mobile or web application directly without having to navigate through the traditional user interface. In this article, I explore how to implement deep linking for an in-app admin approval screen in Power Apps. In organizations, certain actions like approving leave requests, expense claims, or project submissions require administrative approval. Traditionally, this involves manual steps and navigating through the app’s screens. With deep linking, administrators can directly access the approval screen without going through the usual steps. By using deep links, you can streamline the approval process and make it more convenient for administrators to access and approve requests.
I’ll walk you through each step in the process:
Creating the information screen
Creating the approval screen
Setting up the OnStart function
Handling the StartScreen function Editing the shareable app link
Creating the automated cloud flow for email notifications and deep linking
Configuring the OnSuccess property for the approval screen
Final testing
Step 1: Creating the Information Screen
In this step, you design and create the information screen for your Power App. The information screen serves as the front-facinginterface where users will access and view relevant data or content. Follow these steps:
Create a new screen, and name it InformationScreen. This screen will contain a form connected to your database, whichusers will fill out to request approval.
Add a form to the screen and connect it to your database. Set its display property to New for users to enter new data.
Edit the fields displayed in the form, excluding the approval field from your database.
Add a button control with the text property set to Submit, and assign the OnSelect function to submit the form: SubmitForm(form1)
Step 2: Creating the Approval Screen
In this step, you build the approval screen for your admin. The approval screen is a crucial component when dealing withworkflows or processes that require authorization from specific individuals or teams. It typically includes options for users toapprove or reject requests, comments, and additional information necessary for decision-making.
Create another screen, and name it ApprovalScreen. This screen will display the form for approving or editing submittedrequests.
Add a form to the screen and connect it to your database. This time, set its display property to Edit to allow administrators to review and approve requests.
Edit the fields displayed in the form, this time including the approval field from your database.
Add a button control with the text property set to Submit, and assign the OnSelect function to submit the approval form: SubmitForm(form2)
Step 3: Setting Up the OnStart Function
In the app, input the following code at the OnStart function. This code handles the initialization of the app and sets theappropriate mode based on whether the app was launched with a specific request ID (deep link) or not.
If(
!IsBlank(Param(“ID”)),
Set(
varItem,
LookUp(
‘Database_name’,
ID = Value(Param(“ID”))
)
);
Set(
varMode,
FormMode.Edit
)
)
Explanation
Here’s how it works:
The OnStart function runs when the app starts.
The If statement checks if the ID parameter is present in the app’s launch URL (deep link). If present, it means the user clicked on a specific request to view or approve it.
The LookUp function finds the database record with the specified ID.
The Set function assigns the found record to the varItem variable.
The Set function also changes the form mode to Edit to enable editing of the request.
Step 4: Handling the StartScreen Function
In the app, input the following code at the StartScreen function. This code determines which screen to display based on the presence of an ID parameter (deep link).
If(
!IsBlank(Param(“ID”)) && !IsBlank(LookUp(‘Database_name’, ID = Value(Param(“ID”)))),
ApprovalScreen,
InformationScreen
)
Explanation
Here’s how it works:
The StartScreen function determines the first screen to display when the app launches.
The If statement checks if the ID parameter is present in the app’s launch URL (deep link) and also verifies if the corresponding database record exists.
If both conditions are met, the user is taken to the ApprovalScreen to view or approve the request.
If the ID parameter is missing or the associated record doesn’t exist, the user is directed to the InformationScreen to submit a new request.
Step 5: Editing the Shareable App Link
To make the app link shareable and include the deep link, follow these steps:
Click the Share icon in Power Apps, which opens the share page in a new tab.
Copy the app link and paste it into a code editor or a Notepad app.
Apply the href attribute to the link as shown here: <a href=”link&ID=”>Take Action</a>
Replace “link” with the copied app link.
Step 6: Creating the Automated Cloud Flow for Email Notifications and Deep Linking
To handle email notifications and deep linking, create a cloud flow (Power Automate) with the following steps:
Choose PowerApps (V2) as the main trigger for the flow.
Add the Get Item action to collect more information from your database (if using SharePoint list).
Select and add the Send an email (V2) action to send an email notification to the administrator.
Click the code view icon in the body of the Send an email (V2) action and paste the deep link with the following format:
<a href=”https://apps.powerapps.com/play/e/default-9dfc36c3-b5c1-4129-be98-ec7e4df78702/a/0a2573bb-2708-4a67-99bd-fe2a7c031727?tenantId=9dfc36c3-b5c1-1234-be98-ec7e4df12345&ID=”>Take Action</a>
Replace the part after “ID=” with the dynamic content “ItemID” from the Power Apps trigger.
The Get Item action within the flow allows you to retrieve additional fields from your SharePoint list, which you can include in your email notification.
Step 7: Configuring the OnSuccess Property for the Approval Screen
Input the following code at the OnSuccess property of the screen containing the approval form in Power Apps. This code handles the submission of the approval form, triggers the automated cloud flow, and shows a success notification.
Set(varApproval, LookUp(‘Database_name’, ID = form1.LastSubmit.ID));
ApprovalFlow.Run(varApproval.ID, “Approval”);
Notify(“Form Submitted”, NotificationType.Success);
Explanation
Here’s how it works:
The Set function assigns the database record of the last submitted request to the varApproval variable.
The ApprovalFlow.Run function triggers the automated cloud flow, passing the request ID and the action Approval as parameters.
The Notify function displays a success notification to the user, indicating that the form has been successfully submitted.
Step 8: Final Testing
Fill out the form on the InformationScreen and submit it. An email notification is sent to the administrator containing the Take Action hyperlink.
Click on the hyperlink in the email, which will take you to the ApprovalScreen, allowing you to review and edit the request using a drop-down list of feedback options.
After making any necessary changes, click Submit on the ApprovalScreen to finalize the approval process.
Conclusion
You can use deep linking to streamline the approval process in Power Apps by making it easier for administrators to access and approve requests. By following the steps in this article, you can learn how to implement deep linking for an in-app admin approval screen, which will improve the user experience and efficiency of your Power Apps solution.
Resources
Create a canvas app with deep link
Microsoft Power Apps documentation
Power Apps training
Microsoft Tech Community – Latest Blogs –Read More
I am unable to connect MQTT client using Thingspeak in MATLAB.
Here is my piece of code, I am following the steps of the tutorial https://www.mathworks.com/help/icomm/ug/get-started-with-mqtt.html
clientID = "client id";
userName = "user name";
password = "password";
rootCert = "Path";
brokerAddress = "ssl://mqtt3.thingspeak.com";
port = 8883;
mqClient = mqttclient(brokerAddress, Port = port, ClientID = clientID,…
Username = userName, Password = password, CARootCertificate = rootCert);
upon reaching the mqClient, the following error occurs
ThingSpeakMQTT
Error: File: ThingSpeakMQTT.m
Incorrect use of ‘=’ operator. To assign a value to a variable, use ‘=’.
To compare values for equality, use ‘==’.
Please someone guide me on this.Here is my piece of code, I am following the steps of the tutorial https://www.mathworks.com/help/icomm/ug/get-started-with-mqtt.html
clientID = "client id";
userName = "user name";
password = "password";
rootCert = "Path";
brokerAddress = "ssl://mqtt3.thingspeak.com";
port = 8883;
mqClient = mqttclient(brokerAddress, Port = port, ClientID = clientID,…
Username = userName, Password = password, CARootCertificate = rootCert);
upon reaching the mqClient, the following error occurs
ThingSpeakMQTT
Error: File: ThingSpeakMQTT.m
Incorrect use of ‘=’ operator. To assign a value to a variable, use ‘=’.
To compare values for equality, use ‘==’.
Please someone guide me on this. Here is my piece of code, I am following the steps of the tutorial https://www.mathworks.com/help/icomm/ug/get-started-with-mqtt.html
clientID = "client id";
userName = "user name";
password = "password";
rootCert = "Path";
brokerAddress = "ssl://mqtt3.thingspeak.com";
port = 8883;
mqClient = mqttclient(brokerAddress, Port = port, ClientID = clientID,…
Username = userName, Password = password, CARootCertificate = rootCert);
upon reaching the mqClient, the following error occurs
ThingSpeakMQTT
Error: File: ThingSpeakMQTT.m
Incorrect use of ‘=’ operator. To assign a value to a variable, use ‘=’.
To compare values for equality, use ‘==’.
Please someone guide me on this. thingspeak, mqtt MATLAB Answers — New Questions
How to Return Text from Column 1 if Text in Other Rows Match
Hello, here is an example data set I am dealing with and what I am trying to find a formula for:
In reality, I have about 85 tasks. In the second table, I want it to return for each day, the Tasks that are marked with an X in the top table. The tasks can change depending on the week, and the number of tasks per day can also change, so I need the output to be able to return the task name in Column 1 for all rows marked with an X for each day of the week. I hope this makes sense.
Thank You
Hello, here is an example data set I am dealing with and what I am trying to find a formula for: In reality, I have about 85 tasks. In the second table, I want it to return for each day, the Tasks that are marked with an X in the top table. The tasks can change depending on the week, and the number of tasks per day can also change, so I need the output to be able to return the task name in Column 1 for all rows marked with an X for each day of the week. I hope this makes sense. Thank You Read More
Is there a way to exculde a day from a daily backup in SSMS?
I created a daily maintenance plan in SSMS that included taking full backup of my DBs. The next day I changed the backup type from full to differential. So now, I have a full backup of one day and subsequent differential backups of a couple of days.
My goal is to take a full backup on Sunday night, and differential backups on every other night of the week. Is that possible in SSMS?
I created a daily maintenance plan in SSMS that included taking full backup of my DBs. The next day I changed the backup type from full to differential. So now, I have a full backup of one day and subsequent differential backups of a couple of days. My goal is to take a full backup on Sunday night, and differential backups on every other night of the week. Is that possible in SSMS? Read More
full functions and header footer excel office 365
Trying to edit a large excel document recently transferred from a desktop application to office 365. I no longer have the desktop licence but want to edit the excel. I cannot get the full document header/footer. Any suggestions as to how I can do this?
Trying to edit a large excel document recently transferred from a desktop application to office 365. I no longer have the desktop licence but want to edit the excel. I cannot get the full document header/footer. Any suggestions as to how I can do this? Read More
Application linked to Sharepoint
How do companies, or developers in general, create apps on their employees devices that when launched, directly link you on a Sharepoint site?
How do companies, or developers in general, create apps on their employees devices that when launched, directly link you on a Sharepoint site? Read More
MEX functions work fine on R2017a but not on R2021b even after successful recompilation on R2021b
Hello, here is my problem: I upgraded from Matlab R2017a to 2021b based on the recommendation for compatibility with Windows 11 (I moved to a new PC). However, I am experiencing problems with the MEX functions I use to connect to hardware (open connexion, close connexion, update status, basic functions). I recompiled the MEX functions (for which I have all the source files) under MATLAB 2021b, using both the -R2017b and -R2018a options, and they recompiled successfully. Despite this, I cannot connect to the hardware. If I use the same MEX functions on the same computer (Windows 11) with MATLAB R2017a, it works fine (not if I compiled the MEX with -R2018a option which makes sense I believe). Additionally, I am using external software from the manufacturer to control the hardware, and it works fine too (driver correctly installed). The issue only occurs with MATLAB 2021b. I compared the verbose outputs of the MEX function compilations with the -R2017b and -R2018a options and found no significant differences. I am confused as to why the MEX functions work with MATLAB R2017a but not with R2021b on the same computer, especially since the functions recompiled with R2021b show no warnings or errors. Do you have any tips or ideas to solve this issue?
Additionnaly, the MEX functions works fine with R2017a, hardware controlled correctly, while with R2021b error code from MEX functions states "device not found". Matlab configuration between installation R2017a and R2021b is the same (paths, compiler, etc.). Thanks !Hello, here is my problem: I upgraded from Matlab R2017a to 2021b based on the recommendation for compatibility with Windows 11 (I moved to a new PC). However, I am experiencing problems with the MEX functions I use to connect to hardware (open connexion, close connexion, update status, basic functions). I recompiled the MEX functions (for which I have all the source files) under MATLAB 2021b, using both the -R2017b and -R2018a options, and they recompiled successfully. Despite this, I cannot connect to the hardware. If I use the same MEX functions on the same computer (Windows 11) with MATLAB R2017a, it works fine (not if I compiled the MEX with -R2018a option which makes sense I believe). Additionally, I am using external software from the manufacturer to control the hardware, and it works fine too (driver correctly installed). The issue only occurs with MATLAB 2021b. I compared the verbose outputs of the MEX function compilations with the -R2017b and -R2018a options and found no significant differences. I am confused as to why the MEX functions work with MATLAB R2017a but not with R2021b on the same computer, especially since the functions recompiled with R2021b show no warnings or errors. Do you have any tips or ideas to solve this issue?
Additionnaly, the MEX functions works fine with R2017a, hardware controlled correctly, while with R2021b error code from MEX functions states "device not found". Matlab configuration between installation R2017a and R2021b is the same (paths, compiler, etc.). Thanks ! Hello, here is my problem: I upgraded from Matlab R2017a to 2021b based on the recommendation for compatibility with Windows 11 (I moved to a new PC). However, I am experiencing problems with the MEX functions I use to connect to hardware (open connexion, close connexion, update status, basic functions). I recompiled the MEX functions (for which I have all the source files) under MATLAB 2021b, using both the -R2017b and -R2018a options, and they recompiled successfully. Despite this, I cannot connect to the hardware. If I use the same MEX functions on the same computer (Windows 11) with MATLAB R2017a, it works fine (not if I compiled the MEX with -R2018a option which makes sense I believe). Additionally, I am using external software from the manufacturer to control the hardware, and it works fine too (driver correctly installed). The issue only occurs with MATLAB 2021b. I compared the verbose outputs of the MEX function compilations with the -R2017b and -R2018a options and found no significant differences. I am confused as to why the MEX functions work with MATLAB R2017a but not with R2021b on the same computer, especially since the functions recompiled with R2021b show no warnings or errors. Do you have any tips or ideas to solve this issue?
Additionnaly, the MEX functions works fine with R2017a, hardware controlled correctly, while with R2021b error code from MEX functions states "device not found". Matlab configuration between installation R2017a and R2021b is the same (paths, compiler, etc.). Thanks ! function, matlab function, mex MATLAB Answers — New Questions
solving this maximization problem
Hi everyone,
Could anyone assist me with solving this maximization problem in MATLAB? I need to maximize the following function and determine the optimal values of r and t.
Thank you!
-(1/((1 + 2 a)^2))
t (-3 – 2 r + t – 5 a + 2 t a +
2 Sqrt[2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)] +
2 a Sqrt[
2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)]) (-4 r +
2 a (-2 + Sqrt[
2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)]) +
3 (-1 + Sqrt[2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)]))Hi everyone,
Could anyone assist me with solving this maximization problem in MATLAB? I need to maximize the following function and determine the optimal values of r and t.
Thank you!
-(1/((1 + 2 a)^2))
t (-3 – 2 r + t – 5 a + 2 t a +
2 Sqrt[2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)] +
2 a Sqrt[
2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)]) (-4 r +
2 a (-2 + Sqrt[
2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)]) +
3 (-1 + Sqrt[2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)])) Hi everyone,
Could anyone assist me with solving this maximization problem in MATLAB? I need to maximize the following function and determine the optimal values of r and t.
Thank you!
-(1/((1 + 2 a)^2))
t (-3 – 2 r + t – 5 a + 2 t a +
2 Sqrt[2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)] +
2 a Sqrt[
2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)]) (-4 r +
2 a (-2 + Sqrt[
2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)]) +
3 (-1 + Sqrt[2 (2 + r – t) + (-2 + 2 r^2 + t)/(1 + a)])) optimal, maximize MATLAB Answers — New Questions
How to convert sparse matrix into image?
I have a sparse matrix which contains
aa =
(1,1) 72
(1,2) 101
(1,3) 108
Now I want to convert this into image …?I have a sparse matrix which contains
aa =
(1,1) 72
(1,2) 101
(1,3) 108
Now I want to convert this into image …? I have a sparse matrix which contains
aa =
(1,1) 72
(1,2) 101
(1,3) 108
Now I want to convert this into image …? how to convert sparse matrix into image? MATLAB Answers — New Questions
Error adding Exchange account to Outlook Application
I am now getting an error message in adding my Exchange account to Outlook Application. The error is couldn’t setup your account. Contact Email Admin. We have tried Autodiscovery in registry already HKEY_CURRENT_USERSoftwareMicrosoftOfficex.0OutlookAutoDiscover , no luck. Also check with these keys HKEY_USERSDEFAULTSoftwareMicrosoftOffice16.0CommonIdentity. We have tried new profile, tried Microsoft 365, Exchange, and Outlook.com but all of them shows same error. I can login with my phone, tablet and https://mail.premium.exchange/owa/auth/logon.aspx website. The issue is just adding in Outlook Application using computer. I am using Microsoft 365 subscription. Please advise for the steps we could still perform. My account is not managed by an Admin , so there’s no way we could enable Modern authentication.
I am now getting an error message in adding my Exchange account to Outlook Application. The error is couldn’t setup your account. Contact Email Admin. We have tried Autodiscovery in registry already HKEY_CURRENT_USERSoftwareMicrosoftOfficex.0OutlookAutoDiscover , no luck. Also check with these keys HKEY_USERSDEFAULTSoftwareMicrosoftOffice16.0CommonIdentity. We have tried new profile, tried Microsoft 365, Exchange, and Outlook.com but all of them shows same error. I can login with my phone, tablet and https://mail.premium.exchange/owa/auth/logon.aspx website. The issue is just adding in Outlook Application using computer. I am using Microsoft 365 subscription. Please advise for the steps we could still perform. My account is not managed by an Admin , so there’s no way we could enable Modern authentication. Read More
Cannot append double array local function variable to an existing structured double
%My existing structure is a 103 X 4 double. I would like to add an additional column to make 103 x 5 double, by adding shoe size (column 5) to my curated list of store stock (103 X 4 table)
%shoe_size = (1,:) %column array calculated locally in function
newstruct = shoe_size
existing = userdata.shoe.brand;
values_cell = shoe_size;
for i = 1:numel(existing)
existing(i).(newstruct) = values_cell(i,5);
end%My existing structure is a 103 X 4 double. I would like to add an additional column to make 103 x 5 double, by adding shoe size (column 5) to my curated list of store stock (103 X 4 table)
%shoe_size = (1,:) %column array calculated locally in function
newstruct = shoe_size
existing = userdata.shoe.brand;
values_cell = shoe_size;
for i = 1:numel(existing)
existing(i).(newstruct) = values_cell(i,5);
end %My existing structure is a 103 X 4 double. I would like to add an additional column to make 103 x 5 double, by adding shoe size (column 5) to my curated list of store stock (103 X 4 table)
%shoe_size = (1,:) %column array calculated locally in function
newstruct = shoe_size
existing = userdata.shoe.brand;
values_cell = shoe_size;
for i = 1:numel(existing)
existing(i).(newstruct) = values_cell(i,5);
end structures, for loop, arrays MATLAB Answers — New Questions
what(): Unable to launch the MATLABWindow application during installation
So, I’m running a fresh install of Manjaro Gnome and I’m trying to install matlab. I downloaded the installer, unpacked but when I try to run "bash ./install" it gives me the error:
terminate called after throwing an instance of ‘std::runtime_error’
what(): Unable to launch the MATLABWindow application
Matlab version is R2020a.So, I’m running a fresh install of Manjaro Gnome and I’m trying to install matlab. I downloaded the installer, unpacked but when I try to run "bash ./install" it gives me the error:
terminate called after throwing an instance of ‘std::runtime_error’
what(): Unable to launch the MATLABWindow application
Matlab version is R2020a. So, I’m running a fresh install of Manjaro Gnome and I’m trying to install matlab. I downloaded the installer, unpacked but when I try to run "bash ./install" it gives me the error:
terminate called after throwing an instance of ‘std::runtime_error’
what(): Unable to launch the MATLABWindow application
Matlab version is R2020a. manjaro archlinux runtime_error MATLAB Answers — New Questions
What mex compiler can I use on my Macbook Pro 2017?
I have some software which utilizes a couple mex functions, compiled from .c files. They were compiled on a windows computer and so only work on Windows. I’m updating the software to work on other platforms, so I need to re-compile the c files on my mac to make mex functions that are compatible with mac. To do this, I need a compiler that’s compatible with mac. As far as I can tell, the only compiler I can get for free is Xcode.
However, when I try to install Xcode, I can’t. It is not compatible with anything before MacOS 14. Yet when I try to download MacOS 14 Sonoma, I can’t because it’s not compatible with my computer, only with Macbook Pro 2018 and later.
So my question is, how can I compile .c files into mex functions on my macbook pro 2017? Is there any free compiler out there that will do the job?I have some software which utilizes a couple mex functions, compiled from .c files. They were compiled on a windows computer and so only work on Windows. I’m updating the software to work on other platforms, so I need to re-compile the c files on my mac to make mex functions that are compatible with mac. To do this, I need a compiler that’s compatible with mac. As far as I can tell, the only compiler I can get for free is Xcode.
However, when I try to install Xcode, I can’t. It is not compatible with anything before MacOS 14. Yet when I try to download MacOS 14 Sonoma, I can’t because it’s not compatible with my computer, only with Macbook Pro 2018 and later.
So my question is, how can I compile .c files into mex functions on my macbook pro 2017? Is there any free compiler out there that will do the job? I have some software which utilizes a couple mex functions, compiled from .c files. They were compiled on a windows computer and so only work on Windows. I’m updating the software to work on other platforms, so I need to re-compile the c files on my mac to make mex functions that are compatible with mac. To do this, I need a compiler that’s compatible with mac. As far as I can tell, the only compiler I can get for free is Xcode.
However, when I try to install Xcode, I can’t. It is not compatible with anything before MacOS 14. Yet when I try to download MacOS 14 Sonoma, I can’t because it’s not compatible with my computer, only with Macbook Pro 2018 and later.
So my question is, how can I compile .c files into mex functions on my macbook pro 2017? Is there any free compiler out there that will do the job? mex compiler, mex, mac, macbook pro 2017 MATLAB Answers — New Questions
Accurately obtaining the value of a variable at the requested points
Dear all
I am attaching a data set, where the first and second columns represent spatial coordinates (x,y) in two-dimensional space, while the third column shows the value of a given magnitude at the aforementioned set of (x,y) points. I was wondering which could be the best option in a scenario inside a for loop, where the (x,y) variables change at each step, to obtain an accurate value for the aforementioned variable defined in the third column of the attached file, even if for that combination of (x,y) coordinates the value of the variable is not present a priori. Would be something like
griddata(file(:,1),file(:,2),file(:,3),x,y,"cubic");
a quick and accurate approach?Dear all
I am attaching a data set, where the first and second columns represent spatial coordinates (x,y) in two-dimensional space, while the third column shows the value of a given magnitude at the aforementioned set of (x,y) points. I was wondering which could be the best option in a scenario inside a for loop, where the (x,y) variables change at each step, to obtain an accurate value for the aforementioned variable defined in the third column of the attached file, even if for that combination of (x,y) coordinates the value of the variable is not present a priori. Would be something like
griddata(file(:,1),file(:,2),file(:,3),x,y,"cubic");
a quick and accurate approach? Dear all
I am attaching a data set, where the first and second columns represent spatial coordinates (x,y) in two-dimensional space, while the third column shows the value of a given magnitude at the aforementioned set of (x,y) points. I was wondering which could be the best option in a scenario inside a for loop, where the (x,y) variables change at each step, to obtain an accurate value for the aforementioned variable defined in the third column of the attached file, even if for that combination of (x,y) coordinates the value of the variable is not present a priori. Would be something like
griddata(file(:,1),file(:,2),file(:,3),x,y,"cubic");
a quick and accurate approach? guessing data at a given set of points MATLAB Answers — New Questions