Category: News
How to design your own input signal characteristics in Simulink?
While Designing Active noise cancellation algorithm in simulink, generally white noise or pink noise is used, however if the source of noise is from cetrain plane with specific dB at defined frequency in frequency band from 50Hz to 10KHz. How to design source noise signal in simulink. Or do I need to intergate the simulink model to hardware system in real time?While Designing Active noise cancellation algorithm in simulink, generally white noise or pink noise is used, however if the source of noise is from cetrain plane with specific dB at defined frequency in frequency band from 50Hz to 10KHz. How to design source noise signal in simulink. Or do I need to intergate the simulink model to hardware system in real time? While Designing Active noise cancellation algorithm in simulink, generally white noise or pink noise is used, however if the source of noise is from cetrain plane with specific dB at defined frequency in frequency band from 50Hz to 10KHz. How to design source noise signal in simulink. Or do I need to intergate the simulink model to hardware system in real time? active noise cancellation algorithm, simulink, white noise or pink noise, 50hz to 10khz, design source noise signal, integrating simulink model to real time hardware MATLAB Answers — New Questions
Issues on the translation of MATLAB machine learning model to Python
Dear community,
I had training a Machine Learning model using the classification learner, that as the following characteristics:
% This code specifies all the classifier options and trains the classifier.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
I managed to get an accuracy of around 98%.
But when I tried to translate this code to Python, as follows and with the same training set, but I am not able to find the same accuracy, its a lot lower in Python. I would like to know if and what are the differences between both languages so I can adjust the parameters accordingly.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
Thank you in advance.Dear community,
I had training a Machine Learning model using the classification learner, that as the following characteristics:
% This code specifies all the classifier options and trains the classifier.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
I managed to get an accuracy of around 98%.
But when I tried to translate this code to Python, as follows and with the same training set, but I am not able to find the same accuracy, its a lot lower in Python. I would like to know if and what are the differences between both languages so I can adjust the parameters accordingly.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
Thank you in advance. Dear community,
I had training a Machine Learning model using the classification learner, that as the following characteristics:
% This code specifies all the classifier options and trains the classifier.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
I managed to get an accuracy of around 98%.
But when I tried to translate this code to Python, as follows and with the same training set, but I am not able to find the same accuracy, its a lot lower in Python. I would like to know if and what are the differences between both languages so I can adjust the parameters accordingly.
template = templateTree(…
‘MaxNumSplits’, 5003);
classificationEnsemble = fitcensemble(…
predictors, …
response, …
‘Method’, ‘Bag’, …
‘NumLearningCycles’, 30, …
‘Learners’, template, …
‘ClassNames’, [1; 2; 3; 4; 5]);
Thank you in advance. machine learning, classification learner, python, ensemble MATLAB Answers — New Questions
access data in App-Designer in nested function call
I have defined a variable cr as a public propertie and can refer to it within the program by usind app.cr. However I call a function withinh function
where I need to use the variable, but by running the programm I get an error message:
Unrecognized field name "cr".
Error in SolarsystemOrbits_03/EarthOrbit (line 413)
app.TMG_solver( n, x, y, z, vx, vy, vz, bx, by, bz);
Error in SolarsystemOrbits_03/OrbitMain (line 191)
app.EarthOrbit;
Error in SolarsystemOrbits_03/ComputeButtonPushed (line 1341)
app.OrbitMain;
What am I doing wrong.I have defined a variable cr as a public propertie and can refer to it within the program by usind app.cr. However I call a function withinh function
where I need to use the variable, but by running the programm I get an error message:
Unrecognized field name "cr".
Error in SolarsystemOrbits_03/EarthOrbit (line 413)
app.TMG_solver( n, x, y, z, vx, vy, vz, bx, by, bz);
Error in SolarsystemOrbits_03/OrbitMain (line 191)
app.EarthOrbit;
Error in SolarsystemOrbits_03/ComputeButtonPushed (line 1341)
app.OrbitMain;
What am I doing wrong. I have defined a variable cr as a public propertie and can refer to it within the program by usind app.cr. However I call a function withinh function
where I need to use the variable, but by running the programm I get an error message:
Unrecognized field name "cr".
Error in SolarsystemOrbits_03/EarthOrbit (line 413)
app.TMG_solver( n, x, y, z, vx, vy, vz, bx, by, bz);
Error in SolarsystemOrbits_03/OrbitMain (line 191)
app.EarthOrbit;
Error in SolarsystemOrbits_03/ComputeButtonPushed (line 1341)
app.OrbitMain;
What am I doing wrong. data in app designer MATLAB Answers — New Questions
Linear Inversion of River Profiles
Has any one tried the code by Sean.F.Gallen on linear inversion of river profiles.
https://github.com/sfgallen/Block_Uplift_Linear_Inversion_Models.
If anybody has tried may please help me as I am finding difficulty in running the code.Has any one tried the code by Sean.F.Gallen on linear inversion of river profiles.
https://github.com/sfgallen/Block_Uplift_Linear_Inversion_Models.
If anybody has tried may please help me as I am finding difficulty in running the code. Has any one tried the code by Sean.F.Gallen on linear inversion of river profiles.
https://github.com/sfgallen/Block_Uplift_Linear_Inversion_Models.
If anybody has tried may please help me as I am finding difficulty in running the code. topotoolbox, plotting MATLAB Answers — New Questions
Excel: SUM and SUMIF
Hi all, I am preparing an excel file and I have an issue with the SUM formula.
In the file, I added a checkbox that will give 0 if FALSE (not ticked) or 125 is TRUE (ticked).
For this I used the formula =SUMIF(K21,TRUE,M21) where:
K21 is the true/false cell linked to the checkbox
M21 is 125
What I want to achieve is: When the box is ticked, add 125 to the final amount (in cell J37) and sum all prices in cells J26:J35 (and when the checkbox is not ticked, then 125 should not appear in the total sum).
Both formulas:
=SUMIF(K21,TRUE,M21)
=SUM(J26:J35)
Work separately, but they do not work together in the same cell, as I would like to have just one final cell (J37) that includes the amounts J26:J35 & SUMIF(K21,TRUE,M21).
Could you please help me with this?
Hi all, I am preparing an excel file and I have an issue with the SUM formula. In the file, I added a checkbox that will give 0 if FALSE (not ticked) or 125 is TRUE (ticked). For this I used the formula =SUMIF(K21,TRUE,M21) where:K21 is the true/false cell linked to the checkboxM21 is 125 What I want to achieve is: When the box is ticked, add 125 to the final amount (in cell J37) and sum all prices in cells J26:J35 (and when the checkbox is not ticked, then 125 should not appear in the total sum). Both formulas:=SUMIF(K21,TRUE,M21)=SUM(J26:J35)Work separately, but they do not work together in the same cell, as I would like to have just one final cell (J37) that includes the amounts J26:J35 & SUMIF(K21,TRUE,M21). Could you please help me with this? Read More
What is this Windows 11 Enterprise G version of windows?
My first time to see this version. Anyone knows about it?
My first time to see this version. Anyone knows about it? Read More
BYCOL & BYROW
Hi,
Below formula throwing #Calc error:
Need one array formula.
Hi, Below formula throwing #Calc error:BYCOL(C3#,LAMBDA(ColHdrs_1,BYROW(B4#,LAMBDA(RowHdrs_1,IFERROR(COUNTA(UNIQUE(FILTER($K$3:$K$25,($I$3:$I$25=RowHdrs_1)*($J$3:$J$25=ColHdrs_1)))),0))))) Need one array formula.Sheet Read More
Integrating Power BI with Azure Data Services
Integrating Power BI with Azure Data Services
Introduction
Hi, I am Khalid Abdelaty a Microsoft Learn Student Ambassador, studying Computer Science Student @ Tanta University in Egypt. I am fancisanted by the opportunity of AI and the ability to analyze and interpret data.
Power BI has seen massive growth in the past couple of years in the IT industry. With the exponential growth of data, employees face challenges in data governance. To manage this unmeasurable data, we need reliable storage solutions. Microsoft Azure facilitates the integration of Power BI with services such as SQL, Stream Analytics, and many others. This combination enhances the ability to work with complex data efficiently.
In this article, we will discuss the following topics:
What Azure services can we connect to Power BI?
Hands-on: Integrate Power BI with Azure
FAQs
Conclusion
What Azure Services Can We Connect to Power BI?
By combining Azure services with Power BI, you can transform data processing efforts into analytics and reports for real-time insights that benefit your business. Azure Power BI has built-in connectivity and integration to develop complex business intelligence solutions without the need for coding.
We can connect the following Azure services with Power BI:
Azure SQL Database
Stream Analytics
Azure ML
Azure Event Hub
Azure Storage
Azure HDInsight
Hands-on: Integrate Power BI with Azure
Step-by-Step Guide to Connecting Azure SQL Database with Power BI:
Go to Azure Portal and click create a resource.
2. Search for Azure SQL and press enter.
3. Select the resource type as Single Database and click on create.
4. Fill in the necessary details such as specifying a resource group, creating a server for the database, then click on review and create and finally click on create.
You will notice that the deployment is in progress. Once the database is deployed, open it.
5. Now, we will add some data into the SQL database. For that, go to your SQL database and click on query editor. Enter the credentials you set while creating the server for the database.
6. Let’s add a simple query and run it :
CREATE TABLE Person (
PersonId INT IDENTITY PRIMARY KEY,
FirstName NVARCHAR(128) NOT NULL,
MiddelInitial NVARCHAR(10),
LastName NVARCHAR(128) NOT NULL,
DateOfBirth DATE NOT NULL
);
CREATE TABLE Student (
StudentId INT IDENTITY PRIMARY KEY,
PersonId INT REFERENCES Person (PersonId),
Email NVARCHAR(256)
);
CREATE TABLE Course (
CourseId INT IDENTITY PRIMARY KEY,
Name NVARCHAR(50) NOT NULL,
Teacher NVARCHAR(256) NOT NULL
);
CREATE TABLE Credit (
StudentId INT REFERENCES Student (StudentId),
CourseId INT REFERENCES Course (CourseId),
Grade DECIMAL(5,2) CHECK (Grade <= 100.00),
Attempt TINYINT,
CONSTRAINT [UQ_studentgrades] UNIQUE CLUSTERED (
StudentId, CourseId, Grade, Attempt
)
);
7. Next step is to add data to the table. Select the dbo.course table and add rows to it by clicking on Create New Row.
Now we have the data present in the SQL database. Now we will visualize the data in Power BI.
8. Click on Power BI (preview) option under the Power platform and click on get started, and it will download the pbids file as shown below
9. Open the pbi file, and it will open up the Power BI desktop application. It will ask for the username and password under Database. Provide the username and password you set while creating a database server.
As we added some sample values under the course table, preview the data by clicking on course and click on load.
As you can see that we added CourseID, Name, and Teacher rows.
Just check the CourseID, Name, and Teacher. It will create a visualization out of this data. You can choose any visualization from the visualization section, as shown below.
Hence it is a straightforward process to create a visualization using Power BI Integration with Azure.
FAQs
Q1: How does Power BI integrate with Azure?
Ans: Power BI integrates with Azure services to provide real-time business insights through seamless data analytics and reporting.
Q2: Does Power BI work with Azure?
Ans: Yes, Power BI works with Azure to unify data and simplify complex datasets through visualizations.
Q3: What is the use of Power BI embedded in Azure?
Ans: Power BI embedded allows developers to integrate interactive reports and dashboards into applications quickly, transforming data into graphical forms.
Conclusion
Integrating Power BI with Azure provides stability and enhances the ability to handle large data volumes. With easy connectivity and powerful visualizations, users can leverage Azure’s enhanced governance and cataloging capabilities for insightful data analysis.
Microsoft Tech Community – Latest Blogs –Read More
Plotting a 3-value graph
Hı,
How can I draw the graph whose image I added? can you help me please?
The relationship between values is briefly,
drift ratio – displacement
displacement – base shear
I use the hold on command, but displacement and drift ratio are on the same axis (x axis).
How can I define separate axis like here?Hı,
How can I draw the graph whose image I added? can you help me please?
The relationship between values is briefly,
drift ratio – displacement
displacement – base shear
I use the hold on command, but displacement and drift ratio are on the same axis (x axis).
How can I define separate axis like here? Hı,
How can I draw the graph whose image I added? can you help me please?
The relationship between values is briefly,
drift ratio – displacement
displacement – base shear
I use the hold on command, but displacement and drift ratio are on the same axis (x axis).
How can I define separate axis like here? graphics, matlab MATLAB Answers — New Questions
Error using readgeoraster??
file1 = ‘path/to/first/raster.tif’;
file2 = ‘path/to/second/raster.tif’;
file3 = ‘path/to/third/raster.tif’;
raster1 = readgeoraster(file1);
I try to file upload and slope analysis but ı got this error. Can you help me with this prob?file1 = ‘path/to/first/raster.tif’;
file2 = ‘path/to/second/raster.tif’;
file3 = ‘path/to/third/raster.tif’;
raster1 = readgeoraster(file1);
I try to file upload and slope analysis but ı got this error. Can you help me with this prob? file1 = ‘path/to/first/raster.tif’;
file2 = ‘path/to/second/raster.tif’;
file3 = ‘path/to/third/raster.tif’;
raster1 = readgeoraster(file1);
I try to file upload and slope analysis but ı got this error. Can you help me with this prob? error, tif, readgeoraster MATLAB Answers — New Questions
Share content from Matlab cloud drive
Hello,
is it possible to perform the following actions from matlab command prompt?
Create a folder in Matlab Drive
Upload files into the folder
Share the folder
Get the link for sharing
I’d like to get these things done by a script, so I could then just send the sharing link via email
Thanks all,
TeroHello,
is it possible to perform the following actions from matlab command prompt?
Create a folder in Matlab Drive
Upload files into the folder
Share the folder
Get the link for sharing
I’d like to get these things done by a script, so I could then just send the sharing link via email
Thanks all,
Tero Hello,
is it possible to perform the following actions from matlab command prompt?
Create a folder in Matlab Drive
Upload files into the folder
Share the folder
Get the link for sharing
I’d like to get these things done by a script, so I could then just send the sharing link via email
Thanks all,
Tero cloud drive, sharing MATLAB Answers — New Questions
varargin error for optional inputs
I was running this code
%%Parse Inputs
p = inputParser;
p.FunctionName = ‘linear_inversion_ksn’;
% required inputs
addRequired(p,’DEM’, @(x) isa(x,’GRIDobj’));
% optional inputs
addOptional(p,’crita’, 1e6, @(x) isscalar(x));
addOptional(p,’mn’, 0.5, @(x) isscalar(x));
addOptional(p,’chi_inc’, 1, @(x) isscalar(x));
addOptional(p,’gam’, 10, @(x) isscalar(x));
addOptional(p,’flowOption’, []);
parse(p,DEM, varargin{:});
DEM = p.Results.DEM;
And got an error like this
>> parse(p,DEM, varargin{:});
Brace indexing into the result of a function call is not supported. Assign the result
of ‘varargin’ to a variable first, then brace index into it.
Kindly help me in fixing itI was running this code
%%Parse Inputs
p = inputParser;
p.FunctionName = ‘linear_inversion_ksn’;
% required inputs
addRequired(p,’DEM’, @(x) isa(x,’GRIDobj’));
% optional inputs
addOptional(p,’crita’, 1e6, @(x) isscalar(x));
addOptional(p,’mn’, 0.5, @(x) isscalar(x));
addOptional(p,’chi_inc’, 1, @(x) isscalar(x));
addOptional(p,’gam’, 10, @(x) isscalar(x));
addOptional(p,’flowOption’, []);
parse(p,DEM, varargin{:});
DEM = p.Results.DEM;
And got an error like this
>> parse(p,DEM, varargin{:});
Brace indexing into the result of a function call is not supported. Assign the result
of ‘varargin’ to a variable first, then brace index into it.
Kindly help me in fixing it I was running this code
%%Parse Inputs
p = inputParser;
p.FunctionName = ‘linear_inversion_ksn’;
% required inputs
addRequired(p,’DEM’, @(x) isa(x,’GRIDobj’));
% optional inputs
addOptional(p,’crita’, 1e6, @(x) isscalar(x));
addOptional(p,’mn’, 0.5, @(x) isscalar(x));
addOptional(p,’chi_inc’, 1, @(x) isscalar(x));
addOptional(p,’gam’, 10, @(x) isscalar(x));
addOptional(p,’flowOption’, []);
parse(p,DEM, varargin{:});
DEM = p.Results.DEM;
And got an error like this
>> parse(p,DEM, varargin{:});
Brace indexing into the result of a function call is not supported. Assign the result
of ‘varargin’ to a variable first, then brace index into it.
Kindly help me in fixing it varargin, function MATLAB Answers — New Questions
Display list filtered by a fixed filter in webpart in Sharepoint365
Hello everyone,
please help me out, as I am starting to despair. Here’s what I am trying to do:
I have a List of processes and a separate List of all process steps of all processes. I am using a lookup field to connect those steps to their respective process. For easier use, I want to create a SharePoint page for each process, showing, among other things, a list of the steps of this specific process.
Seems straightforward but, for now, I haven’t found a way to create this filtered view on the List of steps in an embed.
I’ve tried three ways:
1. Using the List web part, there seems to be no way to define a fixed filter.
2. Using a list view filtered by URL parameters embedded using the embed web part – technically works but looks ugly, as it doesn’t display only the list, but several control bars, which I can only remove in parts using JSON view formatting. The “?env=Embedded” parameter also seems to be doing nothing…
3. Creating a pre-defined list view in Lists and embedding this – also technically works but is a lot of manual work and there appears to be no way to filter a view on a hidden column, so I would have to display the name of the process as well which is redundant information.
My last resort would be creating a separate List for each process, but that seems a bit excessive and would massively hinder further extensions of the system.
Any other ideas?
Thanks!
Nils
Hello everyone, please help me out, as I am starting to despair. Here’s what I am trying to do: I have a List of processes and a separate List of all process steps of all processes. I am using a lookup field to connect those steps to their respective process. For easier use, I want to create a SharePoint page for each process, showing, among other things, a list of the steps of this specific process. Seems straightforward but, for now, I haven’t found a way to create this filtered view on the List of steps in an embed. I’ve tried three ways: 1. Using the List web part, there seems to be no way to define a fixed filter. 2. Using a list view filtered by URL parameters embedded using the embed web part – technically works but looks ugly, as it doesn’t display only the list, but several control bars, which I can only remove in parts using JSON view formatting. The “?env=Embedded” parameter also seems to be doing nothing… 3. Creating a pre-defined list view in Lists and embedding this – also technically works but is a lot of manual work and there appears to be no way to filter a view on a hidden column, so I would have to display the name of the process as well which is redundant information. My last resort would be creating a separate List for each process, but that seems a bit excessive and would massively hinder further extensions of the system. Any other ideas? Thanks! Nils Read More
Need a powershell script to change the default font from Aptos to Verdana in powerpoint
Hi Champs,
Does anyone could provide a powershell script to change the default font from Aptos to Verdana in powerpoint please.
We are in a intune environment. I want to push it to all the devices. Please assist.
Thanks,
Ram
Hi Champs, Does anyone could provide a powershell script to change the default font from Aptos to Verdana in powerpoint please.We are in a intune environment. I want to push it to all the devices. Please assist. Thanks,Ram Read More
Auto save on file opening
I am using OneDrive on Windows 11. I manage all my files with OneDrive. I manage the documents with the Windows Explorer file structure on my computer by creating a shortcut via MS Teams or SharePoint.
OneDrive is always in sync mode on my computer. It updates automatically whenever I make changes to any file. But the important detail is “when I update” 🙂
I have a problem with OneDrive for a while. I don’t know if this is due to OneDrive.
When I open any file, the file is somehow automatically saved and synced to OneDrive, even if I don’t make any changes to the file. Unfortunately, this way I miss the previous modification date of the file etc.
Of course, I can go and look at this in the version history, but the date of the last permanent file is updated as my current file opening date.
This is not something that happens in every file, but it becomes annoying because I cannot predict when it will happen or not.
Has anyone ever encountered a similar situation and found a solution?
Thank you in advance for your reply.
I am using OneDrive on Windows 11. I manage all my files with OneDrive. I manage the documents with the Windows Explorer file structure on my computer by creating a shortcut via MS Teams or SharePoint.OneDrive is always in sync mode on my computer. It updates automatically whenever I make changes to any file. But the important detail is “when I update” :)I have a problem with OneDrive for a while. I don’t know if this is due to OneDrive.When I open any file, the file is somehow automatically saved and synced to OneDrive, even if I don’t make any changes to the file. Unfortunately, this way I miss the previous modification date of the file etc.Of course, I can go and look at this in the version history, but the date of the last permanent file is updated as my current file opening date.This is not something that happens in every file, but it becomes annoying because I cannot predict when it will happen or not.Has anyone ever encountered a similar situation and found a solution?Thank you in advance for your reply. Read More
Why FQDN resolution gets affected when Network Protection is in disabled state.
Why FQDN resolution gets affected when Network Protection is in disabled state?
Is it forcing user to use Network Protection?
Isn’t disable state for not interfering with Network?
Why FQDN resolution gets affected when Network Protection is in disabled state?Is it forcing user to use Network Protection?Isn’t disable state for not interfering with Network? Read More
Loop through Excel files and compare files not working
I have a process that exports two sets of identical Excel files – a first set where users can edit data and a second reference set that enables file compare to identify updates made in the first set. Each file has only one sheet and the file name is the sheet name plus extension.
I need a macro to loop through both sets of files and highlight the updates in the first (edited) set, but I cannot get the loop through the set of edited files to work. I have tried both While Wend and For Each Next. My code runs, but does nothing.
Help to identify my error greatly appreciated!
Sub Compare_Spreadsheets_While_Wend3()
Dim editPath, refPath, filename, refFname As String
Dim editwbk, refwbk As Workbook
Dim editws, refws As Worksheet
Dim wbk, FileSystem, Folder, editFile, refFile, FSO, editFolder As Object
editPath = “C:pathSet_1”
refPath = “C:pathSet_2”
‘Loop through files in reference folder
refFile = refPath & “*.xls*”
While refFile <> “”
refFname = ActiveWorkbook.Name
Set FileSystem = CreateObject(“Scripting.FileSystemObject”)
Set editFolder = FileSystem.GetFolder(editPath)
For Each editFile In editFolder.Files
filename = editFile.Name
‘Problem here
If editFile.Name = refFname Then
Set editwbk = Workbooks.Open(editPath & “” & filename)
For Each editws In editwbk.Worksheets
If editws.Name = refws.Name Then
For Each cell In editws.Range(“A1”).CurrentRegion
If cell.Value <> refws.Range(cell.Address).Value Then
cell.Interior.Color = vbYellow
MsgBox “Changed value in ” & cell.Address & ” in sheet ” & editws.Name
End If
Next cell
Exit For
End If
Next editws
Exit For
editwbk.Close SaveChanges:=True
End If
Next editFile
Wend
End Sub
I have a process that exports two sets of identical Excel files – a first set where users can edit data and a second reference set that enables file compare to identify updates made in the first set. Each file has only one sheet and the file name is the sheet name plus extension.I need a macro to loop through both sets of files and highlight the updates in the first (edited) set, but I cannot get the loop through the set of edited files to work. I have tried both While Wend and For Each Next. My code runs, but does nothing.Help to identify my error greatly appreciated!Sub Compare_Spreadsheets_While_Wend3()
Dim editPath, refPath, filename, refFname As String
Dim editwbk, refwbk As Workbook
Dim editws, refws As Worksheet
Dim wbk, FileSystem, Folder, editFile, refFile, FSO, editFolder As Object
editPath = “C:pathSet_1”
refPath = “C:pathSet_2”
‘Loop through files in reference folder
refFile = refPath & “*.xls*”
While refFile <> “”
refFname = ActiveWorkbook.Name
Set FileSystem = CreateObject(“Scripting.FileSystemObject”)
Set editFolder = FileSystem.GetFolder(editPath)
For Each editFile In editFolder.Files
filename = editFile.Name
‘Problem here
If editFile.Name = refFname Then
Set editwbk = Workbooks.Open(editPath & “” & filename)
For Each editws In editwbk.Worksheets
If editws.Name = refws.Name Then
For Each cell In editws.Range(“A1”).CurrentRegion
If cell.Value <> refws.Range(cell.Address).Value Then
cell.Interior.Color = vbYellow
MsgBox “Changed value in ” & cell.Address & ” in sheet ” & editws.Name
End If
Next cell
Exit For
End If
Next editws
Exit For
editwbk.Close SaveChanges:=True
End If
Next editFile
Wend
End Sub Read More
Unexpected matlab operator when using Matlab Coder
I use Matlab Coder to generate mex file, but in the middle of process I got error message "Unexpected MATLAB operator" that is indicate ":" in my code
if (abs(permlist(jj,:)-iv))==0
c(jj) = c(jj) + 1 ;
%end
end
Does anyone know how to solve it?I use Matlab Coder to generate mex file, but in the middle of process I got error message "Unexpected MATLAB operator" that is indicate ":" in my code
if (abs(permlist(jj,:)-iv))==0
c(jj) = c(jj) + 1 ;
%end
end
Does anyone know how to solve it? I use Matlab Coder to generate mex file, but in the middle of process I got error message "Unexpected MATLAB operator" that is indicate ":" in my code
if (abs(permlist(jj,:)-iv))==0
c(jj) = c(jj) + 1 ;
%end
end
Does anyone know how to solve it? matlab coder, colon MATLAB Answers — New Questions
the matrix addition should come 0 but it is not happening
i am adding a matrix in for loop
Dtb=zeros(3,3);
Dtrb=Dtb;
Drrb=Dtb;
Dts=zeros(2,2);
for N=1:nlayer
h1=-h/2+(N-1)*th;
h2=h1+th;
ah1=h2-h1;
bh1=(h2^2-h1^2)/2;
ch1=(h2^3-h1^3)/3;
% ———–
if(N <= nlayer/2 || N == 1)
theta=(1+(-1)^N)*pi/4;
else
theta = -1*(-1+(-1)^N)*pi/4;
end
% ————–
theta = rad2deg( theta );
t1=(cosd(theta))^4;
t2=(sind(theta))^4;
t3=(sind(theta)*cosd(theta))^2;
t4=sind(theta)*(cosd(theta))^3;
t5=cosd(theta)*(sind(theta))^3;
%**********************************************************
c111=c11*t1 + 2*(c12+2*c66)*t3 + c22*t2;
c121=(c11 + c22 – 4*c66)*t3 + c12*(t1+t2);
c221=c11*t2 + 2*(c12+2*c66)*t3 + c22*t1;
c161=(c11-c12-2*c66)*t4 + (c12-c22+2*c66)*t5;
c261=(c11-c12-2*c66)*t5 + (c12-c22+2*c66)*t4;
c661=(c11+c22-2*c12-2*c66)*t3 + c66*(t1+t2);
c441=c44*(cos(theta))^2 + c55*(sin(theta))^2;
c451=(c55-c44)*cos(theta)*sin(theta);
c551=c55*(cos(theta))^2 + c44*(sin(theta))^2;
Cb=[c111 c121 c161; c121 c221 c261; c161 c261 c661];
Cs=[c551 c451;c451 c441];
Dtrb = Dtrb + bh1*Cb;
end
but the resulting Dtrb atrix is not coming 0,
as you can see from fig: matrix for iteration 10 is bh1*Cb matrix which is added to Dtrb matrix and in figure both are same but opp in sign so if we add it should come 0 but as you can see in fig the result is not 0 but it is something * e-11 comingi am adding a matrix in for loop
Dtb=zeros(3,3);
Dtrb=Dtb;
Drrb=Dtb;
Dts=zeros(2,2);
for N=1:nlayer
h1=-h/2+(N-1)*th;
h2=h1+th;
ah1=h2-h1;
bh1=(h2^2-h1^2)/2;
ch1=(h2^3-h1^3)/3;
% ———–
if(N <= nlayer/2 || N == 1)
theta=(1+(-1)^N)*pi/4;
else
theta = -1*(-1+(-1)^N)*pi/4;
end
% ————–
theta = rad2deg( theta );
t1=(cosd(theta))^4;
t2=(sind(theta))^4;
t3=(sind(theta)*cosd(theta))^2;
t4=sind(theta)*(cosd(theta))^3;
t5=cosd(theta)*(sind(theta))^3;
%**********************************************************
c111=c11*t1 + 2*(c12+2*c66)*t3 + c22*t2;
c121=(c11 + c22 – 4*c66)*t3 + c12*(t1+t2);
c221=c11*t2 + 2*(c12+2*c66)*t3 + c22*t1;
c161=(c11-c12-2*c66)*t4 + (c12-c22+2*c66)*t5;
c261=(c11-c12-2*c66)*t5 + (c12-c22+2*c66)*t4;
c661=(c11+c22-2*c12-2*c66)*t3 + c66*(t1+t2);
c441=c44*(cos(theta))^2 + c55*(sin(theta))^2;
c451=(c55-c44)*cos(theta)*sin(theta);
c551=c55*(cos(theta))^2 + c44*(sin(theta))^2;
Cb=[c111 c121 c161; c121 c221 c261; c161 c261 c661];
Cs=[c551 c451;c451 c441];
Dtrb = Dtrb + bh1*Cb;
end
but the resulting Dtrb atrix is not coming 0,
as you can see from fig: matrix for iteration 10 is bh1*Cb matrix which is added to Dtrb matrix and in figure both are same but opp in sign so if we add it should come 0 but as you can see in fig the result is not 0 but it is something * e-11 coming i am adding a matrix in for loop
Dtb=zeros(3,3);
Dtrb=Dtb;
Drrb=Dtb;
Dts=zeros(2,2);
for N=1:nlayer
h1=-h/2+(N-1)*th;
h2=h1+th;
ah1=h2-h1;
bh1=(h2^2-h1^2)/2;
ch1=(h2^3-h1^3)/3;
% ———–
if(N <= nlayer/2 || N == 1)
theta=(1+(-1)^N)*pi/4;
else
theta = -1*(-1+(-1)^N)*pi/4;
end
% ————–
theta = rad2deg( theta );
t1=(cosd(theta))^4;
t2=(sind(theta))^4;
t3=(sind(theta)*cosd(theta))^2;
t4=sind(theta)*(cosd(theta))^3;
t5=cosd(theta)*(sind(theta))^3;
%**********************************************************
c111=c11*t1 + 2*(c12+2*c66)*t3 + c22*t2;
c121=(c11 + c22 – 4*c66)*t3 + c12*(t1+t2);
c221=c11*t2 + 2*(c12+2*c66)*t3 + c22*t1;
c161=(c11-c12-2*c66)*t4 + (c12-c22+2*c66)*t5;
c261=(c11-c12-2*c66)*t5 + (c12-c22+2*c66)*t4;
c661=(c11+c22-2*c12-2*c66)*t3 + c66*(t1+t2);
c441=c44*(cos(theta))^2 + c55*(sin(theta))^2;
c451=(c55-c44)*cos(theta)*sin(theta);
c551=c55*(cos(theta))^2 + c44*(sin(theta))^2;
Cb=[c111 c121 c161; c121 c221 c261; c161 c261 c661];
Cs=[c551 c451;c451 c441];
Dtrb = Dtrb + bh1*Cb;
end
but the resulting Dtrb atrix is not coming 0,
as you can see from fig: matrix for iteration 10 is bh1*Cb matrix which is added to Dtrb matrix and in figure both are same but opp in sign so if we add it should come 0 but as you can see in fig the result is not 0 but it is something * e-11 coming matrix addition bug MATLAB Answers — New Questions
Why the drone is drifting in HIL?
I am running the
PX4 Autopilot in Hardware-in-the-Loop (HITL) Simulation with UAV Dynamics in Simulink
example,after the set-ups, I run the UAV_Dynamics_Autopilot_Communication model, the flying which should follow the waypoint is not act as I expected in QGC:
there are some warnings on the top and the drone was drifting after following the trajectory.
and a module called 6DOF Rigid body dynamics is in red:
except this two wierd things happen, everthing were fine. No Warning information from Simulink.
I am not sure the fact that 6DOF Rigid body dynamics is red is relative to the drifting, but they show up together makes me curious.
How can I fix the drifting? Why the module is in red?
Thanks for your answer.I am running the
PX4 Autopilot in Hardware-in-the-Loop (HITL) Simulation with UAV Dynamics in Simulink
example,after the set-ups, I run the UAV_Dynamics_Autopilot_Communication model, the flying which should follow the waypoint is not act as I expected in QGC:
there are some warnings on the top and the drone was drifting after following the trajectory.
and a module called 6DOF Rigid body dynamics is in red:
except this two wierd things happen, everthing were fine. No Warning information from Simulink.
I am not sure the fact that 6DOF Rigid body dynamics is red is relative to the drifting, but they show up together makes me curious.
How can I fix the drifting? Why the module is in red?
Thanks for your answer. I am running the
PX4 Autopilot in Hardware-in-the-Loop (HITL) Simulation with UAV Dynamics in Simulink
example,after the set-ups, I run the UAV_Dynamics_Autopilot_Communication model, the flying which should follow the waypoint is not act as I expected in QGC:
there are some warnings on the top and the drone was drifting after following the trajectory.
and a module called 6DOF Rigid body dynamics is in red:
except this two wierd things happen, everthing were fine. No Warning information from Simulink.
I am not sure the fact that 6DOF Rigid body dynamics is red is relative to the drifting, but they show up together makes me curious.
How can I fix the drifting? Why the module is in red?
Thanks for your answer. hil, qgc, simulink MATLAB Answers — New Questions