Category: News
Setting bounds for constants in a fit() object in terms of other constants in the fit object
Hello, I am currently trying to fit experimental data that I theorize fits a logarithmic function.
To this end, I am using the fit() and fitoptions() function in order to create a logarithmic equation.
Since the default MATLAB logarithmic fit model does not seem to account for horizontal translation and scaling, I have created a custom fit type as seen below:
shiftedLog = fittype(‘A*log((B*x)-C) + D’, ‘independent’, ‘x’, ‘coefficients’, {‘A’,’B’,’C’,’D’});
% set the bounds
opts.StartPoint = […]; % Initial guesses for [A, B, C, D]
opts.Lower = […]; % Lower bounds for [A, B, C, D]
opts.Upper = […]; % Upper bounds for [A, B, C, D]
I have noticed that when I try to run this program, I have ran into errors where the fit object returns either infinity or a complex value.
Since the log() function is defined only when its inner argument > 0, I need to specify the bounds for variables B and C to keep the entire argument positive.
However, When I try to specify the bounds in terms of the constants of the fit object, for example:
opts.Lower = [-Inf, C/min(x),…]
MATLAB gives me an error.
I know that in the main script code, the constants A, B, C, and D are not standalone variables so the main script has this issue, but as (to my knowledge) fit() finds the best values for the constants through an iterative process. Given this, It is impractical to specify a hard-coded value for the limits.
How should I approach this problem? Is there another way to find fit of a logarithmic function that incorporates ‘shifting’ and ‘stretching’ in both horizontal and vertical directions? Or is there a workaround? Thank you in advance.Hello, I am currently trying to fit experimental data that I theorize fits a logarithmic function.
To this end, I am using the fit() and fitoptions() function in order to create a logarithmic equation.
Since the default MATLAB logarithmic fit model does not seem to account for horizontal translation and scaling, I have created a custom fit type as seen below:
shiftedLog = fittype(‘A*log((B*x)-C) + D’, ‘independent’, ‘x’, ‘coefficients’, {‘A’,’B’,’C’,’D’});
% set the bounds
opts.StartPoint = […]; % Initial guesses for [A, B, C, D]
opts.Lower = […]; % Lower bounds for [A, B, C, D]
opts.Upper = […]; % Upper bounds for [A, B, C, D]
I have noticed that when I try to run this program, I have ran into errors where the fit object returns either infinity or a complex value.
Since the log() function is defined only when its inner argument > 0, I need to specify the bounds for variables B and C to keep the entire argument positive.
However, When I try to specify the bounds in terms of the constants of the fit object, for example:
opts.Lower = [-Inf, C/min(x),…]
MATLAB gives me an error.
I know that in the main script code, the constants A, B, C, and D are not standalone variables so the main script has this issue, but as (to my knowledge) fit() finds the best values for the constants through an iterative process. Given this, It is impractical to specify a hard-coded value for the limits.
How should I approach this problem? Is there another way to find fit of a logarithmic function that incorporates ‘shifting’ and ‘stretching’ in both horizontal and vertical directions? Or is there a workaround? Thank you in advance. Hello, I am currently trying to fit experimental data that I theorize fits a logarithmic function.
To this end, I am using the fit() and fitoptions() function in order to create a logarithmic equation.
Since the default MATLAB logarithmic fit model does not seem to account for horizontal translation and scaling, I have created a custom fit type as seen below:
shiftedLog = fittype(‘A*log((B*x)-C) + D’, ‘independent’, ‘x’, ‘coefficients’, {‘A’,’B’,’C’,’D’});
% set the bounds
opts.StartPoint = […]; % Initial guesses for [A, B, C, D]
opts.Lower = […]; % Lower bounds for [A, B, C, D]
opts.Upper = […]; % Upper bounds for [A, B, C, D]
I have noticed that when I try to run this program, I have ran into errors where the fit object returns either infinity or a complex value.
Since the log() function is defined only when its inner argument > 0, I need to specify the bounds for variables B and C to keep the entire argument positive.
However, When I try to specify the bounds in terms of the constants of the fit object, for example:
opts.Lower = [-Inf, C/min(x),…]
MATLAB gives me an error.
I know that in the main script code, the constants A, B, C, and D are not standalone variables so the main script has this issue, but as (to my knowledge) fit() finds the best values for the constants through an iterative process. Given this, It is impractical to specify a hard-coded value for the limits.
How should I approach this problem? Is there another way to find fit of a logarithmic function that incorporates ‘shifting’ and ‘stretching’ in both horizontal and vertical directions? Or is there a workaround? Thank you in advance. curve fitting, function MATLAB Answers — New Questions
coefficients checked asking for him
I would like to check the coefficients of a quadratic equation as a real number. I would like to establish a vector for an equation ax^2+bx+c–> [a b c] . in case of the variable if you are a character writes zero let the felhaszáló ask for the number again with an error message.How I may make this?I would like to check the coefficients of a quadratic equation as a real number. I would like to establish a vector for an equation ax^2+bx+c–> [a b c] . in case of the variable if you are a character writes zero let the felhaszáló ask for the number again with an error message.How I may make this? I would like to check the coefficients of a quadratic equation as a real number. I would like to establish a vector for an equation ax^2+bx+c–> [a b c] . in case of the variable if you are a character writes zero let the felhaszáló ask for the number again with an error message.How I may make this? basic matlab MATLAB Answers — New Questions
How do I pass a dynamic number of output variables to a function?
Some functions change their behavior dependending on the number of output variables. For example, ndgrid will create N N-Dimensional arrays where N is the number of output variables. I need to pass a number of output variables that depends on other variable (whose value is not previously known). Is it possible to do that? What is the best way to do that?Some functions change their behavior dependending on the number of output variables. For example, ndgrid will create N N-Dimensional arrays where N is the number of output variables. I need to pass a number of output variables that depends on other variable (whose value is not previously known). Is it possible to do that? What is the best way to do that? Some functions change their behavior dependending on the number of output variables. For example, ndgrid will create N N-Dimensional arrays where N is the number of output variables. I need to pass a number of output variables that depends on other variable (whose value is not previously known). Is it possible to do that? What is the best way to do that? output, function MATLAB Answers — New Questions
How to make the font sizes of Xlabel, Ylabel, and Title different in a heat map using MATLAB?
I have used the heatmap function in MATLAB to draw a figure. However, the font sizes of Xlabel, Ylabel, and Ttile are same. How to make the font sizes of Xlabel, Ylabel, and Title different in a heat map?I have used the heatmap function in MATLAB to draw a figure. However, the font sizes of Xlabel, Ylabel, and Ttile are same. How to make the font sizes of Xlabel, Ylabel, and Title different in a heat map? I have used the heatmap function in MATLAB to draw a figure. However, the font sizes of Xlabel, Ylabel, and Ttile are same. How to make the font sizes of Xlabel, Ylabel, and Title different in a heat map? heatmap, fontsize MATLAB Answers — New Questions
Ability to tag people within planner
I’ve noticed discussions asking for this feature dating back years, but I haven’t seen any responses from Microsoft. It seems a basic feature for any project management tool. Tagging and/or assigning checklist items (or having subtasks), and the ability to tag in the comments, are such basic features of any PM tool. Planner is an interactive to-do list, it’s not useful for PM. @microsoft
I’ve noticed discussions asking for this feature dating back years, but I haven’t seen any responses from Microsoft. It seems a basic feature for any project management tool. Tagging and/or assigning checklist items (or having subtasks), and the ability to tag in the comments, are such basic features of any PM tool. Planner is an interactive to-do list, it’s not useful for PM. @microsoft Read More
How to do skull stripping when the skull in the image is not complete?
How do I remove the skull (as well as others tissues that are not tumor, but have similar intensity) from the MRI images? I have seen methods including removing the largest blob (the skull), but the skull does not enclose the brain fully in the picture I attached here. Using imbinarize will also keep other tissues which have similar intensity as the tumor in the image.
I have tried to use imerode, but the skull is not removed entirely.
Any help is appreciated. Thanks!How do I remove the skull (as well as others tissues that are not tumor, but have similar intensity) from the MRI images? I have seen methods including removing the largest blob (the skull), but the skull does not enclose the brain fully in the picture I attached here. Using imbinarize will also keep other tissues which have similar intensity as the tumor in the image.
I have tried to use imerode, but the skull is not removed entirely.
Any help is appreciated. Thanks! How do I remove the skull (as well as others tissues that are not tumor, but have similar intensity) from the MRI images? I have seen methods including removing the largest blob (the skull), but the skull does not enclose the brain fully in the picture I attached here. Using imbinarize will also keep other tissues which have similar intensity as the tumor in the image.
I have tried to use imerode, but the skull is not removed entirely.
Any help is appreciated. Thanks! brain tumor, image processing MATLAB Answers — New Questions
Create Variable in Simulink block that contains 63 elements.
I have 63 Sine blocks that will have different amplitude values. The values will be set from Matlab workspace. I would like to loop through the data and set the amplitudes values programmatically. However, I only know how to create a constant from the Create Variable option in the Simulink Sine block. How to I create a variable that has 63 elements so I can loop throught my data and assign the data correctly?I have 63 Sine blocks that will have different amplitude values. The values will be set from Matlab workspace. I would like to loop through the data and set the amplitudes values programmatically. However, I only know how to create a constant from the Create Variable option in the Simulink Sine block. How to I create a variable that has 63 elements so I can loop throught my data and assign the data correctly? I have 63 Sine blocks that will have different amplitude values. The values will be set from Matlab workspace. I would like to loop through the data and set the amplitudes values programmatically. However, I only know how to create a constant from the Create Variable option in the Simulink Sine block. How to I create a variable that has 63 elements so I can loop throught my data and assign the data correctly? create variable in simulink MATLAB Answers — New Questions
Can’t click “Roll The Dice!” problem in intro to matlab cody problems therefor cannot earn badge.
I am trying to earn my badge in intro to matlab in the Cody problems. I completed all the problems besides Roll The Dice! which is restraining me from earning the badge. It is simply not letting me click the problem.I am trying to earn my badge in intro to matlab in the Cody problems. I completed all the problems besides Roll The Dice! which is restraining me from earning the badge. It is simply not letting me click the problem. I am trying to earn my badge in intro to matlab in the Cody problems. I completed all the problems besides Roll The Dice! which is restraining me from earning the badge. It is simply not letting me click the problem. dice cody MATLAB Answers — New Questions
Applying logic to Curve Fitter Output
I am trying to use Curve Fitter and generating the code to help teach myself how to process my data without Curve Fitter.
Is there a way to apply a logic that a certain data point should be lower/higher than another certain data point, and have the coefficients adjust accordingly?
%CREATEFIT(TWOSOUSANDTQSPK,TWOSOUSANDTQAPC,TWOSOUSANDTQNM)
% Create a fit.
%
% Data for ‘2000 copy 1’ fit:
% X Input: twosousandTQSPK
% Y Input: twosousandTQAPC
% Z Output: twosousandTQnm
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT, CFIT, SFIT.
% Auto-generated by MATLAB on 18-Jul-2024 20:43:50
%% Fit: ‘2000 copy 1’.
[xData, yData, zData] = prepareSurfaceData( twosousandTQSPK, twosousandTQAPC, twosousandTQnm );
% Set up fittype and options.
ft = fittype( ‘A+(x*B)+(C*x*x)+(y*x*D)+(y*x*x*E)+(y*F)’, ‘independent’, {‘x’, ‘y’}, ‘dependent’, ‘z’ );
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.MaxFunEvals = 60000;
opts.MaxIter = 40000;
opts.StartPoint = [0.0526769976807926 0.737858095516997 0.269119426398556 0.422835615008808 0.547870901214845 0.942736984276934];
opts.TolFun = 0.1;
opts.TolX = 0.1;
% Fit model to data.
[fitresult, gof] = fit( [xData, yData], zData, ft, opts );
% Plot fit with data.
figure( ‘Name’, ‘2000 copy 1’ );
h = plot( fitresult, [xData, yData], zData );
legend( h, ‘2000 copy 1’, ‘twosousandTQnm vs. twosousandTQSPK, twosousandTQAPC’, ‘Location’, ‘NorthEast’, ‘Interpreter’, ‘none’ );
% Label axes
xlabel( ‘twosousandTQSPK’, ‘Interpreter’, ‘none’ );
ylabel( ‘twosousandTQAPC’, ‘Interpreter’, ‘none’ );
zlabel( ‘twosousandTQnm’, ‘Interpreter’, ‘none’ );
grid off
view( -2.9, 15.3 );
I am looking to apply that the output data should follow the ‘twosousandTQSPK’ axis relative. I reserached the weighting function, but I I don’t know how I could accurately match the data inputs I have to weight it.
This is an example of what I am expecting with a different set of variables, but the results above in question should resemble this outcome to some degree.
%CREATEFIT(SIXTEENTQSPK,SIXTEENTQAPC,SIXTEENTQNM)
% Create a fit.
%
% Data for ‘1600 copy 2’ fit:
% X Input: sixteenTQSPK
% Y Input: sixteenTQAPC
% Z Output: sixteenTQnm
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT, CFIT, SFIT.
% Auto-generated by MATLAB on 18-Jul-2024 20:55:15
%% Fit: ‘1600 copy 2’.
[xData, yData, zData] = prepareSurfaceData( sixteenTQSPK, sixteenTQAPC, sixteenTQnm );
% Set up fittype and options.
ft = fittype( ‘(y*A)+B+(x*C)+(D*x*x)+(y*x*E)+(y*x*x*F)’, ‘independent’, {‘x’, ‘y’}, ‘dependent’, ‘z’ );
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.MaxFunEvals = 60000;
opts.MaxIter = 40000;
opts.StartPoint = [0.0430238016578078 0.168990029462704 0.649115474956452 0.73172238565867 0.647745963136307 0.450923706430945];
opts.TolFun = 0.1;
opts.TolX = 0.1;
% Fit model to data.
[fitresult, gof] = fit( [xData, yData], zData, ft, opts );
% Plot fit with data.
figure( ‘Name’, ‘1600 copy 2’ );
h = plot( fitresult, [xData, yData], zData );
legend( h, ‘1600 copy 2’, ‘sixteenTQnm vs. sixteenTQSPK, sixteenTQAPC’, ‘Location’, ‘NorthEast’, ‘Interpreter’, ‘none’ );
% Label axes
xlabel( ‘sixteenTQSPK’, ‘Interpreter’, ‘none’ );
ylabel( ‘sixteenTQAPC’, ‘Interpreter’, ‘none’ );
zlabel( ‘sixteenTQnm’, ‘Interpreter’, ‘none’ );
grid off
view( -0.5, -13.0 );I am trying to use Curve Fitter and generating the code to help teach myself how to process my data without Curve Fitter.
Is there a way to apply a logic that a certain data point should be lower/higher than another certain data point, and have the coefficients adjust accordingly?
%CREATEFIT(TWOSOUSANDTQSPK,TWOSOUSANDTQAPC,TWOSOUSANDTQNM)
% Create a fit.
%
% Data for ‘2000 copy 1’ fit:
% X Input: twosousandTQSPK
% Y Input: twosousandTQAPC
% Z Output: twosousandTQnm
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT, CFIT, SFIT.
% Auto-generated by MATLAB on 18-Jul-2024 20:43:50
%% Fit: ‘2000 copy 1’.
[xData, yData, zData] = prepareSurfaceData( twosousandTQSPK, twosousandTQAPC, twosousandTQnm );
% Set up fittype and options.
ft = fittype( ‘A+(x*B)+(C*x*x)+(y*x*D)+(y*x*x*E)+(y*F)’, ‘independent’, {‘x’, ‘y’}, ‘dependent’, ‘z’ );
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.MaxFunEvals = 60000;
opts.MaxIter = 40000;
opts.StartPoint = [0.0526769976807926 0.737858095516997 0.269119426398556 0.422835615008808 0.547870901214845 0.942736984276934];
opts.TolFun = 0.1;
opts.TolX = 0.1;
% Fit model to data.
[fitresult, gof] = fit( [xData, yData], zData, ft, opts );
% Plot fit with data.
figure( ‘Name’, ‘2000 copy 1’ );
h = plot( fitresult, [xData, yData], zData );
legend( h, ‘2000 copy 1’, ‘twosousandTQnm vs. twosousandTQSPK, twosousandTQAPC’, ‘Location’, ‘NorthEast’, ‘Interpreter’, ‘none’ );
% Label axes
xlabel( ‘twosousandTQSPK’, ‘Interpreter’, ‘none’ );
ylabel( ‘twosousandTQAPC’, ‘Interpreter’, ‘none’ );
zlabel( ‘twosousandTQnm’, ‘Interpreter’, ‘none’ );
grid off
view( -2.9, 15.3 );
I am looking to apply that the output data should follow the ‘twosousandTQSPK’ axis relative. I reserached the weighting function, but I I don’t know how I could accurately match the data inputs I have to weight it.
This is an example of what I am expecting with a different set of variables, but the results above in question should resemble this outcome to some degree.
%CREATEFIT(SIXTEENTQSPK,SIXTEENTQAPC,SIXTEENTQNM)
% Create a fit.
%
% Data for ‘1600 copy 2’ fit:
% X Input: sixteenTQSPK
% Y Input: sixteenTQAPC
% Z Output: sixteenTQnm
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT, CFIT, SFIT.
% Auto-generated by MATLAB on 18-Jul-2024 20:55:15
%% Fit: ‘1600 copy 2’.
[xData, yData, zData] = prepareSurfaceData( sixteenTQSPK, sixteenTQAPC, sixteenTQnm );
% Set up fittype and options.
ft = fittype( ‘(y*A)+B+(x*C)+(D*x*x)+(y*x*E)+(y*x*x*F)’, ‘independent’, {‘x’, ‘y’}, ‘dependent’, ‘z’ );
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.MaxFunEvals = 60000;
opts.MaxIter = 40000;
opts.StartPoint = [0.0430238016578078 0.168990029462704 0.649115474956452 0.73172238565867 0.647745963136307 0.450923706430945];
opts.TolFun = 0.1;
opts.TolX = 0.1;
% Fit model to data.
[fitresult, gof] = fit( [xData, yData], zData, ft, opts );
% Plot fit with data.
figure( ‘Name’, ‘1600 copy 2’ );
h = plot( fitresult, [xData, yData], zData );
legend( h, ‘1600 copy 2’, ‘sixteenTQnm vs. sixteenTQSPK, sixteenTQAPC’, ‘Location’, ‘NorthEast’, ‘Interpreter’, ‘none’ );
% Label axes
xlabel( ‘sixteenTQSPK’, ‘Interpreter’, ‘none’ );
ylabel( ‘sixteenTQAPC’, ‘Interpreter’, ‘none’ );
zlabel( ‘sixteenTQnm’, ‘Interpreter’, ‘none’ );
grid off
view( -0.5, -13.0 ); I am trying to use Curve Fitter and generating the code to help teach myself how to process my data without Curve Fitter.
Is there a way to apply a logic that a certain data point should be lower/higher than another certain data point, and have the coefficients adjust accordingly?
%CREATEFIT(TWOSOUSANDTQSPK,TWOSOUSANDTQAPC,TWOSOUSANDTQNM)
% Create a fit.
%
% Data for ‘2000 copy 1’ fit:
% X Input: twosousandTQSPK
% Y Input: twosousandTQAPC
% Z Output: twosousandTQnm
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT, CFIT, SFIT.
% Auto-generated by MATLAB on 18-Jul-2024 20:43:50
%% Fit: ‘2000 copy 1’.
[xData, yData, zData] = prepareSurfaceData( twosousandTQSPK, twosousandTQAPC, twosousandTQnm );
% Set up fittype and options.
ft = fittype( ‘A+(x*B)+(C*x*x)+(y*x*D)+(y*x*x*E)+(y*F)’, ‘independent’, {‘x’, ‘y’}, ‘dependent’, ‘z’ );
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.MaxFunEvals = 60000;
opts.MaxIter = 40000;
opts.StartPoint = [0.0526769976807926 0.737858095516997 0.269119426398556 0.422835615008808 0.547870901214845 0.942736984276934];
opts.TolFun = 0.1;
opts.TolX = 0.1;
% Fit model to data.
[fitresult, gof] = fit( [xData, yData], zData, ft, opts );
% Plot fit with data.
figure( ‘Name’, ‘2000 copy 1’ );
h = plot( fitresult, [xData, yData], zData );
legend( h, ‘2000 copy 1’, ‘twosousandTQnm vs. twosousandTQSPK, twosousandTQAPC’, ‘Location’, ‘NorthEast’, ‘Interpreter’, ‘none’ );
% Label axes
xlabel( ‘twosousandTQSPK’, ‘Interpreter’, ‘none’ );
ylabel( ‘twosousandTQAPC’, ‘Interpreter’, ‘none’ );
zlabel( ‘twosousandTQnm’, ‘Interpreter’, ‘none’ );
grid off
view( -2.9, 15.3 );
I am looking to apply that the output data should follow the ‘twosousandTQSPK’ axis relative. I reserached the weighting function, but I I don’t know how I could accurately match the data inputs I have to weight it.
This is an example of what I am expecting with a different set of variables, but the results above in question should resemble this outcome to some degree.
%CREATEFIT(SIXTEENTQSPK,SIXTEENTQAPC,SIXTEENTQNM)
% Create a fit.
%
% Data for ‘1600 copy 2’ fit:
% X Input: sixteenTQSPK
% Y Input: sixteenTQAPC
% Z Output: sixteenTQnm
% Output:
% fitresult : a fit object representing the fit.
% gof : structure with goodness-of fit info.
%
% See also FIT, CFIT, SFIT.
% Auto-generated by MATLAB on 18-Jul-2024 20:55:15
%% Fit: ‘1600 copy 2’.
[xData, yData, zData] = prepareSurfaceData( sixteenTQSPK, sixteenTQAPC, sixteenTQnm );
% Set up fittype and options.
ft = fittype( ‘(y*A)+B+(x*C)+(D*x*x)+(y*x*E)+(y*x*x*F)’, ‘independent’, {‘x’, ‘y’}, ‘dependent’, ‘z’ );
opts = fitoptions( ‘Method’, ‘NonlinearLeastSquares’ );
opts.Display = ‘Off’;
opts.MaxFunEvals = 60000;
opts.MaxIter = 40000;
opts.StartPoint = [0.0430238016578078 0.168990029462704 0.649115474956452 0.73172238565867 0.647745963136307 0.450923706430945];
opts.TolFun = 0.1;
opts.TolX = 0.1;
% Fit model to data.
[fitresult, gof] = fit( [xData, yData], zData, ft, opts );
% Plot fit with data.
figure( ‘Name’, ‘1600 copy 2’ );
h = plot( fitresult, [xData, yData], zData );
legend( h, ‘1600 copy 2’, ‘sixteenTQnm vs. sixteenTQSPK, sixteenTQAPC’, ‘Location’, ‘NorthEast’, ‘Interpreter’, ‘none’ );
% Label axes
xlabel( ‘sixteenTQSPK’, ‘Interpreter’, ‘none’ );
ylabel( ‘sixteenTQAPC’, ‘Interpreter’, ‘none’ );
zlabel( ‘sixteenTQnm’, ‘Interpreter’, ‘none’ );
grid off
view( -0.5, -13.0 ); curve fitting, curve fitter, boudaries, weighting MATLAB Answers — New Questions
ONEDRIVE NOT WORKING
Is onedrive down right now? im from the Philippines
Is onedrive down right now? im from the Philippines Read More
Support – Forms, Excel & Power Automate
Hi, I’d love your help!!
I have created a uniform request form in 365 Forms. I would like to also create an inventory spreadsheet for our uniforms and have this connect with the uniform request form and an approval system.
The ideal outcome is:
> The uniform request form will start an approval process – notifying admin
> The inventory spreadsheet will need to be reviewed to check for quantities of the requested item in the size requested (multiple items may be requested by the employee at a time).
> Then an approval or declined notification will need to be sent to the employee and to admin
> The approved items will need to be stored in a spreadsheet keeping track of which employee has ordered what items and sizes.
> There will need to be then another flow where admin finalises the approval and notifies the direct manager and employee that the uniforms are ready to be collected. The employee will need to submit a notification that the items have been received which will be stored in the spreadsheet tracker by date.
>with the inventory spreadsheet, I would like admin to get notification when quantities hit a specific number and are needing to be re-stocked. Eventually, automating the ordering process direct to the manufacturer.
Hi, I’d love your help!! I have created a uniform request form in 365 Forms. I would like to also create an inventory spreadsheet for our uniforms and have this connect with the uniform request form and an approval system. The ideal outcome is:> The uniform request form will start an approval process – notifying admin > The inventory spreadsheet will need to be reviewed to check for quantities of the requested item in the size requested (multiple items may be requested by the employee at a time). > Then an approval or declined notification will need to be sent to the employee and to admin> The approved items will need to be stored in a spreadsheet keeping track of which employee has ordered what items and sizes. > There will need to be then another flow where admin finalises the approval and notifies the direct manager and employee that the uniforms are ready to be collected. The employee will need to submit a notification that the items have been received which will be stored in the spreadsheet tracker by date. >with the inventory spreadsheet, I would like admin to get notification when quantities hit a specific number and are needing to be re-stocked. Eventually, automating the ordering process direct to the manufacturer. Read More
Learn Live Series – Crie uma LOB com OpenAI, Azure Communication Services e MS Graph (Parte II)
No último dia 29 de maio de 2024, dei continuidade ao workshop sobre a criação de uma aplicação Line of Business com OpenAI, Azure Communication Service e Microsoft Graph Toolkit. Foi uma sessão repleta de insights e também demos o starter para ‘forkar’ e dar um starter nesse projeto para fazer o teste dele!
Aqui vamos ao resumo do que foi feito na sessão!
Continuação do Workshop LOB com OpenAI, Azure Communication Service e Microsoft Graph Toolkit
Antes de mais nada, se você não assistiu a primeira parte do workshop, recomendo que você assista para entender melhor o que foi feito. Você pode acessar a primeira parte do workshop AQUI
E, se você quiser assistir a segunda parte do workshop, você pode assistir abaixo:
E, se você quiser assistir a segunda parte do workshop, você pode acessar o vídeo abaixo:
Nesta segunda parte do workshop, focamos em instalar e configurar o projeto para que ele funcione corretamente. Para isso, fizemos o fork da aplicação que pode ser encontrada no repositório do GitHub – AQUI
Dentro desse repositório há inúmeros outros projetos. O projeto que foi feito durante a live é justamente o projeto:
MicrosoftCloud/samples/openai-acs-msgraph
O enfoque do projeto em questão é uma ferramenta de gerenciamento de clientes que permite administrar dados e interagir com clientes de forma mais eficiente com ajuda da inteligência artificial.
Durante a live, retomamos a partir da seção de configuração e implantação de serviços do OpenAI, fazendo uso do Azure OpenAI Service para integrar modelos de IA ao projeto.
Nessa parte, por mais que você não tenha a subscrição do Azure, você pode criar uma conta gratuita para ter acesso a camada free desse serviço. Ou se preferir, você pode utilizar o serviço de OpenAI para testar o projeto.
Exploramos como criar e configurar serviços no Azure, implantar modelos de IA e integrá-los ao nosso projeto. Adicionalmente, discutimos a importância de configurar corretamente as variáveis de ambiente e garantir que todos os serviços necessários estejam funcionando.
Etapas Desenvolvidas
Criação de um Serviço OpenAI no Azure: Iniciamos criando um serviço OpenAI no Azure, escolhendo a região apropriada e configurando as opções de preços.
Implantação do Modelo: Utilizamos o Azure OpenAI Studio para implantar um modelo GPT-3.5 Turbo, configurando-o para uso em nosso aplicativo.
Configuração das Variáveis de Ambiente: Atualizamos o arquivo .env com as chaves e endpoints necessários para a comunicação com o serviço OpenAI.
Lembrando que o tutorial pode ser encontrado AQUI
Funcionalidades Implementadas durante a Live
Configuração do Projeto: Ajustamos o projeto para garantir que todas as dependências e serviços necessários fossem configurados corretamente. Fazendo assim a instalação de todas as dependências necessárias para o projeto. Tanto nas pastas: client e server.
Implantação do Banco de Dados: Configuramos um banco de dados PostgreSQL usando Docker Compose, garantindo a conectividade e inicialização adequadas. Lembrando que, se você for um usuário Windows, recomendamos o uso do WSL2 para rodar o Docker.
Integração com OpenAI: Demonstramos como integrar o serviço OpenAI com nosso aplicativo, incluindo a configuração de endpoints e variáveis de ambiente.
Logo após isso, executamos o comando docker-compose up para iniciar o banco de dados e garantir que ele estivesse acessível para o projeto.
O que é Azure Communication Services?
Azure Communication Services é um serviço que permite adicionar funcionalidades de comunicação, como chat, voz e vídeo, diretamente em aplicativos. A intenção desse workshop é mostrar as infinitas possibilidades que você pode fazer com esse serviço integrado com o OpenAI e Microsoft Graph Toolkit.
Uso do OpenAI
O OpenAI foi destacado como uma ferramenta revolucionária para implementar inteligência artificial em aplicativos, facilitando a criação de funcionalidades complexas sem a necessidade de escrever código manualmente. Exemplos práticos incluíram a geração de conteúdo de e-mail e conversão de linguagem natural em SQL.
Por exemplo, no gif abaixo, fizemos uma simples consulta no banco fazendo uso de um prompt. A qual o OpenAI nos retornou a query SQL para fazer a consulta no banco de dados.
Isso é de explodir a cabeça, não é mesmo? Imagine o ganho de produtividade para pessoas que estão na área atendendo um cliente e precisa de uma consulta rápida sobre uma determinada venda de um produto? Mas, sem a necessidade de buscar numa planilha de Excel ou até mesmo no banco de dados.
Mas, como isso é possível? Na terceira parte do workshop (a última parte), vamos explorar como podemos fazer isso. Então, fique ligado(a) para não perder nenhuma live!
Conclusão da Live
A implementação demonstrou como integrar eficazmente o Azure Communication Services e o OpenAI em um aplicativo LOB, utilizando essas ferramentas para agilizar o desenvolvimento e criar funcionalidades avançadas. O projeto reflete o potencial dessas tecnologias para modernizar e escalar aplicativos empresariais.
Próxima Live
Na próxima live, continuaremos a explorar o projeto! Dessa vez, vamos trabalhar entender um pouco mais, como essa consulta SQL foi feita. E, como podemos fazer uso disso para melhorar a experiência do usuário final.
Recursos Adicionais
Sempre é muito importante ter acesso a recursos adicionais para aprimorar o conhecimento. Por isso, deixo aqui alguns links que podem ser úteis para vocês:
Link Oficial do Workshop
Curso Gratuito: Introdução aos Serviços de Comunicação do Azure
Curso Gratuito: Criar um aplicativo Web de chamadas de voz com os Serviços de Comunicação do Azure
Documentação do Azure Communication Services
Documentação do Microsoft Graph
Documentação do Microsoft Graph Toolkit
Espero que tenham gostado do artigo e até a próxima live!
Microsoft Tech Community – Latest Blogs –Read More
Is it possible to Merge points from two accounts for same user ?
Hello ,
Suppose if a user has multiple Mathworks accounts and wants to merge both accounts. If yes, how does it work?
Is it also possible to merge answers reputation points obtained from two different Mathworks account for same user ?
Regards ,
VBBVHello ,
Suppose if a user has multiple Mathworks accounts and wants to merge both accounts. If yes, how does it work?
Is it also possible to merge answers reputation points obtained from two different Mathworks account for same user ?
Regards ,
VBBV Hello ,
Suppose if a user has multiple Mathworks accounts and wants to merge both accounts. If yes, how does it work?
Is it also possible to merge answers reputation points obtained from two different Mathworks account for same user ?
Regards ,
VBBV merge, accounts, answers, points MATLAB Answers — New Questions
1D gaussian filter for A-scans (OCT)
Hello all,
I would like to implement a gaussian filter on my A-scan (1D) from an OCT image (B-scan, 2D). The A-scan essentially represents how the intensity values fluctuate versus the depth.
I would appreciate your help.
Thank you :)Hello all,
I would like to implement a gaussian filter on my A-scan (1D) from an OCT image (B-scan, 2D). The A-scan essentially represents how the intensity values fluctuate versus the depth.
I would appreciate your help.
Thank you 🙂 Hello all,
I would like to implement a gaussian filter on my A-scan (1D) from an OCT image (B-scan, 2D). The A-scan essentially represents how the intensity values fluctuate versus the depth.
I would appreciate your help.
Thank you 🙂 1d, gauusian filter MATLAB Answers — New Questions
Did the default NumWorkers change for a local pool in R2024a?
My laptop has 14 physical cores, confirmed by feature(‘numCores’), and doing pool = parpool() starts a pool with 14 workers on R2023b. However, on R2024a on the same machine it starts a pool with only 6 workers, and feature(‘numCores’) still says there are 14 cores.
The documentation I can find still says that the default number of workers is equal to the number of physical cores. I can’t find any settings anywhere that are not set to the default values (or blank).
Is this an undocumented change in behavior? Or am I missing something?My laptop has 14 physical cores, confirmed by feature(‘numCores’), and doing pool = parpool() starts a pool with 14 workers on R2023b. However, on R2024a on the same machine it starts a pool with only 6 workers, and feature(‘numCores’) still says there are 14 cores.
The documentation I can find still says that the default number of workers is equal to the number of physical cores. I can’t find any settings anywhere that are not set to the default values (or blank).
Is this an undocumented change in behavior? Or am I missing something? My laptop has 14 physical cores, confirmed by feature(‘numCores’), and doing pool = parpool() starts a pool with 14 workers on R2023b. However, on R2024a on the same machine it starts a pool with only 6 workers, and feature(‘numCores’) still says there are 14 cores.
The documentation I can find still says that the default number of workers is equal to the number of physical cores. I can’t find any settings anywhere that are not set to the default values (or blank).
Is this an undocumented change in behavior? Or am I missing something? numworkers, physical cores MATLAB Answers — New Questions
Can’t access my one drive on browser and also I can’t log in on my desktop app
As the title says I can’t see my files on brower nor log in in my desktop app.
Please help.
browser:
As the title says I can’t see my files on brower nor log in in my desktop app.Please help.browser: Read More
Storing output values from a for loop into an “array”
Hello everyone,
I am trying to output the values that I get from a for loop into an "array". I am not sure how to store those "list of values" into an array
I have attached my code in reference:
Storing_Values_Into_Array.m
close all; clc;
% Value of j
j = 1i;
% For the region k_o < k_p < sqrt(u_r*e_r)*k_o
% Wavenumber in free space value = k_o
k = 2*pi;
% Permeability Value = u_r
u_r = 1;
% Permittivity Value e_r
e_r = 2.2;
% Value of kz_1
kz_1 = @(kp) sqrt((k).^2*e_r*u_r – (kp).^2);
% Value of kz_2
kz_2 = @(kp) sqrt((kp).^2 – (k).^2);
% Substrate heights = d
D = [0.02 0.04 0.06 0.08 0.10];
% Using a for loop to calculate the roots for T_M
% Solving for k_p values
for i=1:numel(D)
d=D(i);
% Equations for TM(kp)
T_M = @(kp) kz_1(kp).*sin(d.*kz_1(kp)) – e_r*kz_2(kp).*cos(d.*kz_1(kp));
kp_root=[fzero(T_M, [k , k*sqrt(e_r*u_r)])]
fplot(T_M,[k k*sqrt(e_r*u_r)], ‘LineWidth’,3); hold on
plot(kp_root,0,’o’,’MarkerSize’,8,’MarkerFaceColor’,’k’);
ylim([-5 5]);
xlim([k k*sqrt(e_r*u_r)]);
title(‘T_M vs k_p’)
ylabel(‘T_M’)
xlabel(‘k_p’)
grid on;
ax = gca;
ax.GridLineWidth = 2;
end; hold off
%{
What I am trying to do is store the values I get from "kp_root" in an
array called "kp_list" so I can use that array for calculations later on.
%}Hello everyone,
I am trying to output the values that I get from a for loop into an "array". I am not sure how to store those "list of values" into an array
I have attached my code in reference:
Storing_Values_Into_Array.m
close all; clc;
% Value of j
j = 1i;
% For the region k_o < k_p < sqrt(u_r*e_r)*k_o
% Wavenumber in free space value = k_o
k = 2*pi;
% Permeability Value = u_r
u_r = 1;
% Permittivity Value e_r
e_r = 2.2;
% Value of kz_1
kz_1 = @(kp) sqrt((k).^2*e_r*u_r – (kp).^2);
% Value of kz_2
kz_2 = @(kp) sqrt((kp).^2 – (k).^2);
% Substrate heights = d
D = [0.02 0.04 0.06 0.08 0.10];
% Using a for loop to calculate the roots for T_M
% Solving for k_p values
for i=1:numel(D)
d=D(i);
% Equations for TM(kp)
T_M = @(kp) kz_1(kp).*sin(d.*kz_1(kp)) – e_r*kz_2(kp).*cos(d.*kz_1(kp));
kp_root=[fzero(T_M, [k , k*sqrt(e_r*u_r)])]
fplot(T_M,[k k*sqrt(e_r*u_r)], ‘LineWidth’,3); hold on
plot(kp_root,0,’o’,’MarkerSize’,8,’MarkerFaceColor’,’k’);
ylim([-5 5]);
xlim([k k*sqrt(e_r*u_r)]);
title(‘T_M vs k_p’)
ylabel(‘T_M’)
xlabel(‘k_p’)
grid on;
ax = gca;
ax.GridLineWidth = 2;
end; hold off
%{
What I am trying to do is store the values I get from "kp_root" in an
array called "kp_list" so I can use that array for calculations later on.
%} Hello everyone,
I am trying to output the values that I get from a for loop into an "array". I am not sure how to store those "list of values" into an array
I have attached my code in reference:
Storing_Values_Into_Array.m
close all; clc;
% Value of j
j = 1i;
% For the region k_o < k_p < sqrt(u_r*e_r)*k_o
% Wavenumber in free space value = k_o
k = 2*pi;
% Permeability Value = u_r
u_r = 1;
% Permittivity Value e_r
e_r = 2.2;
% Value of kz_1
kz_1 = @(kp) sqrt((k).^2*e_r*u_r – (kp).^2);
% Value of kz_2
kz_2 = @(kp) sqrt((kp).^2 – (k).^2);
% Substrate heights = d
D = [0.02 0.04 0.06 0.08 0.10];
% Using a for loop to calculate the roots for T_M
% Solving for k_p values
for i=1:numel(D)
d=D(i);
% Equations for TM(kp)
T_M = @(kp) kz_1(kp).*sin(d.*kz_1(kp)) – e_r*kz_2(kp).*cos(d.*kz_1(kp));
kp_root=[fzero(T_M, [k , k*sqrt(e_r*u_r)])]
fplot(T_M,[k k*sqrt(e_r*u_r)], ‘LineWidth’,3); hold on
plot(kp_root,0,’o’,’MarkerSize’,8,’MarkerFaceColor’,’k’);
ylim([-5 5]);
xlim([k k*sqrt(e_r*u_r)]);
title(‘T_M vs k_p’)
ylabel(‘T_M’)
xlabel(‘k_p’)
grid on;
ax = gca;
ax.GridLineWidth = 2;
end; hold off
%{
What I am trying to do is store the values I get from "kp_root" in an
array called "kp_list" so I can use that array for calculations later on.
%} array, arrays, for loop MATLAB Answers — New Questions
How to Fix if QuickBook𝖘 crashes when opening company file?
I’m encountering a frustrating issue with QuickBook𝖘 where it crashes every time I try to open my company file. Happens consistently every time I try to open the company file.
I’m encountering a frustrating issue with QuickBook𝖘 where it crashes every time I try to open my company file. Happens consistently every time I try to open the company file. Read More
How to Fix if QuickBook𝖘 Won’t Open after Update?
I’m in a bit of a panic here. I updated my QuickBook𝖘 software yesterday, and now it won’t open at all! I’ve tried restarting my computer, reinstalling QuickBook𝖘, and even checked for any recent Windows updates that might be causing the issue, but nothing seems to work. Has anyone else experienced this problem after the latest update? Any suggestions on how to fix it would be greatly appreciated.
I’m in a bit of a panic here. I updated my QuickBook𝖘 software yesterday, and now it won’t open at all! I’ve tried restarting my computer, reinstalling QuickBook𝖘, and even checked for any recent Windows updates that might be causing the issue, but nothing seems to work. Has anyone else experienced this problem after the latest update? Any suggestions on how to fix it would be greatly appreciated. Read More