Month: July 2024
Force a value in a field when I’m opening the EditView
Hello everyone,
I searched on this forum and on internet but didn’t find my answer.
I use a Sharepoint online List and have an approval flow on each change done on items.
The approval flow is waiting a value = ‘New’ in the column ‘ApprovalStatus’. This approach is to remove the infinite loop in power automate. Choices (‘New’,’Under reviewing’,’Approved’,’Rejected’)
When the approval is done ‘ApprovalStatus’ is changed to approved or Rejected.
If someone else wants to change again this item by using the EditForm, I would like to force the field ApprovalStatus to ‘New’ independently of is previous value.
Of course, no change when we are just reading the item
Do you know how to change a value in a field when we open the EditForm?
The goal will be to hide this field to be sure the process manage it and not the user
Hello everyone, I searched on this forum and on internet but didn’t find my answer.I use a Sharepoint online List and have an approval flow on each change done on items.The approval flow is waiting a value = ‘New’ in the column ‘ApprovalStatus’. This approach is to remove the infinite loop in power automate. Choices (‘New’,’Under reviewing’,’Approved’,’Rejected’)When the approval is done ‘ApprovalStatus’ is changed to approved or Rejected. If someone else wants to change again this item by using the EditForm, I would like to force the field ApprovalStatus to ‘New’ independently of is previous value.Of course, no change when we are just reading the item Do you know how to change a value in a field when we open the EditForm?The goal will be to hide this field to be sure the process manage it and not the user Read More
Error using thingsspeak in MATLAB
We have sensors connected on power grid lines that will tell the status wether there is any issue . We are trying to use thingsspeak and we performed some initial working which is shown in attached snap
Relevant code view is:
classdef IoTDataExplorerForThingSpeakUsingMATLAB < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
IoTDataExplorerForThingSpeakUIFigure matlab.ui.Figure
GridLayout matlab.ui.container.GridLayout
LeftPanel matlab.ui.container.Panel
F4CheckBox matlab.ui.control.CheckBox
ReadAPIKeyEditField matlab.ui.control.EditField
ReadAPIKeyEditFieldLabel matlab.ui.control.Label
ChannelIDEditField matlab.ui.control.NumericEditField
ChannelIDEditFieldLabel matlab.ui.control.Label
RightPanel matlab.ui.container.Panel
StatusLabel matlab.ui.control.Label
end
% Properties that correspond to apps with auto-reflow
properties (Access = private)
onePanelWidth = 576;
end
% Copyright 2020 – 2020 The MathWorks, Inc.
properties (Access = private)
legendLabel1
legendLabel2
myChans
end
methods (Access = private)
function displayFields=enumerateSelectedFields(app)
% Create array of the fields for processing
displayFields = [app.F4CheckBox.Value];
end
end
methods (Access = private)
function [query] = buildQueryFromInputs(app)
% buildQueryFromInputs build the querry inputs into a struct.
% q = buildQueryFromInputs(app)
%is a list of inputs needed to
% get the appropriate data from ThingSpeak.
% The data includes the start and stop date, channel ID and API keys.
%
query = struct();
% queryRecent = struct();
% queryOld = struct();
app.StatusLabel.Text = ‘Status’;
query.APIKey = app.ReadAPIKeyEditField.Value;
query.channelID = app.ChannelIDEditField.Value;
%query.startHour = hours(str2double(app.StartHourDropDown.Value));
%query.startMinute = minutes(str2double(app.MinDropDown.Value));
% query.dmult = app.plotDuration.Value;
%query.lmult = app.plotLengthofComparison.Value;
% build the start date with date, minutes, hours and am/PM
% queryRecent.startDate = app.StartDateDatePicker.Value + …
% query.startHour + query.startMinute;
% if app.AMPMSwitch.Value == "PM"
% queryRecent.startDate = queryRecent.startDate + hours(12);
% end
%queryRecent.endDate = queryRecent.startDate + getCompareDuration(app);
%query.fieldsList = {};
%queryDisplayFields = enumerateSelectedFields(app);
% build the fields list for ThingSpeak Read
% for i= 1:8
% if queryDisplayFields(i) > 0
% query.fieldsList = [query.fieldsList, i];
% end
% end
% query.fieldsList = cell2mat(query.fieldsList);
% queryOld.startDate = queryRecent.startDate – getCompareWidth(app);
% queryOld.endDate = queryOld.startDate + getCompareDuration(app);
% end
% function myData = getDataFromQuery(app, query,queryStartEnd)
% getDataFromQueryRecent() get the recent data.
% data = getDataFromQueryRecent(app, queryRecent) is a the
% most recent data. Requires buildQueryFromInputs to get
% startDate, endDate, fieldsList, channelID, and APIKey.
%
% try
% myData = thingSpeakRead(query.channelID, …
% ‘ReadKey’, query.APIKey, …
% ‘DateRange’,[queryStartEnd.startDate queryStartEnd.endDate], …
% ‘Fields’, query.fieldsList, …
% ‘OutputFormat’,’Timetable’);
% catch readingError
% myData = timetable();
% uialert(app.IoTDataExplorerForThingSpeakUIFigure,readingError.identifier,"Data error for that time interval");
% return
% end
% if isempty(myData)
% uialert(app.IoTDataExplorerForThingSpeakUIFigure,"No Data for that time interval","Pick some different data");
% myData = timetable();
% return
% end
% if height(myData) >= 8000
% app.StatusLabel.Text = "Read limit reached. Duration may be shorter than expected";
% end
% Use retime if the user has selected that option
% if app.RetimeDropDown.Value ~= "Raw"
% myData = retime(myData,app.RetimeDropDown.Value,’linear’);
% end
% end
% function visualizeData(app,recentData, oldData, queryInfo)
% visualizeData() display the data.
% visualizeData(app,recentData, oldData) uses a the recentData and oldData to
% plot the data in a tiled layot depending on the number of
% fields selected.
% dataDisplayFields = enumerateSelectedFields(app);
% if sum(dataDisplayFields) > width(oldData)
% uialert(app.IoTDataExplorerForThingSpeakUIFigure,"Not enough Fields selected","Pick a different channel or different fields.");
% end
% Check to make sure the earlier functions produced data.
% if width(recentData) == 0
% return
% end
% if width(oldData) == 0
% return
% end
% t = tiledlayout(app.RightPanel,sum(dataDisplayFields),1,’tilespacing’,’none’);
% Change data to elapsed time
% elapsedRecent = recentData.Timestamps – recentData.Timestamps(1) + …
% queryInfo.startHour + queryInfo.startMinute;
% elapsedOld = oldData.Timestamps-oldData.Timestamps(1) + …
% queryInfo.startHour + queryInfo.startMinute;
% Determine which set is shortest.
% minLength = min(height(oldData),height(recentData));
% myTile = 0;
% for index = 1:8
% if dataDisplayFields(index)>0
% myTile = myTile + 1;
% myAxes = nexttile(t);
% plotVar = recentData.(myTile);
% plot(myAxes,elapsedRecent(1:minLength),plotVar(1:minLength),’-o’,’MarkerSize’,2); %#<ADMTHDINV>
% if app.CompareLengthDropDown.Value ~= minutes(0) % minutes(0) is the setting for don’t show the old data
% hold(myAxes,"on");
% plotVar2=oldData.(myTile);
% plot(myAxes,elapsedOld(1:minLength),plotVar2(1:minLength),’-*’,’MarkerSize’,2);
% end
% title(myAxes,recentData.Properties.VariableNames(myTile));
% if myTile > 1
% set (myAxes,’xtick’,[]);
% legend(myAxes,["Recent" ,"Old"]);
% else
% legend(myAxes,{app.legendLabel1, app.legendLabel2});
% end
% end
% end
% end
% function compareDuration = getCompareDuration(app)
% % Determine the length in time of the data analysis for each
% window from the GUI inputs.
% dmult = app.plotDuration.Value;
% compareDuration = app.DurationDropDown.Value * dmult;
% end
% function legendLabel = getLegendLabel(app,startDate)
% Format the legendLabel based on the start data and duration
% selected.
% dmult = app.plotDuration.Value;
% switch app.DurationDropDown.Value
% case minutes(1)
% legendLabel = string(dmult) + ‘ Minutes on ‘ + string(startDate);
% case hours(1)
% legendLabel = string(dmult) + ‘ Hours on ‘ + string(startDate);
% case hours(24)
% legendLabel = string(dmult) + ‘ Days on ‘ + string(startDate);
% case days(7)
% legendLabel = string(dmult) + ‘ Weeks on ‘ + string(startDate);
% case days(365)
% legendLabel = string(dmult) + ‘ Years on ‘ + string(startDate);
% end
% if app.RetimeDropDown.Value ~= "Raw"
% legendLabel = legendLabel + " " + string(app.RetimeDropDown.Value);
% end
% end
% function compareWidth = getCompareWidth(app)
% Determine the difference in time from the recent data to the
% older data from the GUI inputs.
% lmult = app.plotLengthofComparison.Value;
% compareWidth = app.CompareLengthDropDown.Value * lmult;
% end
% end
% Callbacks that handle component events
methods (Access = private)
% Changes arrangement of the app based on UIFigure width
function updateAppLayout(app, event)
currentFigureWidth = app.IoTDataExplorerForThingSpeakUIFigure.Position(3);
if(currentFigureWidth <= app.onePanelWidth)
% Change to a 2×1 grid
app.GridLayout.RowHeight = {511, 511};
app.GridLayout.ColumnWidth = {‘1x’};
app.RightPanel.Layout.Row = 2;
app.RightPanel.Layout.Column = 1;
else
% Change to a 1×2 grid
app.GridLayout.RowHeight = {‘1x’};
app.GridLayout.ColumnWidth = {241, ‘1x’};
app.RightPanel.Layout.Row = 1;
app.RightPanel.Layout.Column = 2;
end
end
% Value changed function: F4CheckBox
function F4CheckBoxValueChanged(app, event)
value = app.F4CheckBox.value;
end
end
% Value changed function: ChannelIDEditField
function ChannelIDEditFieldValueChanged(app, event)
value = app.ChannelIDEditField.Value;
end
% Value changed function: ReadAPIKeyEditField
function ReadAPIKeyEditFieldValueChanged(app, event)
value = app.ReadAPIKeyEditField.Value;
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create IoTDataExplorerForThingSpeakUIFigure and hide until all components are created
app.IoTDataExplorerForThingSpeakUIFigure = uifigure(‘Visible’, ‘off’);
app.IoTDataExplorerForThingSpeakUIFigure.AutoResizeChildren = ‘off’;
app.IoTDataExplorerForThingSpeakUIFigure.Position = [100 100 710 511];
app.IoTDataExplorerForThingSpeakUIFigure.Name = ‘ThingSpeak Data Explorer’;
app.IoTDataExplorerForThingSpeakUIFigure.SizeChangedFcn = createCallbackFcn(app, @updateAppLayout, true);
% Create GridLayout
app.GridLayout = uigridlayout(app.IoTDataExplorerForThingSpeakUIFigure);
app.GridLayout.ColumnWidth = {241, ‘1x’};
app.GridLayout.RowHeight = {‘1x’};
app.GridLayout.ColumnSpacing = 0;
app.GridLayout.RowSpacing = 0;
app.GridLayout.Padding = [0 0 0 0];
app.GridLayout.Scrollable = ‘on’;
% Create LeftPanel
app.LeftPanel = uipanel(app.GridLayout);
app.LeftPanel.Layout.Row = 1;
app.LeftPanel.Layout.Column = 1;
% Create ChannelIDEditFieldLabel
app.ChannelIDEditFieldLabel = uilabel(app.LeftPanel);
app.ChannelIDEditFieldLabel.HorizontalAlignment = ‘right’;
app.ChannelIDEditFieldLabel.Position = [12 464 66 22];
app.ChannelIDEditFieldLabel.Text = ‘Channel ID’;
% Create ChannelIDEditField
app.ChannelIDEditField = uieditfield(app.LeftPanel, ‘numeric’);
app.ChannelIDEditField.ValueDisplayFormat = ‘%.0f’;
app.ChannelIDEditField.ValueChangedFcn = createCallbackFcn(app, @ChannelIDEditFieldValueChanged, true);
app.ChannelIDEditField.Position = [93 464 55 22];
app.ChannelIDEditField.Value = 543172;
% Create ReadAPIKeyEditFieldLabel
app.ReadAPIKeyEditFieldLabel = uilabel(app.LeftPanel);
app.ReadAPIKeyEditFieldLabel.HorizontalAlignment = ‘right’;
app.ReadAPIKeyEditFieldLabel.Position = [13 434 74 22];
app.ReadAPIKeyEditFieldLabel.Text = ‘ReadAPIKey’;
% Create ReadAPIKeyEditField
app.ReadAPIKeyEditField = uieditfield(app.LeftPanel, ‘text’);
app.ReadAPIKeyEditField.ValueChangedFcn = createCallbackFcn(app, @ReadAPIKeyEditFieldValueChanged, true);
app.ReadAPIKeyEditField.Position = [102 434 100 22];
app.ReadAPIKeyEditField.Value = ‘0BXYOJW16B7R6DMM’;
% Create F4CheckBox
app.F4CheckBox = uicheckbox(app.LeftPanel);
app.F4CheckBox.ValueChangedFcn = createCallbackFcn(app, @F4CheckBoxValueChanged, true);
app.F4CheckBox.Text = ‘F4’;
app.F4CheckBox.Position = [14 178 36 22];
app.F4CheckBox.Value = true;
% Create RightPanel
app.RightPanel = uipanel(app.GridLayout);
app.RightPanel.Layout.Row = 1;
app.RightPanel.Layout.Column = 2;
% Create StatusLabel
app.StatusLabel = uilabel(app.RightPanel);
app.StatusLabel.Position = [2 1 449 22];
app.StatusLabel.Text = ‘Status’;
% Show the figure after all components are created
app.IoTDataExplorerForThingSpeakUIFigure.Visible = ‘on’;
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = IoTDataExplorerForThingSpeakUsingMATLAB
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.IoTDataExplorerForThingSpeakUIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.IoTDataExplorerForThingSpeakUIFigure)
end
end
end
But when we try to run ,we get error:
Unrecognized function or variable ‘updateAppLayout’.
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, …
Error using IoTDataExplorerForThingSpeakUsingMATLAB/createComponents (line 324)
Error while evaluating Figure SizeChangedFcn.
Warning: The following error was caught while executing ‘onCleanup’ class destructor:
Brace indexing is not supported for variables of this type.
Error in cell2mat (line 36)
if isnumeric(c{1}) || ischar(c{1}) || islogical(c{1}) || isstruct(c{1})
Error in onCleanup/delete (line 25)
obj.task();
Warning: The following error was caught while executing ‘onCleanup’ class destructor:
Brace indexing is not supported for variables of this type.
Error in cell2mat (line 36)
if isnumeric(c{1}) || ischar(c{1}) || islogical(c{1}) || isstruct(c{1})
Error in onCleanup/delete (line 25)
obj.task();
Error in onCleanup/delete (line 25)
obj.task();
Error inmatlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event)
(line 62)
newCallback = @(source, event)executeCallback(ams, … > In onCleanup/delete (line 25)
In matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
In matlab.ui.internal.controller/FigureController/handleClientEvent (line 832)
In matlab.ui.internal.controller/FigureController/handleEvent (line 667)
In matlab.ui.internal.controller.WebCanvasContainerController>@(varargin)this.handleEvent(varargin{:}) (line 45)
Unrecognized function or variable ‘updateAppLayout’.
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, …
Error using matlab.ui.internal.controller.FigureController/handleClientEvent (line 832)
Error while evaluating Figure SizeChangedFcn.
>>We have sensors connected on power grid lines that will tell the status wether there is any issue . We are trying to use thingsspeak and we performed some initial working which is shown in attached snap
Relevant code view is:
classdef IoTDataExplorerForThingSpeakUsingMATLAB < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
IoTDataExplorerForThingSpeakUIFigure matlab.ui.Figure
GridLayout matlab.ui.container.GridLayout
LeftPanel matlab.ui.container.Panel
F4CheckBox matlab.ui.control.CheckBox
ReadAPIKeyEditField matlab.ui.control.EditField
ReadAPIKeyEditFieldLabel matlab.ui.control.Label
ChannelIDEditField matlab.ui.control.NumericEditField
ChannelIDEditFieldLabel matlab.ui.control.Label
RightPanel matlab.ui.container.Panel
StatusLabel matlab.ui.control.Label
end
% Properties that correspond to apps with auto-reflow
properties (Access = private)
onePanelWidth = 576;
end
% Copyright 2020 – 2020 The MathWorks, Inc.
properties (Access = private)
legendLabel1
legendLabel2
myChans
end
methods (Access = private)
function displayFields=enumerateSelectedFields(app)
% Create array of the fields for processing
displayFields = [app.F4CheckBox.Value];
end
end
methods (Access = private)
function [query] = buildQueryFromInputs(app)
% buildQueryFromInputs build the querry inputs into a struct.
% q = buildQueryFromInputs(app)
%is a list of inputs needed to
% get the appropriate data from ThingSpeak.
% The data includes the start and stop date, channel ID and API keys.
%
query = struct();
% queryRecent = struct();
% queryOld = struct();
app.StatusLabel.Text = ‘Status’;
query.APIKey = app.ReadAPIKeyEditField.Value;
query.channelID = app.ChannelIDEditField.Value;
%query.startHour = hours(str2double(app.StartHourDropDown.Value));
%query.startMinute = minutes(str2double(app.MinDropDown.Value));
% query.dmult = app.plotDuration.Value;
%query.lmult = app.plotLengthofComparison.Value;
% build the start date with date, minutes, hours and am/PM
% queryRecent.startDate = app.StartDateDatePicker.Value + …
% query.startHour + query.startMinute;
% if app.AMPMSwitch.Value == "PM"
% queryRecent.startDate = queryRecent.startDate + hours(12);
% end
%queryRecent.endDate = queryRecent.startDate + getCompareDuration(app);
%query.fieldsList = {};
%queryDisplayFields = enumerateSelectedFields(app);
% build the fields list for ThingSpeak Read
% for i= 1:8
% if queryDisplayFields(i) > 0
% query.fieldsList = [query.fieldsList, i];
% end
% end
% query.fieldsList = cell2mat(query.fieldsList);
% queryOld.startDate = queryRecent.startDate – getCompareWidth(app);
% queryOld.endDate = queryOld.startDate + getCompareDuration(app);
% end
% function myData = getDataFromQuery(app, query,queryStartEnd)
% getDataFromQueryRecent() get the recent data.
% data = getDataFromQueryRecent(app, queryRecent) is a the
% most recent data. Requires buildQueryFromInputs to get
% startDate, endDate, fieldsList, channelID, and APIKey.
%
% try
% myData = thingSpeakRead(query.channelID, …
% ‘ReadKey’, query.APIKey, …
% ‘DateRange’,[queryStartEnd.startDate queryStartEnd.endDate], …
% ‘Fields’, query.fieldsList, …
% ‘OutputFormat’,’Timetable’);
% catch readingError
% myData = timetable();
% uialert(app.IoTDataExplorerForThingSpeakUIFigure,readingError.identifier,"Data error for that time interval");
% return
% end
% if isempty(myData)
% uialert(app.IoTDataExplorerForThingSpeakUIFigure,"No Data for that time interval","Pick some different data");
% myData = timetable();
% return
% end
% if height(myData) >= 8000
% app.StatusLabel.Text = "Read limit reached. Duration may be shorter than expected";
% end
% Use retime if the user has selected that option
% if app.RetimeDropDown.Value ~= "Raw"
% myData = retime(myData,app.RetimeDropDown.Value,’linear’);
% end
% end
% function visualizeData(app,recentData, oldData, queryInfo)
% visualizeData() display the data.
% visualizeData(app,recentData, oldData) uses a the recentData and oldData to
% plot the data in a tiled layot depending on the number of
% fields selected.
% dataDisplayFields = enumerateSelectedFields(app);
% if sum(dataDisplayFields) > width(oldData)
% uialert(app.IoTDataExplorerForThingSpeakUIFigure,"Not enough Fields selected","Pick a different channel or different fields.");
% end
% Check to make sure the earlier functions produced data.
% if width(recentData) == 0
% return
% end
% if width(oldData) == 0
% return
% end
% t = tiledlayout(app.RightPanel,sum(dataDisplayFields),1,’tilespacing’,’none’);
% Change data to elapsed time
% elapsedRecent = recentData.Timestamps – recentData.Timestamps(1) + …
% queryInfo.startHour + queryInfo.startMinute;
% elapsedOld = oldData.Timestamps-oldData.Timestamps(1) + …
% queryInfo.startHour + queryInfo.startMinute;
% Determine which set is shortest.
% minLength = min(height(oldData),height(recentData));
% myTile = 0;
% for index = 1:8
% if dataDisplayFields(index)>0
% myTile = myTile + 1;
% myAxes = nexttile(t);
% plotVar = recentData.(myTile);
% plot(myAxes,elapsedRecent(1:minLength),plotVar(1:minLength),’-o’,’MarkerSize’,2); %#<ADMTHDINV>
% if app.CompareLengthDropDown.Value ~= minutes(0) % minutes(0) is the setting for don’t show the old data
% hold(myAxes,"on");
% plotVar2=oldData.(myTile);
% plot(myAxes,elapsedOld(1:minLength),plotVar2(1:minLength),’-*’,’MarkerSize’,2);
% end
% title(myAxes,recentData.Properties.VariableNames(myTile));
% if myTile > 1
% set (myAxes,’xtick’,[]);
% legend(myAxes,["Recent" ,"Old"]);
% else
% legend(myAxes,{app.legendLabel1, app.legendLabel2});
% end
% end
% end
% end
% function compareDuration = getCompareDuration(app)
% % Determine the length in time of the data analysis for each
% window from the GUI inputs.
% dmult = app.plotDuration.Value;
% compareDuration = app.DurationDropDown.Value * dmult;
% end
% function legendLabel = getLegendLabel(app,startDate)
% Format the legendLabel based on the start data and duration
% selected.
% dmult = app.plotDuration.Value;
% switch app.DurationDropDown.Value
% case minutes(1)
% legendLabel = string(dmult) + ‘ Minutes on ‘ + string(startDate);
% case hours(1)
% legendLabel = string(dmult) + ‘ Hours on ‘ + string(startDate);
% case hours(24)
% legendLabel = string(dmult) + ‘ Days on ‘ + string(startDate);
% case days(7)
% legendLabel = string(dmult) + ‘ Weeks on ‘ + string(startDate);
% case days(365)
% legendLabel = string(dmult) + ‘ Years on ‘ + string(startDate);
% end
% if app.RetimeDropDown.Value ~= "Raw"
% legendLabel = legendLabel + " " + string(app.RetimeDropDown.Value);
% end
% end
% function compareWidth = getCompareWidth(app)
% Determine the difference in time from the recent data to the
% older data from the GUI inputs.
% lmult = app.plotLengthofComparison.Value;
% compareWidth = app.CompareLengthDropDown.Value * lmult;
% end
% end
% Callbacks that handle component events
methods (Access = private)
% Changes arrangement of the app based on UIFigure width
function updateAppLayout(app, event)
currentFigureWidth = app.IoTDataExplorerForThingSpeakUIFigure.Position(3);
if(currentFigureWidth <= app.onePanelWidth)
% Change to a 2×1 grid
app.GridLayout.RowHeight = {511, 511};
app.GridLayout.ColumnWidth = {‘1x’};
app.RightPanel.Layout.Row = 2;
app.RightPanel.Layout.Column = 1;
else
% Change to a 1×2 grid
app.GridLayout.RowHeight = {‘1x’};
app.GridLayout.ColumnWidth = {241, ‘1x’};
app.RightPanel.Layout.Row = 1;
app.RightPanel.Layout.Column = 2;
end
end
% Value changed function: F4CheckBox
function F4CheckBoxValueChanged(app, event)
value = app.F4CheckBox.value;
end
end
% Value changed function: ChannelIDEditField
function ChannelIDEditFieldValueChanged(app, event)
value = app.ChannelIDEditField.Value;
end
% Value changed function: ReadAPIKeyEditField
function ReadAPIKeyEditFieldValueChanged(app, event)
value = app.ReadAPIKeyEditField.Value;
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create IoTDataExplorerForThingSpeakUIFigure and hide until all components are created
app.IoTDataExplorerForThingSpeakUIFigure = uifigure(‘Visible’, ‘off’);
app.IoTDataExplorerForThingSpeakUIFigure.AutoResizeChildren = ‘off’;
app.IoTDataExplorerForThingSpeakUIFigure.Position = [100 100 710 511];
app.IoTDataExplorerForThingSpeakUIFigure.Name = ‘ThingSpeak Data Explorer’;
app.IoTDataExplorerForThingSpeakUIFigure.SizeChangedFcn = createCallbackFcn(app, @updateAppLayout, true);
% Create GridLayout
app.GridLayout = uigridlayout(app.IoTDataExplorerForThingSpeakUIFigure);
app.GridLayout.ColumnWidth = {241, ‘1x’};
app.GridLayout.RowHeight = {‘1x’};
app.GridLayout.ColumnSpacing = 0;
app.GridLayout.RowSpacing = 0;
app.GridLayout.Padding = [0 0 0 0];
app.GridLayout.Scrollable = ‘on’;
% Create LeftPanel
app.LeftPanel = uipanel(app.GridLayout);
app.LeftPanel.Layout.Row = 1;
app.LeftPanel.Layout.Column = 1;
% Create ChannelIDEditFieldLabel
app.ChannelIDEditFieldLabel = uilabel(app.LeftPanel);
app.ChannelIDEditFieldLabel.HorizontalAlignment = ‘right’;
app.ChannelIDEditFieldLabel.Position = [12 464 66 22];
app.ChannelIDEditFieldLabel.Text = ‘Channel ID’;
% Create ChannelIDEditField
app.ChannelIDEditField = uieditfield(app.LeftPanel, ‘numeric’);
app.ChannelIDEditField.ValueDisplayFormat = ‘%.0f’;
app.ChannelIDEditField.ValueChangedFcn = createCallbackFcn(app, @ChannelIDEditFieldValueChanged, true);
app.ChannelIDEditField.Position = [93 464 55 22];
app.ChannelIDEditField.Value = 543172;
% Create ReadAPIKeyEditFieldLabel
app.ReadAPIKeyEditFieldLabel = uilabel(app.LeftPanel);
app.ReadAPIKeyEditFieldLabel.HorizontalAlignment = ‘right’;
app.ReadAPIKeyEditFieldLabel.Position = [13 434 74 22];
app.ReadAPIKeyEditFieldLabel.Text = ‘ReadAPIKey’;
% Create ReadAPIKeyEditField
app.ReadAPIKeyEditField = uieditfield(app.LeftPanel, ‘text’);
app.ReadAPIKeyEditField.ValueChangedFcn = createCallbackFcn(app, @ReadAPIKeyEditFieldValueChanged, true);
app.ReadAPIKeyEditField.Position = [102 434 100 22];
app.ReadAPIKeyEditField.Value = ‘0BXYOJW16B7R6DMM’;
% Create F4CheckBox
app.F4CheckBox = uicheckbox(app.LeftPanel);
app.F4CheckBox.ValueChangedFcn = createCallbackFcn(app, @F4CheckBoxValueChanged, true);
app.F4CheckBox.Text = ‘F4’;
app.F4CheckBox.Position = [14 178 36 22];
app.F4CheckBox.Value = true;
% Create RightPanel
app.RightPanel = uipanel(app.GridLayout);
app.RightPanel.Layout.Row = 1;
app.RightPanel.Layout.Column = 2;
% Create StatusLabel
app.StatusLabel = uilabel(app.RightPanel);
app.StatusLabel.Position = [2 1 449 22];
app.StatusLabel.Text = ‘Status’;
% Show the figure after all components are created
app.IoTDataExplorerForThingSpeakUIFigure.Visible = ‘on’;
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = IoTDataExplorerForThingSpeakUsingMATLAB
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.IoTDataExplorerForThingSpeakUIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.IoTDataExplorerForThingSpeakUIFigure)
end
end
end
But when we try to run ,we get error:
Unrecognized function or variable ‘updateAppLayout’.
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, …
Error using IoTDataExplorerForThingSpeakUsingMATLAB/createComponents (line 324)
Error while evaluating Figure SizeChangedFcn.
Warning: The following error was caught while executing ‘onCleanup’ class destructor:
Brace indexing is not supported for variables of this type.
Error in cell2mat (line 36)
if isnumeric(c{1}) || ischar(c{1}) || islogical(c{1}) || isstruct(c{1})
Error in onCleanup/delete (line 25)
obj.task();
Warning: The following error was caught while executing ‘onCleanup’ class destructor:
Brace indexing is not supported for variables of this type.
Error in cell2mat (line 36)
if isnumeric(c{1}) || ischar(c{1}) || islogical(c{1}) || isstruct(c{1})
Error in onCleanup/delete (line 25)
obj.task();
Error in onCleanup/delete (line 25)
obj.task();
Error inmatlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event)
(line 62)
newCallback = @(source, event)executeCallback(ams, … > In onCleanup/delete (line 25)
In matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
In matlab.ui.internal.controller/FigureController/handleClientEvent (line 832)
In matlab.ui.internal.controller/FigureController/handleEvent (line 667)
In matlab.ui.internal.controller.WebCanvasContainerController>@(varargin)this.handleEvent(varargin{:}) (line 45)
Unrecognized function or variable ‘updateAppLayout’.
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, …
Error using matlab.ui.internal.controller.FigureController/handleClientEvent (line 832)
Error while evaluating Figure SizeChangedFcn.
>> We have sensors connected on power grid lines that will tell the status wether there is any issue . We are trying to use thingsspeak and we performed some initial working which is shown in attached snap
Relevant code view is:
classdef IoTDataExplorerForThingSpeakUsingMATLAB < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
IoTDataExplorerForThingSpeakUIFigure matlab.ui.Figure
GridLayout matlab.ui.container.GridLayout
LeftPanel matlab.ui.container.Panel
F4CheckBox matlab.ui.control.CheckBox
ReadAPIKeyEditField matlab.ui.control.EditField
ReadAPIKeyEditFieldLabel matlab.ui.control.Label
ChannelIDEditField matlab.ui.control.NumericEditField
ChannelIDEditFieldLabel matlab.ui.control.Label
RightPanel matlab.ui.container.Panel
StatusLabel matlab.ui.control.Label
end
% Properties that correspond to apps with auto-reflow
properties (Access = private)
onePanelWidth = 576;
end
% Copyright 2020 – 2020 The MathWorks, Inc.
properties (Access = private)
legendLabel1
legendLabel2
myChans
end
methods (Access = private)
function displayFields=enumerateSelectedFields(app)
% Create array of the fields for processing
displayFields = [app.F4CheckBox.Value];
end
end
methods (Access = private)
function [query] = buildQueryFromInputs(app)
% buildQueryFromInputs build the querry inputs into a struct.
% q = buildQueryFromInputs(app)
%is a list of inputs needed to
% get the appropriate data from ThingSpeak.
% The data includes the start and stop date, channel ID and API keys.
%
query = struct();
% queryRecent = struct();
% queryOld = struct();
app.StatusLabel.Text = ‘Status’;
query.APIKey = app.ReadAPIKeyEditField.Value;
query.channelID = app.ChannelIDEditField.Value;
%query.startHour = hours(str2double(app.StartHourDropDown.Value));
%query.startMinute = minutes(str2double(app.MinDropDown.Value));
% query.dmult = app.plotDuration.Value;
%query.lmult = app.plotLengthofComparison.Value;
% build the start date with date, minutes, hours and am/PM
% queryRecent.startDate = app.StartDateDatePicker.Value + …
% query.startHour + query.startMinute;
% if app.AMPMSwitch.Value == "PM"
% queryRecent.startDate = queryRecent.startDate + hours(12);
% end
%queryRecent.endDate = queryRecent.startDate + getCompareDuration(app);
%query.fieldsList = {};
%queryDisplayFields = enumerateSelectedFields(app);
% build the fields list for ThingSpeak Read
% for i= 1:8
% if queryDisplayFields(i) > 0
% query.fieldsList = [query.fieldsList, i];
% end
% end
% query.fieldsList = cell2mat(query.fieldsList);
% queryOld.startDate = queryRecent.startDate – getCompareWidth(app);
% queryOld.endDate = queryOld.startDate + getCompareDuration(app);
% end
% function myData = getDataFromQuery(app, query,queryStartEnd)
% getDataFromQueryRecent() get the recent data.
% data = getDataFromQueryRecent(app, queryRecent) is a the
% most recent data. Requires buildQueryFromInputs to get
% startDate, endDate, fieldsList, channelID, and APIKey.
%
% try
% myData = thingSpeakRead(query.channelID, …
% ‘ReadKey’, query.APIKey, …
% ‘DateRange’,[queryStartEnd.startDate queryStartEnd.endDate], …
% ‘Fields’, query.fieldsList, …
% ‘OutputFormat’,’Timetable’);
% catch readingError
% myData = timetable();
% uialert(app.IoTDataExplorerForThingSpeakUIFigure,readingError.identifier,"Data error for that time interval");
% return
% end
% if isempty(myData)
% uialert(app.IoTDataExplorerForThingSpeakUIFigure,"No Data for that time interval","Pick some different data");
% myData = timetable();
% return
% end
% if height(myData) >= 8000
% app.StatusLabel.Text = "Read limit reached. Duration may be shorter than expected";
% end
% Use retime if the user has selected that option
% if app.RetimeDropDown.Value ~= "Raw"
% myData = retime(myData,app.RetimeDropDown.Value,’linear’);
% end
% end
% function visualizeData(app,recentData, oldData, queryInfo)
% visualizeData() display the data.
% visualizeData(app,recentData, oldData) uses a the recentData and oldData to
% plot the data in a tiled layot depending on the number of
% fields selected.
% dataDisplayFields = enumerateSelectedFields(app);
% if sum(dataDisplayFields) > width(oldData)
% uialert(app.IoTDataExplorerForThingSpeakUIFigure,"Not enough Fields selected","Pick a different channel or different fields.");
% end
% Check to make sure the earlier functions produced data.
% if width(recentData) == 0
% return
% end
% if width(oldData) == 0
% return
% end
% t = tiledlayout(app.RightPanel,sum(dataDisplayFields),1,’tilespacing’,’none’);
% Change data to elapsed time
% elapsedRecent = recentData.Timestamps – recentData.Timestamps(1) + …
% queryInfo.startHour + queryInfo.startMinute;
% elapsedOld = oldData.Timestamps-oldData.Timestamps(1) + …
% queryInfo.startHour + queryInfo.startMinute;
% Determine which set is shortest.
% minLength = min(height(oldData),height(recentData));
% myTile = 0;
% for index = 1:8
% if dataDisplayFields(index)>0
% myTile = myTile + 1;
% myAxes = nexttile(t);
% plotVar = recentData.(myTile);
% plot(myAxes,elapsedRecent(1:minLength),plotVar(1:minLength),’-o’,’MarkerSize’,2); %#<ADMTHDINV>
% if app.CompareLengthDropDown.Value ~= minutes(0) % minutes(0) is the setting for don’t show the old data
% hold(myAxes,"on");
% plotVar2=oldData.(myTile);
% plot(myAxes,elapsedOld(1:minLength),plotVar2(1:minLength),’-*’,’MarkerSize’,2);
% end
% title(myAxes,recentData.Properties.VariableNames(myTile));
% if myTile > 1
% set (myAxes,’xtick’,[]);
% legend(myAxes,["Recent" ,"Old"]);
% else
% legend(myAxes,{app.legendLabel1, app.legendLabel2});
% end
% end
% end
% end
% function compareDuration = getCompareDuration(app)
% % Determine the length in time of the data analysis for each
% window from the GUI inputs.
% dmult = app.plotDuration.Value;
% compareDuration = app.DurationDropDown.Value * dmult;
% end
% function legendLabel = getLegendLabel(app,startDate)
% Format the legendLabel based on the start data and duration
% selected.
% dmult = app.plotDuration.Value;
% switch app.DurationDropDown.Value
% case minutes(1)
% legendLabel = string(dmult) + ‘ Minutes on ‘ + string(startDate);
% case hours(1)
% legendLabel = string(dmult) + ‘ Hours on ‘ + string(startDate);
% case hours(24)
% legendLabel = string(dmult) + ‘ Days on ‘ + string(startDate);
% case days(7)
% legendLabel = string(dmult) + ‘ Weeks on ‘ + string(startDate);
% case days(365)
% legendLabel = string(dmult) + ‘ Years on ‘ + string(startDate);
% end
% if app.RetimeDropDown.Value ~= "Raw"
% legendLabel = legendLabel + " " + string(app.RetimeDropDown.Value);
% end
% end
% function compareWidth = getCompareWidth(app)
% Determine the difference in time from the recent data to the
% older data from the GUI inputs.
% lmult = app.plotLengthofComparison.Value;
% compareWidth = app.CompareLengthDropDown.Value * lmult;
% end
% end
% Callbacks that handle component events
methods (Access = private)
% Changes arrangement of the app based on UIFigure width
function updateAppLayout(app, event)
currentFigureWidth = app.IoTDataExplorerForThingSpeakUIFigure.Position(3);
if(currentFigureWidth <= app.onePanelWidth)
% Change to a 2×1 grid
app.GridLayout.RowHeight = {511, 511};
app.GridLayout.ColumnWidth = {‘1x’};
app.RightPanel.Layout.Row = 2;
app.RightPanel.Layout.Column = 1;
else
% Change to a 1×2 grid
app.GridLayout.RowHeight = {‘1x’};
app.GridLayout.ColumnWidth = {241, ‘1x’};
app.RightPanel.Layout.Row = 1;
app.RightPanel.Layout.Column = 2;
end
end
% Value changed function: F4CheckBox
function F4CheckBoxValueChanged(app, event)
value = app.F4CheckBox.value;
end
end
% Value changed function: ChannelIDEditField
function ChannelIDEditFieldValueChanged(app, event)
value = app.ChannelIDEditField.Value;
end
% Value changed function: ReadAPIKeyEditField
function ReadAPIKeyEditFieldValueChanged(app, event)
value = app.ReadAPIKeyEditField.Value;
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create IoTDataExplorerForThingSpeakUIFigure and hide until all components are created
app.IoTDataExplorerForThingSpeakUIFigure = uifigure(‘Visible’, ‘off’);
app.IoTDataExplorerForThingSpeakUIFigure.AutoResizeChildren = ‘off’;
app.IoTDataExplorerForThingSpeakUIFigure.Position = [100 100 710 511];
app.IoTDataExplorerForThingSpeakUIFigure.Name = ‘ThingSpeak Data Explorer’;
app.IoTDataExplorerForThingSpeakUIFigure.SizeChangedFcn = createCallbackFcn(app, @updateAppLayout, true);
% Create GridLayout
app.GridLayout = uigridlayout(app.IoTDataExplorerForThingSpeakUIFigure);
app.GridLayout.ColumnWidth = {241, ‘1x’};
app.GridLayout.RowHeight = {‘1x’};
app.GridLayout.ColumnSpacing = 0;
app.GridLayout.RowSpacing = 0;
app.GridLayout.Padding = [0 0 0 0];
app.GridLayout.Scrollable = ‘on’;
% Create LeftPanel
app.LeftPanel = uipanel(app.GridLayout);
app.LeftPanel.Layout.Row = 1;
app.LeftPanel.Layout.Column = 1;
% Create ChannelIDEditFieldLabel
app.ChannelIDEditFieldLabel = uilabel(app.LeftPanel);
app.ChannelIDEditFieldLabel.HorizontalAlignment = ‘right’;
app.ChannelIDEditFieldLabel.Position = [12 464 66 22];
app.ChannelIDEditFieldLabel.Text = ‘Channel ID’;
% Create ChannelIDEditField
app.ChannelIDEditField = uieditfield(app.LeftPanel, ‘numeric’);
app.ChannelIDEditField.ValueDisplayFormat = ‘%.0f’;
app.ChannelIDEditField.ValueChangedFcn = createCallbackFcn(app, @ChannelIDEditFieldValueChanged, true);
app.ChannelIDEditField.Position = [93 464 55 22];
app.ChannelIDEditField.Value = 543172;
% Create ReadAPIKeyEditFieldLabel
app.ReadAPIKeyEditFieldLabel = uilabel(app.LeftPanel);
app.ReadAPIKeyEditFieldLabel.HorizontalAlignment = ‘right’;
app.ReadAPIKeyEditFieldLabel.Position = [13 434 74 22];
app.ReadAPIKeyEditFieldLabel.Text = ‘ReadAPIKey’;
% Create ReadAPIKeyEditField
app.ReadAPIKeyEditField = uieditfield(app.LeftPanel, ‘text’);
app.ReadAPIKeyEditField.ValueChangedFcn = createCallbackFcn(app, @ReadAPIKeyEditFieldValueChanged, true);
app.ReadAPIKeyEditField.Position = [102 434 100 22];
app.ReadAPIKeyEditField.Value = ‘0BXYOJW16B7R6DMM’;
% Create F4CheckBox
app.F4CheckBox = uicheckbox(app.LeftPanel);
app.F4CheckBox.ValueChangedFcn = createCallbackFcn(app, @F4CheckBoxValueChanged, true);
app.F4CheckBox.Text = ‘F4’;
app.F4CheckBox.Position = [14 178 36 22];
app.F4CheckBox.Value = true;
% Create RightPanel
app.RightPanel = uipanel(app.GridLayout);
app.RightPanel.Layout.Row = 1;
app.RightPanel.Layout.Column = 2;
% Create StatusLabel
app.StatusLabel = uilabel(app.RightPanel);
app.StatusLabel.Position = [2 1 449 22];
app.StatusLabel.Text = ‘Status’;
% Show the figure after all components are created
app.IoTDataExplorerForThingSpeakUIFigure.Visible = ‘on’;
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = IoTDataExplorerForThingSpeakUsingMATLAB
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.IoTDataExplorerForThingSpeakUIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.IoTDataExplorerForThingSpeakUIFigure)
end
end
end
But when we try to run ,we get error:
Unrecognized function or variable ‘updateAppLayout’.
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, …
Error using IoTDataExplorerForThingSpeakUsingMATLAB/createComponents (line 324)
Error while evaluating Figure SizeChangedFcn.
Warning: The following error was caught while executing ‘onCleanup’ class destructor:
Brace indexing is not supported for variables of this type.
Error in cell2mat (line 36)
if isnumeric(c{1}) || ischar(c{1}) || islogical(c{1}) || isstruct(c{1})
Error in onCleanup/delete (line 25)
obj.task();
Warning: The following error was caught while executing ‘onCleanup’ class destructor:
Brace indexing is not supported for variables of this type.
Error in cell2mat (line 36)
if isnumeric(c{1}) || ischar(c{1}) || islogical(c{1}) || isstruct(c{1})
Error in onCleanup/delete (line 25)
obj.task();
Error in onCleanup/delete (line 25)
obj.task();
Error inmatlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event)
(line 62)
newCallback = @(source, event)executeCallback(ams, … > In onCleanup/delete (line 25)
In matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
In matlab.ui.internal.controller/FigureController/handleClientEvent (line 832)
In matlab.ui.internal.controller/FigureController/handleEvent (line 667)
In matlab.ui.internal.controller.WebCanvasContainerController>@(varargin)this.handleEvent(varargin{:}) (line 45)
Unrecognized function or variable ‘updateAppLayout’.
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, …
Error using matlab.ui.internal.controller.FigureController/handleClientEvent (line 832)
Error while evaluating Figure SizeChangedFcn.
>> thingsspeak, iot MATLAB Answers — New Questions
Raspberry Pi support package Install issue after selecting volume
Hi Guys,
This is on OS X 10.11.6
When installing the Raspberry PI support package, after selecting the volume and clicking next I get this error:
"The ‘STRING’ input must be either a char row vector, a cell array of char row vectors, or a string array."
I cannot get any further than this.
Has anyone got any ideas of how to sort this out.
Many thanks
AndyHi Guys,
This is on OS X 10.11.6
When installing the Raspberry PI support package, after selecting the volume and clicking next I get this error:
"The ‘STRING’ input must be either a char row vector, a cell array of char row vectors, or a string array."
I cannot get any further than this.
Has anyone got any ideas of how to sort this out.
Many thanks
Andy Hi Guys,
This is on OS X 10.11.6
When installing the Raspberry PI support package, after selecting the volume and clicking next I get this error:
"The ‘STRING’ input must be either a char row vector, a cell array of char row vectors, or a string array."
I cannot get any further than this.
Has anyone got any ideas of how to sort this out.
Many thanks
Andy raspberry, install MATLAB Answers — New Questions
I have got this message – can’t install MATLAB
Hello,
i tryed to install the software but i got this message:
can someone help me?
thanxHello,
i tryed to install the software but i got this message:
can someone help me?
thanx Hello,
i tryed to install the software but i got this message:
can someone help me?
thanx install MATLAB Answers — New Questions
Cloud Kerberos – Failed to read secrets from the domain
Hi all,
Apologies if this is the wrong place to post this!
I am looking at understanding Cloud Kerberos and the uses behind it, primarily for WHfB for now. Following the guide on the Microsoft page, I get an error when running on the DC
Passwordless security key sign-in to on-premises resources – Microsoft Entra ID | Microsoft Learn
Set-AzureADKerberosServer : Failed to read secrets from the domain TWLAB.LOCAL.
The lab environment has 2 DCs at different sites but replicate between each other without issue.
The process creates an entry in AD but when I run the command below (GA details is an address, just changed for the forum post)
Get-AzureADKerberosServer -Domain $domain -UserPrincipalName “GA details” -DomainCredential $domainCred
I get the output below…
Id : 16451
UserAccount : CN=krbtgt_AzureAD,CN=Users,DC=DOMAIN,DC=LOCAL
ComputerAccount : CN=AzureADKerberos,OU=Domain Controllers,DC=DOMAIN,DC=LOCAL
DisplayName : krbtgt_16451
DomainDnsName : DOMAIN.LOCAL
KeyVersion : 1598799
KeyUpdatedOn : 27/07/2024 06:41:15
KeyUpdatedFrom : PDC.DOMAIN.LOCAL
CloudDisplayName :
CloudDomainDnsName :
CloudId :
CloudKeyVersion :
CloudKeyUpdatedOn :
CloudTrustDisplay :
Can you advise why the secrets aren’t being found and the cloud information not populated?
This is a lab enviroment so if needed, we can get a bit rough with it.
Any help would be welcomed.
Kind regards
Tom
Hi all, Apologies if this is the wrong place to post this! I am looking at understanding Cloud Kerberos and the uses behind it, primarily for WHfB for now. Following the guide on the Microsoft page, I get an error when running on the DCPasswordless security key sign-in to on-premises resources – Microsoft Entra ID | Microsoft Learn Set-AzureADKerberosServer : Failed to read secrets from the domain TWLAB.LOCAL. The lab environment has 2 DCs at different sites but replicate between each other without issue. The process creates an entry in AD but when I run the command below (GA details is an address, just changed for the forum post)Get-AzureADKerberosServer -Domain $domain -UserPrincipalName “GA details” -DomainCredential $domainCred I get the output below…Id : 16451
UserAccount : CN=krbtgt_AzureAD,CN=Users,DC=DOMAIN,DC=LOCAL
ComputerAccount : CN=AzureADKerberos,OU=Domain Controllers,DC=DOMAIN,DC=LOCAL
DisplayName : krbtgt_16451
DomainDnsName : DOMAIN.LOCAL
KeyVersion : 1598799
KeyUpdatedOn : 27/07/2024 06:41:15
KeyUpdatedFrom : PDC.DOMAIN.LOCAL
CloudDisplayName :
CloudDomainDnsName :
CloudId :
CloudKeyVersion :
CloudKeyUpdatedOn :
CloudTrustDisplay : Can you advise why the secrets aren’t being found and the cloud information not populated? This is a lab enviroment so if needed, we can get a bit rough with it. Any help would be welcomed. Kind regardsTom Read More
pop out the vcrt_check just after finish the install
after installing the matlab2010b, it will pop out the VCRT_CHECK.exe. I have no idea what is happening..after installing the matlab2010b, it will pop out the VCRT_CHECK.exe. I have no idea what is happening.. after installing the matlab2010b, it will pop out the VCRT_CHECK.exe. I have no idea what is happening.. install MATLAB Answers — New Questions
How to input pi
How can i enter pi into an equation on matlab?How can i enter pi into an equation on matlab? How can i enter pi into an equation on matlab? pi, cheat sheets MATLAB Answers — New Questions
How to set temp folder for MCR Installer
I am making a Matlab Compile Runtime application on Linux via ‘deploytool’, however when I go to deploy/install my application by running the installer deploytool generates, I am unable to do so as it requires write-access to /tmp (which I don’t have).
I have tried setting a ‘TMP’ environment variable to a workable path for me, which does not seem to change this bevahior (it did change it for running deploytool though).
Any help is appreciated, thanks.I am making a Matlab Compile Runtime application on Linux via ‘deploytool’, however when I go to deploy/install my application by running the installer deploytool generates, I am unable to do so as it requires write-access to /tmp (which I don’t have).
I have tried setting a ‘TMP’ environment variable to a workable path for me, which does not seem to change this bevahior (it did change it for running deploytool though).
Any help is appreciated, thanks. I am making a Matlab Compile Runtime application on Linux via ‘deploytool’, however when I go to deploy/install my application by running the installer deploytool generates, I am unable to do so as it requires write-access to /tmp (which I don’t have).
I have tried setting a ‘TMP’ environment variable to a workable path for me, which does not seem to change this bevahior (it did change it for running deploytool though).
Any help is appreciated, thanks. mcr, install MATLAB Answers — New Questions
In Ap Designer: put new data into a (ui)table
This should be easy… Data comes in from a serial device consisting of a character and a number (time in msec) and I want to insert it into a table on screen.
I’ve got my serial callback working (after much effort) and I thought the next step would be easier. I have created a uitable that is displayed on the screen. Empty at first, called ResultsTable and thus referred to as app.ResultsTable with 2 columns named ‘Event’ and ‘Time’. Everything else about the table is defaulted.
The app.ResultsTable.Data is initially [ ] as expected and as each bit of info comes in I want to add it to the table. Serial callback parsed the input into PType (a character) and PTime (uint32) so why does
app.ResultsTable.Data(app.NextTrial,’Event’) = char(PType);
app.ResultsTable.Data(app.NextTrial,’Time’) = PData;
Give me multiple columns where the number of columns is the ascii value of the character? If PType is ‘A’ I get 64 zeros and then a 65. I’ve tried various combinations of [ PType PData ] ( etc.) { another attempt }. All kinds of complicated merging of multiple tables is described in help but not simply putting new data into a new table within App Designer code (which has to be different than MatLab of course)
And after I get that first row in, I sure hope I can keep adding rows (app.NextTrial is the row index of course) for as long as I have enough memory (maybe 1000 rows?), that I can later export to an excel file or .CSV.
Thanks for the help for an old time C coder new to Matlab.This should be easy… Data comes in from a serial device consisting of a character and a number (time in msec) and I want to insert it into a table on screen.
I’ve got my serial callback working (after much effort) and I thought the next step would be easier. I have created a uitable that is displayed on the screen. Empty at first, called ResultsTable and thus referred to as app.ResultsTable with 2 columns named ‘Event’ and ‘Time’. Everything else about the table is defaulted.
The app.ResultsTable.Data is initially [ ] as expected and as each bit of info comes in I want to add it to the table. Serial callback parsed the input into PType (a character) and PTime (uint32) so why does
app.ResultsTable.Data(app.NextTrial,’Event’) = char(PType);
app.ResultsTable.Data(app.NextTrial,’Time’) = PData;
Give me multiple columns where the number of columns is the ascii value of the character? If PType is ‘A’ I get 64 zeros and then a 65. I’ve tried various combinations of [ PType PData ] ( etc.) { another attempt }. All kinds of complicated merging of multiple tables is described in help but not simply putting new data into a new table within App Designer code (which has to be different than MatLab of course)
And after I get that first row in, I sure hope I can keep adding rows (app.NextTrial is the row index of course) for as long as I have enough memory (maybe 1000 rows?), that I can later export to an excel file or .CSV.
Thanks for the help for an old time C coder new to Matlab. This should be easy… Data comes in from a serial device consisting of a character and a number (time in msec) and I want to insert it into a table on screen.
I’ve got my serial callback working (after much effort) and I thought the next step would be easier. I have created a uitable that is displayed on the screen. Empty at first, called ResultsTable and thus referred to as app.ResultsTable with 2 columns named ‘Event’ and ‘Time’. Everything else about the table is defaulted.
The app.ResultsTable.Data is initially [ ] as expected and as each bit of info comes in I want to add it to the table. Serial callback parsed the input into PType (a character) and PTime (uint32) so why does
app.ResultsTable.Data(app.NextTrial,’Event’) = char(PType);
app.ResultsTable.Data(app.NextTrial,’Time’) = PData;
Give me multiple columns where the number of columns is the ascii value of the character? If PType is ‘A’ I get 64 zeros and then a 65. I’ve tried various combinations of [ PType PData ] ( etc.) { another attempt }. All kinds of complicated merging of multiple tables is described in help but not simply putting new data into a new table within App Designer code (which has to be different than MatLab of course)
And after I get that first row in, I sure hope I can keep adding rows (app.NextTrial is the row index of course) for as long as I have enough memory (maybe 1000 rows?), that I can later export to an excel file or .CSV.
Thanks for the help for an old time C coder new to Matlab. data into table MATLAB Answers — New Questions
How can I hide the black line on the right side of colorbar
Post Content Post Content colorbar, map MATLAB Answers — New Questions
Does Azure provide DDoS protection for its PaaS services?
Hi,
I am working on a project wherein we will deploy Storage Account, KeyVault, ServiceBus, CosmosDB, and SQL DB in our subscription. All these services will be deployed with public access enabled, and we will only add private endpoints for local VNet traffic.
From a security perspective, should I explicitly add DDoS protection to the above-mentioned services, or do they come with built-in DDoS protection?
Example: Would a DDoS attack be able to bring down a Storage Account Blob Service (test.blob.core.windows.net)?
Hi,I am working on a project wherein we will deploy Storage Account, KeyVault, ServiceBus, CosmosDB, and SQL DB in our subscription. All these services will be deployed with public access enabled, and we will only add private endpoints for local VNet traffic.From a security perspective, should I explicitly add DDoS protection to the above-mentioned services, or do they come with built-in DDoS protection?Example: Would a DDoS attack be able to bring down a Storage Account Blob Service (test.blob.core.windows.net)? Read More
2D or 3D from CST to matlab
i work withh pattern function in matlab but i can get the result and only get err i dont know i can use it or not?
i get text from cst like it for 2D
Theta [deg.] Phi [deg.] Abs(Grlz)[dBi ] Abs(Theta)[dBi ] Phase(Theta)[deg.] Abs(Phi )[dBi ] Phase(Phi )[deg.] Ax.Ratio[dB ]
——————————————————————————————————————————————————
-180.000 90.000 -9.255e+00 -1.298e+01 149.214 -1.165e+01 26.420 5.450e+00
-179.900 90.000 -9.239e+00 -1.295e+01 148.947 -1.165e+01 26.368 5.407e+00
-179.800 90.000 -9.224e+00 -1.292e+01 148.681 -1.164e+01 26.315 5.364e+00
-179.700 90.000 -9.208e+00 -1.289e+01 148.418 -1.163e+01 26.263 5.321e+00
.
.
.
179.600 90.000 -9.319e+00 -1.309e+01 150.304 -1.168e+01 26.638 5.627e+00
179.700 90.000 -9.303e+00 -1.306e+01 150.029 -1.168e+01 26.584 5.582e+00
179.800 90.000 -9.287e+00 -1.303e+01 149.755 -1.167e+01 26.530 5.537e+00
179.900 90.000 -9.271e+00 -1.300e+01 149.484 -1.166e+01 26.477 5.493e+00
in above table i only use first three column which means i like to have pattern in constant phi with various theta
in cst i get this pattern and i want get it in matlab
or about 3d
Theta [deg.] Phi [deg.] Abs(Grlz)[dBi ] Abs(Theta)[dBi ] Phase(Theta)[deg.] Abs(Phi )[dBi ] Phase(Phi )[deg.] Ax.Ratio[dB ]
——————————————————————————————————————————————————
-180.000 -90.000 -9.255e+00 -1.298e+01 329.214 -1.165e+01 206.420 5.450e+00
-175.000 -90.000 -1.014e+01 -1.456e+01 345.709 -1.209e+01 209.583 8.372e+00
-170.000 -90.000 -1.106e+01 -1.607e+01 10.515 -1.271e+01 214.066 1.431e+01
.
.
.
170.000 -85.000 -8.273e+00 -1.118e+01 315.069 -1.139e+01 209.010 2.476e+00
175.000 -85.000 -8.594e+00 -1.155e+01 323.022 -1.166e+01 209.504 3.672e+00
.
.
-180.000 -80.000 -9.255e+00 -1.209e+01 338.042 -1.245e+01 214.316 5.450e+00
-175.000 -80.000 -1.012e+01 -1.327e+01 353.629 -1.299e+01 213.416 8.835e+00
-170.000 -80.000 -1.082e+01 -1.409e+01 16.458 -1.358e+01 212.867 1.684e+01
.
.
160.000 90.000 -1.153e+01 -1.477e+01 248.847 -1.431e+01 48.753 1.504e+01
165.000 90.000 -1.162e+01 -1.622e+01 221.795 -1.347e+01 40.323 3.825e+01
170.000 90.000 -1.106e+01 -1.607e+01 190.515 -1.271e+01 34.066 1.431e+01
175.000 90.000 -1.014e+01 -1.456e+01 165.709 -1.209e+01 29.583 8.372e+00
is it posssible to get them from matlab with patten func or other wayi work withh pattern function in matlab but i can get the result and only get err i dont know i can use it or not?
i get text from cst like it for 2D
Theta [deg.] Phi [deg.] Abs(Grlz)[dBi ] Abs(Theta)[dBi ] Phase(Theta)[deg.] Abs(Phi )[dBi ] Phase(Phi )[deg.] Ax.Ratio[dB ]
——————————————————————————————————————————————————
-180.000 90.000 -9.255e+00 -1.298e+01 149.214 -1.165e+01 26.420 5.450e+00
-179.900 90.000 -9.239e+00 -1.295e+01 148.947 -1.165e+01 26.368 5.407e+00
-179.800 90.000 -9.224e+00 -1.292e+01 148.681 -1.164e+01 26.315 5.364e+00
-179.700 90.000 -9.208e+00 -1.289e+01 148.418 -1.163e+01 26.263 5.321e+00
.
.
.
179.600 90.000 -9.319e+00 -1.309e+01 150.304 -1.168e+01 26.638 5.627e+00
179.700 90.000 -9.303e+00 -1.306e+01 150.029 -1.168e+01 26.584 5.582e+00
179.800 90.000 -9.287e+00 -1.303e+01 149.755 -1.167e+01 26.530 5.537e+00
179.900 90.000 -9.271e+00 -1.300e+01 149.484 -1.166e+01 26.477 5.493e+00
in above table i only use first three column which means i like to have pattern in constant phi with various theta
in cst i get this pattern and i want get it in matlab
or about 3d
Theta [deg.] Phi [deg.] Abs(Grlz)[dBi ] Abs(Theta)[dBi ] Phase(Theta)[deg.] Abs(Phi )[dBi ] Phase(Phi )[deg.] Ax.Ratio[dB ]
——————————————————————————————————————————————————
-180.000 -90.000 -9.255e+00 -1.298e+01 329.214 -1.165e+01 206.420 5.450e+00
-175.000 -90.000 -1.014e+01 -1.456e+01 345.709 -1.209e+01 209.583 8.372e+00
-170.000 -90.000 -1.106e+01 -1.607e+01 10.515 -1.271e+01 214.066 1.431e+01
.
.
.
170.000 -85.000 -8.273e+00 -1.118e+01 315.069 -1.139e+01 209.010 2.476e+00
175.000 -85.000 -8.594e+00 -1.155e+01 323.022 -1.166e+01 209.504 3.672e+00
.
.
-180.000 -80.000 -9.255e+00 -1.209e+01 338.042 -1.245e+01 214.316 5.450e+00
-175.000 -80.000 -1.012e+01 -1.327e+01 353.629 -1.299e+01 213.416 8.835e+00
-170.000 -80.000 -1.082e+01 -1.409e+01 16.458 -1.358e+01 212.867 1.684e+01
.
.
160.000 90.000 -1.153e+01 -1.477e+01 248.847 -1.431e+01 48.753 1.504e+01
165.000 90.000 -1.162e+01 -1.622e+01 221.795 -1.347e+01 40.323 3.825e+01
170.000 90.000 -1.106e+01 -1.607e+01 190.515 -1.271e+01 34.066 1.431e+01
175.000 90.000 -1.014e+01 -1.456e+01 165.709 -1.209e+01 29.583 8.372e+00
is it posssible to get them from matlab with patten func or other way i work withh pattern function in matlab but i can get the result and only get err i dont know i can use it or not?
i get text from cst like it for 2D
Theta [deg.] Phi [deg.] Abs(Grlz)[dBi ] Abs(Theta)[dBi ] Phase(Theta)[deg.] Abs(Phi )[dBi ] Phase(Phi )[deg.] Ax.Ratio[dB ]
——————————————————————————————————————————————————
-180.000 90.000 -9.255e+00 -1.298e+01 149.214 -1.165e+01 26.420 5.450e+00
-179.900 90.000 -9.239e+00 -1.295e+01 148.947 -1.165e+01 26.368 5.407e+00
-179.800 90.000 -9.224e+00 -1.292e+01 148.681 -1.164e+01 26.315 5.364e+00
-179.700 90.000 -9.208e+00 -1.289e+01 148.418 -1.163e+01 26.263 5.321e+00
.
.
.
179.600 90.000 -9.319e+00 -1.309e+01 150.304 -1.168e+01 26.638 5.627e+00
179.700 90.000 -9.303e+00 -1.306e+01 150.029 -1.168e+01 26.584 5.582e+00
179.800 90.000 -9.287e+00 -1.303e+01 149.755 -1.167e+01 26.530 5.537e+00
179.900 90.000 -9.271e+00 -1.300e+01 149.484 -1.166e+01 26.477 5.493e+00
in above table i only use first three column which means i like to have pattern in constant phi with various theta
in cst i get this pattern and i want get it in matlab
or about 3d
Theta [deg.] Phi [deg.] Abs(Grlz)[dBi ] Abs(Theta)[dBi ] Phase(Theta)[deg.] Abs(Phi )[dBi ] Phase(Phi )[deg.] Ax.Ratio[dB ]
——————————————————————————————————————————————————
-180.000 -90.000 -9.255e+00 -1.298e+01 329.214 -1.165e+01 206.420 5.450e+00
-175.000 -90.000 -1.014e+01 -1.456e+01 345.709 -1.209e+01 209.583 8.372e+00
-170.000 -90.000 -1.106e+01 -1.607e+01 10.515 -1.271e+01 214.066 1.431e+01
.
.
.
170.000 -85.000 -8.273e+00 -1.118e+01 315.069 -1.139e+01 209.010 2.476e+00
175.000 -85.000 -8.594e+00 -1.155e+01 323.022 -1.166e+01 209.504 3.672e+00
.
.
-180.000 -80.000 -9.255e+00 -1.209e+01 338.042 -1.245e+01 214.316 5.450e+00
-175.000 -80.000 -1.012e+01 -1.327e+01 353.629 -1.299e+01 213.416 8.835e+00
-170.000 -80.000 -1.082e+01 -1.409e+01 16.458 -1.358e+01 212.867 1.684e+01
.
.
160.000 90.000 -1.153e+01 -1.477e+01 248.847 -1.431e+01 48.753 1.504e+01
165.000 90.000 -1.162e+01 -1.622e+01 221.795 -1.347e+01 40.323 3.825e+01
170.000 90.000 -1.106e+01 -1.607e+01 190.515 -1.271e+01 34.066 1.431e+01
175.000 90.000 -1.014e+01 -1.456e+01 165.709 -1.209e+01 29.583 8.372e+00
is it posssible to get them from matlab with patten func or other way pattern, chart, table, antenna MATLAB Answers — New Questions
How Ansys toolbox works?
How ansys toolbox works for making optimization using genetic algorithmHow ansys toolbox works for making optimization using genetic algorithm How ansys toolbox works for making optimization using genetic algorithm ansys, matlab MATLAB Answers — New Questions
Error while installing MATLAB R2021a
While running setup.exe this message appears "Something Unexpected Occurred
There was an error communicating with the backend services". Please provide a way to solve this issue so that i can intall the product.While running setup.exe this message appears "Something Unexpected Occurred
There was an error communicating with the backend services". Please provide a way to solve this issue so that i can intall the product. While running setup.exe this message appears "Something Unexpected Occurred
There was an error communicating with the backend services". Please provide a way to solve this issue so that i can intall the product. error, install MATLAB Answers — New Questions
Tới game bài đổi thưởng, không chỉ là một c
“gây bão” trong thế giới game bài đổi thưởng, không chỉ là một cổng game bài đẳng cấp mà còn là điểm đến của sự đổi mới và sáng tạo. Cổng game Hit Club đẳng cấp nhất năm 2024 với nhiều trò chơi cờ bạc sáng tạo và hấp dẫn. Địa chỉ cá độ này đã được Isle Of Man và đơn vị cá cược PAGCOR cấp giấy chứng nhận. Hitclub – Khám phá thế giới giải trí bất tận. Hitclub100 là một trong những nhà cái uy tín và được yêu thích nhất hiện nay.
”gây bão” trong thế giới game bài đổi thưởng, không chỉ là một cổng game bài đẳng cấp mà còn là điểm đến của sự đổi mới và sáng tạo. Cổng game Hit Club đẳng cấp nhất năm 2024 với nhiều trò chơi cờ bạc sáng tạo và hấp dẫn. Địa chỉ cá độ này đã được Isle Of Man và đơn vị cá cược PAGCOR cấp giấy chứng nhận. Hitclub – Khám phá thế giới giải trí bất tận. Hitclub100 là một trong những nhà cái uy tín và được yêu thích nhất hiện nay. Read More
Azure Static Web Apps Community: Criação de uma App (RAG) com App Spaces e Azure Static Web Apps
No último encontro da Comunidade Azure Static Web Apps através do Canal do Youtube – Microsoft Azure Developers, foi demonstrado como se pode criar uma aplicação de Geração Aumentada por Recuperação (RAG) utilizando o Azure Static Web Apps e o App Spaces.
O evento foi conduzido pelo Dheeraj Bandaru, que é Product Manager do Azure Static Web Apps na Microsoft. Dheeraj contou com a participação do Skyler Hardle, que é Senior Manager do Apps Spaces na Microsoft.
Skyler, apresentou um guia prático sobre a integração entre esses serviços e a implementação de uma aplicação RAG (Retrieval Augmented Generation). A seguir, compartilharei com vocês o que foi abordado durante o evento, detalhando a arquitetura da aplicação e as etapas de desenvolvimento.
Mas, antes precisamos entender esse novo serviço e como ele pode ser útil para a criação de aplicações modernas.
Inclusive, se você deseja assistir ao evento na íntegra, poderá acessar o link abaixo:
O que é o App Spaces?
App Spaces é um serviço inteligente para desenvolvedores que reduz a complexidade de criar e gerenciar aplicações web. Ele ajuda a identificar os serviços corretos para suas aplicações no Azure e proporciona uma experiência de gerenciamento simplificada para o processo de desenvolvimento.
App Spaces também oferece os benefícios de implantar uma aplicação através dos serviços existentes do Azure, como Azure Container Apps e Azure Static Web Apps, com uma experiência focada no desenvolvimento e implantação de forma simplificada e rápida.
Resumindo….
App Spaces é a maneira mais rápida de implantar e gerenciar suas cargas de trabalho de aplicativos inteligentes, sem ser um especialista em nuvem.
O que é Geraçaõ Aumentada por Recuperação (RAG)?
Geração Aumentada por Recuperação (RAG) é uma técnica que combina a recuperação de informações externas com a geração de respostas por modelos de linguagem (LLMs).
Essa abordagem permite enriquecer o contexto dos modelos de IA, proporcionando respostas mais precisas e relevantes. No caso do nosso aplicativo, utilizamos bancos de dados vetoriais para armazenar documentos e embeddings, permitindo uma recuperação eficiente e contextualizada de informações.
Primeiro, alguns conceitos básicos sobre RAG
Os grandes modelos de linguagem (LLMs) como o ChatGPT são treinados com dados públicos disponíveis na internet no momento do treinamento. Eles podem responder a perguntas relacionadas aos dados nos quais foram treinados. No entanto, esses dados públicos podem não ser suficientes para atender a todas as suas necessidades.
Você pode querer respostas baseadas em seus dados privados ou os dados públicos podem simplesmente estar desatualizados. A solução para esse problema é a Geração Aumentada por Recuperação (RAG), um padrão usado em IA que utiliza um LLM para gerar respostas com base em seus próprios dados.
Como o RAG Funciona?
RAG é um padrão que usa seus dados com um LLM para gerar respostas específicas aos seus dados. Quando um usuário faz uma pergunta, o armazenamento de dados é pesquisado com base na entrada do usuário. A pergunta do usuário é então combinada com os resultados correspondentes e enviada ao LLM usando um prompt (instruções explícitas para um modelo de IA ou aprendizado de máquina) para gerar a resposta desejada. Isso pode ser ilustrado da seguinte forma.
A imagem abaixo representa o fluxo de trabalho do RAG:
Se você deseja saber mais sobre o RAG, recomendo a leitura do artigo Geração Aumentada por Recuperação (RAG).
Arquitetura do Aplicativo RAG com App Spaces
No evento, Skyler apresentou a arquitetura do aplicativo RAG que seria desenvolvido durante a apresentação. um frontend em React, um backend em FastAPI e um banco de dados vetorial. Esses componentes trabalham juntos para fornecer uma solução completa e integrada. Abaixo, detalho o funcionamento de cada um desses componentes.
A seguir, detalharei cada um desses componentes.
Frontend com React
O frontend do aplicativo é desenvolvido em React e faz chamadas a um backend FastAPI para buscar e armazenar embeddings em um banco de dados vetorial (Quadrant). A interface do usuário permite inserir perguntas e visualizar as respostas geradas pelo sistema.
Backend com FastAPI
O backend é responsável por duas funcionalidades principais:
Gerar e armazenar embeddings: Utiliza a API de embeddings do OpenAI para gerar vetores a partir do texto fornecido e armazená-los no banco de dados vetorial.
Recuperar e gerar respostas: Busca embeddings relevantes no banco de dados vetorial e utiliza o OpenAI GPT-4 para gerar respostas baseadas nesses embeddings.
Banco de Dados Vetorial
Para a aplicação foi utilizado o Quadrant, um banco de dados vetorial que permite armazenar e recuperar embeddings de forma eficiente. O Quadrant é uma solução escalável e de alto desempenho para aplicações que requerem a recuperação de informações relevantes com base em consultas feitas pelo usuário.
Implementação da Aplicação RAG
Configuração Inicial
Para começar, acesse o App Spaces no portal Azure e selecione a opção para criar um novo ‘space’ de aplicação. Você pode escolher um repositório do GitHub ou utilizar um dos templates fornecidos, como o RAG App. Configure as variáveis de ambiente necessárias, incluindo as chaves da API do OpenAI.
Implantação do Frontend
O frontend da aplicação é uma aplicação React que pode ser implantado no Azure Static Web Apps. Para isso, basta configurar o repositório do GitHub e definir o diretório de saída da aplicação. O Azure Static Web Apps irá criar automaticamente um pipeline de CI/CD para implantar a aplicação.
Configuração e Implantação do Backend
O backend em FastAPI é implantado usando o Azure Container Apps no Azure. Ele manipula as requisições de geração e armazenamento de embeddings, bem como a recuperação e geração de respostas.
Demonstração da Aplicação RAG
Inserindo e Armazenando Texto: O usuário insere um texto no frontend, que é enviado ao backend para gerar e armazenar embeddings no banco de dados vetorial.
Fazendo Perguntas e Recebendo Respostas: O usuário faz perguntas através do frontend, que são processadas pelo backend para buscar embeddings relevantes e gerar respostas utilizando o GPT-4 da OpenAI.
Se desejar saber mais da aplicação desenvolvida no evento, poderá acessar o repositório do GitHub app-spaces-rag-app
Inclusive, Julia Muiruri, que é Developer Advocate na Microsoft, gravou um vídeo sobre a aplicação desenvolvida no evento. Você pode assistir o vídeo abaixo:
Gerenciamento e Extensibilidade
App Spaces facilita a adição de novos componentes a sua aplicação, como novos frontends ou integrações com outros serviços. A interface de gerenciamento permite visualizar logs, métricas e configurar variáveis de ambiente de forma intuitiva.
O mais interessante disso tudo é que independente da linguagem de programação no lado do Backend, você pode utilizar o App Spaces para gerenciar e implantar sua aplicação. Seja você um desenvolvedor Python, .NET, Node.js, Java, Go, etc., o App Spaces é uma excelente opção para gerenciar suas aplicações.
Se desejar ver outros exemplos de aplicações em diferentes linguagens de programação, poderá acessar o repositório do GitHub app-spaces-samples.
E, já recomendo em você começar agora a testar o App Spaces! Você pode começar a testar de forma totalmente gratuita. Acesse agora: AQUI ou clicando na imagem abaixo:
Conclusão
No encontro da comunidade Azure Static Web Apps, aprendemos a criar uma aplicação de Geração Aumentada por Recuperação (RAG) utilizando Azure Static Web Apps e App Spaces. Exploramos a arquitetura da aplicação, configuramos os componentes necessários e implementamos uma solução prática que enriquece o contexto dos modelos de IA, proporcionando respostas mais precisas e relevantes.
Lembrando que você poder rever o evento na íntegra, acessando o link abaixo:
Microsoft Reactor YouTube Channel
Você sabia que temos uma das maiores comunidades com temas diversos sobre tecnologia, nuvem e desenvolvimento de software? Não! Então, você precisa conhecer o Microsoft Reactor.
Além disso conta com inúmeros eventos online, presenciais, workshops, meetups e muito mais. Acesse o link da página oficial do Microsoft Reactor e inscreva-se no canal para ficar por dentro de tudo que acontece na comunidade.
Recursos Adicionais
Gostou do App Spaces? Quer saber mais sobre o serviço e como ele pode ajudar a simplificar o desenvolvimento de aplicações web? Ou melhor, quer aprender através de um tutorial prático como criar uma aplicação com App Spaces?
Deixarei abaixo alguns links que poderão te ajudar a explorar mais sobre o App Spaces e como ele pode ser útil para o desenvolvimento de aplicações modernas.
App Spaces – Documentação Oficial
App Spaces: Building a full-stack app with Google Authentication
Learn About Azure Static Web Apps
Custom authentication in Azure Static Web Apps
Learn more about Azure Container Apps
App Spaces – Try it now!
Quickstart: Deploy your app with App Spaces
Espero que tenha gostado do artigo e que ele tenha sido útil para você. Se tiver alguma dúvida ou sugestão, não hesite em deixar um comentário abaixo.
Até a próxima!
Microsoft Tech Community – Latest Blogs –Read More
Problem in Neural network fitting Matlab R2024a
Hello
I encountered an obstacle in using the Neural Networks window, where after applying NNStart and logging in, I cannot work on the icons at the top of the toolbar, such as training, stopping, training status, etc.
In other words, all icons are inactive.
Please help me resolve this issue.
I am using the trial version with Windows 11
Kind regards.Hello
I encountered an obstacle in using the Neural Networks window, where after applying NNStart and logging in, I cannot work on the icons at the top of the toolbar, such as training, stopping, training status, etc.
In other words, all icons are inactive.
Please help me resolve this issue.
I am using the trial version with Windows 11
Kind regards. Hello
I encountered an obstacle in using the Neural Networks window, where after applying NNStart and logging in, I cannot work on the icons at the top of the toolbar, such as training, stopping, training status, etc.
In other words, all icons are inactive.
Please help me resolve this issue.
I am using the trial version with Windows 11
Kind regards. matlab, nnstart, neural network MATLAB Answers — New Questions
M365 Exchange
Hello
Please i need your help on this issue.
when we try to add an email it gives us error 2002, on mac outlook.
I have tried other email of same domain it works without any issue. This particular domain was in GoDaddy we moved to Azure.
i doubt the autodiscover is going on to wrong server as that email was working on that machine when it was on Godaddy.
Now the same email ID after migration is giving this error. We tried from browser the same email on the same machine its working.
Please its critical how we can resolve this issue.
Hello Please i need your help on this issue. when we try to add an email it gives us error 2002, on mac outlook. I have tried other email of same domain it works without any issue. This particular domain was in GoDaddy we moved to Azure. i doubt the autodiscover is going on to wrong server as that email was working on that machine when it was on Godaddy. Now the same email ID after migration is giving this error. We tried from browser the same email on the same machine its working. Please its critical how we can resolve this issue. Read More
Staff still receiving emails when booked but notification is unticked
Hi,
I have entered a dummy email for one of my staff members. They are still receiving emails as I am getting undeliverable emails in outlook. This is fine as it is a dummy email but I dont want any emails sent to staff. Please help!
Hi, I have entered a dummy email for one of my staff members. They are still receiving emails as I am getting undeliverable emails in outlook. This is fine as it is a dummy email but I dont want any emails sent to staff. Please help! Read More
I need help using the corrcoef function to calculate PRx (pressure reactivity index)
Hi everyone! I need to calculate PRx (pressure reactivity index) using ICP (intracranial pressure) and mean ABP (mean arterial blood pressure) data. PRx is known as "pressure reactivity index is calculated as the degree of statistical correlation between the slow wave components of mean arterial pressure (ABP) and intracranial pressure (ICP)". I need to do this in order to calculate a different hypothetical reactivity index. I have PRx data- so my idea was to use the given PRx data and compare it to the calculated PRx data to ensure it is correct.
This is the script to display the PRx data that was given to me:
%PRx_display
% Load PRx data from MAT file
load(‘PRx,data_part1of1’);
PRx_values = measurement_data;
disp(‘PRx Values:’);
disp(PRx_values);
% Plot PRx values
figure;
plot(PRx_values);
xlabel(‘Time’);
ylabel(‘PRx Value’);
title(‘PRx’);
grid on;
% Calculate average PRx
average_PRx = mean(PRx_values);
% Display average PRx
fprintf(‘Average PRx: %.4f\n’, average_PRx);
This is the script I am trying to calculate PRx with:
%PRx_calc
% Load ICP and MAP data
load("ICP,data_part1of1");
ICP_time_vector = round(time_vector); % Assuming time_vector in ICP file
ICP_data = measurement_data;
load("ABP,mean,data_part1of1");
ABP_time_vector = round(time_vector); % Assuming time_vector in ABP file
ABP_data = measurement_data;
% Remove duplicate time points from ICP
[ICP_time_vector, uniqueIdx] = unique(ICP_time_vector);
ICP_data = ICP_data(uniqueIdx);
% Remove duplicate time points from ABP
[ABP_time_vector, uniqueIdx] = unique(ABP_time_vector);
ABP_data = ABP_data(uniqueIdx);
% Ensure consistent dimensions
if length(ICP_time_vector) ~= length(ICP_data)
error(‘ICP_time_vector and ICP_data have different lengths’);
end
if length(ABP_time_vector) ~= length(ABP_data)
error(‘ABP_time_vector and ABP_data have different lengths’);
end
% Interpolating ABP to match ICP time vector
if ~isequal(ICP_time_vector, ABP_time_vector)
ABP_data = interp1(ABP_time_vector, ABP_data, ICP_time_vector, ‘linear’, ‘extrap’);
end
% Combine ICP data and aligned ABP data
ICP = [ICP_time_vector(:), ICP_data(:)]; % Ensure column vectors
ABP = [ICP_time_vector(:), ABP_data(:)]; % ABP_data is now interpolated to match ICP_time_vector
% Parameters
windowSize = 30 * 10; % 30 windows of 10 seconds
stepSize = 60; % Update every 60 seconds
n = length(ICP_time_vector); % Number of data points
% Preallocate PRx array
PRx = NaN(floor((n – windowSize) / stepSize) + 1, 1);
% Compute moving correlation coefficient
for i = 1:stepSize:(n – windowSize + 1)
% Extract current window of data
windowICP = ICP(i:i + windowSize – 1, 2);
windowABP = ABP(i:i + windowSize – 1, 2);
% Calculate correlation coefficient for the current window
R = corrcoef(windowICP, windowABP);
% Store PRx (correlation coefficient of ICP and ABP)
PRx(floor(i / stepSize) + 1) = R(1, 2);
end
% Calculate average PRx ignoring NaN values
averagePRx = sum(PRx, ‘omitnan’) / sum(~isnan(PRx));
% Display average PRx in the command window
fprintf(‘Average PRx: %.4f\n’, averagePRx);
% Plot PRx vs Time in minutes
figure;
plot((0:length(PRx)-1)*stepSize/60, PRx); % Convert to minutes
title(‘PRx vs Time’);
xlabel(‘Time (minutes)’);
ylabel(‘PRx Values’);
I thought the calculation script would work, but it doesn’t. For instance, for a certain set of data, PRx_calc.m gives me an average PRx value of 0.32, while PRx_display.m gives me 0.52. The trend of the plots look the same, but the PRx_calc.m’s for some reason looks shifted down and distorted a little bit. I am looking for help with the way I am using the corrcoef function and general debugging help.
Here are the first 20 values of each type of data: First 20 values of
ICP: 10 10 10 10 11 11 11 11 10 11 10 11 11 11 11 11 10 11 11 11
First 20 values of
ABP: 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
First 20 calculated
PRx values: NaN NaN NaN NaN NaN NaN -0.0838 -0.2111 -0.0586 0.1704 0.4276 0.3193 0.3417 0.4128 0.5488 0.4790 0.5207 0.6822 0.7107 0.5235
Average PRx: 0.3209
The PRx_calc script, which produces the above values, should produce the given PRx values(below).
First 20 PRx Values: 0.6150 0.5996 0.6010 0.6276 0.7499 0.4495 0.4488 0.4492 0.5078 0.7263 0.7290 0.7343 0.7490 0.7561 0.6997 0.4609 0.2567 0.5935 0.7317 0.6666
Average PRx: 0.5247
Please let me know if there is anything else I should add, more data points, graphs, etc. Thank you!Hi everyone! I need to calculate PRx (pressure reactivity index) using ICP (intracranial pressure) and mean ABP (mean arterial blood pressure) data. PRx is known as "pressure reactivity index is calculated as the degree of statistical correlation between the slow wave components of mean arterial pressure (ABP) and intracranial pressure (ICP)". I need to do this in order to calculate a different hypothetical reactivity index. I have PRx data- so my idea was to use the given PRx data and compare it to the calculated PRx data to ensure it is correct.
This is the script to display the PRx data that was given to me:
%PRx_display
% Load PRx data from MAT file
load(‘PRx,data_part1of1’);
PRx_values = measurement_data;
disp(‘PRx Values:’);
disp(PRx_values);
% Plot PRx values
figure;
plot(PRx_values);
xlabel(‘Time’);
ylabel(‘PRx Value’);
title(‘PRx’);
grid on;
% Calculate average PRx
average_PRx = mean(PRx_values);
% Display average PRx
fprintf(‘Average PRx: %.4f\n’, average_PRx);
This is the script I am trying to calculate PRx with:
%PRx_calc
% Load ICP and MAP data
load("ICP,data_part1of1");
ICP_time_vector = round(time_vector); % Assuming time_vector in ICP file
ICP_data = measurement_data;
load("ABP,mean,data_part1of1");
ABP_time_vector = round(time_vector); % Assuming time_vector in ABP file
ABP_data = measurement_data;
% Remove duplicate time points from ICP
[ICP_time_vector, uniqueIdx] = unique(ICP_time_vector);
ICP_data = ICP_data(uniqueIdx);
% Remove duplicate time points from ABP
[ABP_time_vector, uniqueIdx] = unique(ABP_time_vector);
ABP_data = ABP_data(uniqueIdx);
% Ensure consistent dimensions
if length(ICP_time_vector) ~= length(ICP_data)
error(‘ICP_time_vector and ICP_data have different lengths’);
end
if length(ABP_time_vector) ~= length(ABP_data)
error(‘ABP_time_vector and ABP_data have different lengths’);
end
% Interpolating ABP to match ICP time vector
if ~isequal(ICP_time_vector, ABP_time_vector)
ABP_data = interp1(ABP_time_vector, ABP_data, ICP_time_vector, ‘linear’, ‘extrap’);
end
% Combine ICP data and aligned ABP data
ICP = [ICP_time_vector(:), ICP_data(:)]; % Ensure column vectors
ABP = [ICP_time_vector(:), ABP_data(:)]; % ABP_data is now interpolated to match ICP_time_vector
% Parameters
windowSize = 30 * 10; % 30 windows of 10 seconds
stepSize = 60; % Update every 60 seconds
n = length(ICP_time_vector); % Number of data points
% Preallocate PRx array
PRx = NaN(floor((n – windowSize) / stepSize) + 1, 1);
% Compute moving correlation coefficient
for i = 1:stepSize:(n – windowSize + 1)
% Extract current window of data
windowICP = ICP(i:i + windowSize – 1, 2);
windowABP = ABP(i:i + windowSize – 1, 2);
% Calculate correlation coefficient for the current window
R = corrcoef(windowICP, windowABP);
% Store PRx (correlation coefficient of ICP and ABP)
PRx(floor(i / stepSize) + 1) = R(1, 2);
end
% Calculate average PRx ignoring NaN values
averagePRx = sum(PRx, ‘omitnan’) / sum(~isnan(PRx));
% Display average PRx in the command window
fprintf(‘Average PRx: %.4f\n’, averagePRx);
% Plot PRx vs Time in minutes
figure;
plot((0:length(PRx)-1)*stepSize/60, PRx); % Convert to minutes
title(‘PRx vs Time’);
xlabel(‘Time (minutes)’);
ylabel(‘PRx Values’);
I thought the calculation script would work, but it doesn’t. For instance, for a certain set of data, PRx_calc.m gives me an average PRx value of 0.32, while PRx_display.m gives me 0.52. The trend of the plots look the same, but the PRx_calc.m’s for some reason looks shifted down and distorted a little bit. I am looking for help with the way I am using the corrcoef function and general debugging help.
Here are the first 20 values of each type of data: First 20 values of
ICP: 10 10 10 10 11 11 11 11 10 11 10 11 11 11 11 11 10 11 11 11
First 20 values of
ABP: 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
First 20 calculated
PRx values: NaN NaN NaN NaN NaN NaN -0.0838 -0.2111 -0.0586 0.1704 0.4276 0.3193 0.3417 0.4128 0.5488 0.4790 0.5207 0.6822 0.7107 0.5235
Average PRx: 0.3209
The PRx_calc script, which produces the above values, should produce the given PRx values(below).
First 20 PRx Values: 0.6150 0.5996 0.6010 0.6276 0.7499 0.4495 0.4488 0.4492 0.5078 0.7263 0.7290 0.7343 0.7490 0.7561 0.6997 0.4609 0.2567 0.5935 0.7317 0.6666
Average PRx: 0.5247
Please let me know if there is anything else I should add, more data points, graphs, etc. Thank you! Hi everyone! I need to calculate PRx (pressure reactivity index) using ICP (intracranial pressure) and mean ABP (mean arterial blood pressure) data. PRx is known as "pressure reactivity index is calculated as the degree of statistical correlation between the slow wave components of mean arterial pressure (ABP) and intracranial pressure (ICP)". I need to do this in order to calculate a different hypothetical reactivity index. I have PRx data- so my idea was to use the given PRx data and compare it to the calculated PRx data to ensure it is correct.
This is the script to display the PRx data that was given to me:
%PRx_display
% Load PRx data from MAT file
load(‘PRx,data_part1of1’);
PRx_values = measurement_data;
disp(‘PRx Values:’);
disp(PRx_values);
% Plot PRx values
figure;
plot(PRx_values);
xlabel(‘Time’);
ylabel(‘PRx Value’);
title(‘PRx’);
grid on;
% Calculate average PRx
average_PRx = mean(PRx_values);
% Display average PRx
fprintf(‘Average PRx: %.4f\n’, average_PRx);
This is the script I am trying to calculate PRx with:
%PRx_calc
% Load ICP and MAP data
load("ICP,data_part1of1");
ICP_time_vector = round(time_vector); % Assuming time_vector in ICP file
ICP_data = measurement_data;
load("ABP,mean,data_part1of1");
ABP_time_vector = round(time_vector); % Assuming time_vector in ABP file
ABP_data = measurement_data;
% Remove duplicate time points from ICP
[ICP_time_vector, uniqueIdx] = unique(ICP_time_vector);
ICP_data = ICP_data(uniqueIdx);
% Remove duplicate time points from ABP
[ABP_time_vector, uniqueIdx] = unique(ABP_time_vector);
ABP_data = ABP_data(uniqueIdx);
% Ensure consistent dimensions
if length(ICP_time_vector) ~= length(ICP_data)
error(‘ICP_time_vector and ICP_data have different lengths’);
end
if length(ABP_time_vector) ~= length(ABP_data)
error(‘ABP_time_vector and ABP_data have different lengths’);
end
% Interpolating ABP to match ICP time vector
if ~isequal(ICP_time_vector, ABP_time_vector)
ABP_data = interp1(ABP_time_vector, ABP_data, ICP_time_vector, ‘linear’, ‘extrap’);
end
% Combine ICP data and aligned ABP data
ICP = [ICP_time_vector(:), ICP_data(:)]; % Ensure column vectors
ABP = [ICP_time_vector(:), ABP_data(:)]; % ABP_data is now interpolated to match ICP_time_vector
% Parameters
windowSize = 30 * 10; % 30 windows of 10 seconds
stepSize = 60; % Update every 60 seconds
n = length(ICP_time_vector); % Number of data points
% Preallocate PRx array
PRx = NaN(floor((n – windowSize) / stepSize) + 1, 1);
% Compute moving correlation coefficient
for i = 1:stepSize:(n – windowSize + 1)
% Extract current window of data
windowICP = ICP(i:i + windowSize – 1, 2);
windowABP = ABP(i:i + windowSize – 1, 2);
% Calculate correlation coefficient for the current window
R = corrcoef(windowICP, windowABP);
% Store PRx (correlation coefficient of ICP and ABP)
PRx(floor(i / stepSize) + 1) = R(1, 2);
end
% Calculate average PRx ignoring NaN values
averagePRx = sum(PRx, ‘omitnan’) / sum(~isnan(PRx));
% Display average PRx in the command window
fprintf(‘Average PRx: %.4f\n’, averagePRx);
% Plot PRx vs Time in minutes
figure;
plot((0:length(PRx)-1)*stepSize/60, PRx); % Convert to minutes
title(‘PRx vs Time’);
xlabel(‘Time (minutes)’);
ylabel(‘PRx Values’);
I thought the calculation script would work, but it doesn’t. For instance, for a certain set of data, PRx_calc.m gives me an average PRx value of 0.32, while PRx_display.m gives me 0.52. The trend of the plots look the same, but the PRx_calc.m’s for some reason looks shifted down and distorted a little bit. I am looking for help with the way I am using the corrcoef function and general debugging help.
Here are the first 20 values of each type of data: First 20 values of
ICP: 10 10 10 10 11 11 11 11 10 11 10 11 11 11 11 11 10 11 11 11
First 20 values of
ABP: 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89 89
First 20 calculated
PRx values: NaN NaN NaN NaN NaN NaN -0.0838 -0.2111 -0.0586 0.1704 0.4276 0.3193 0.3417 0.4128 0.5488 0.4790 0.5207 0.6822 0.7107 0.5235
Average PRx: 0.3209
The PRx_calc script, which produces the above values, should produce the given PRx values(below).
First 20 PRx Values: 0.6150 0.5996 0.6010 0.6276 0.7499 0.4495 0.4488 0.4492 0.5078 0.7263 0.7290 0.7343 0.7490 0.7561 0.6997 0.4609 0.2567 0.5935 0.7317 0.6666
Average PRx: 0.5247
Please let me know if there is anything else I should add, more data points, graphs, etc. Thank you! corrcoef MATLAB Answers — New Questions