Month: October 2024
Can’t Link microsoft account to register.
I’m trying to register for the release preview channel, and it shows that im registered and i linked my account, but it still says “Please Link a work, school or microsoft account for full access to the program”.
I’m trying to register for the release preview channel, and it shows that im registered and i linked my account, but it still says “Please Link a work, school or microsoft account for full access to the program”. Read More
anyone correct the below code for solving energy, vorticity eqn using the alternative direct implicit fdm method for which i should get the values of velocitiy at each grid i
% MATLAB code to solve the coupled temperature and vorticity equations using ADI FDM
% Parameters
Pr = 0.733; % Prandtl number
A = 1; % Length of the domain in X direction
Ha = 10; % Hartmann number (can change this to study its influence)
Gr = 2e4; % Grashof number
Nx = 41; % Number of grid points in X direction
Ny = 41; % Number of grid points in Y direction
dx = A/(Nx-1); % Grid spacing in X
dy = 1/(Ny-1); % Grid spacing in Y
dt = 0.001; % Time step size
max_iter = 1000; % Maximum iterations for time-stepping
% Initialize arrays
T = rand(Nx, Ny); % Temperature field
zeta = rand(Nx, Ny); % Vorticity field
Psi = rand(Nx, Ny); % Stream function
U = rand(Nx, Ny); % X-component of velocity
V = rand(Nx, Ny); % Y-component of velocity
% Boundary conditions for Psi and T
T(:,1) = -1; % At Y = 0, T = -1
T(:,end) = 1; % At Y = 1, T = 1
Psi(:,1) = 0; Psi(:,end) = 0; % Stream function at Y boundaries
Psi(1,:) = 0; Psi(end,:) = 0; % Stream function at X boundaries
% Time-stepping loop
for iter = 1:max_iter
% Compute velocities U and V from stream function Psi
for i = 2:Nx-1
for j = 2:Ny-1
U(i,j) = (Psi(i,j+1) – Psi(i,j-1))/(2*dy); % U = dPsi/dY
V(i,j) = -(Psi(i+1,j) – Psi(i-1,j))/(2*dx); % V = -dPsi/dX
end
end
% Solve for temperature T using ADI method (X-direction first)
for j = 2:Ny-1
for i = 2:Nx-1
T(i,j) = T(i,j) + dt * ( …
-(U(i,j) * (T(i+1,j) – T(i-1,j))/(2*dx)) – … % Advection term (X)
(V(i,j) * (T(i,j+1) – T(i,j-1))/(2*dy)) + … % Advection term (Y)
(1/Pr) * ((T(i+1,j) – 2*T(i,j) + T(i-1,j))/(dx^2) + … % Diffusion (X)
(T(i,j+1) – 2*T(i,j) + T(i,j-1))/(dy^2)) ); % Diffusion (Y)
end
end
% Solve for vorticity zeta using ADI method (Y-direction next)
for j = 2:Ny-1
for i = 2:Nx-1
zeta(i,j) = zeta(i,j) + dt * ( …
-(U(i,j) * (zeta(i+1,j) – zeta(i-1,j))/(2*dx)) – … % Advection (X)
(V(i,j) * (zeta(i,j+1) – zeta(i,j-1))/(2*dy)) + … % Advection (Y)
(Gr/2) * (T(i,j+1) – T(i,j))/(dy) + … % Buoyancy effect
((zeta(i+1,j) – 2*zeta(i,j) + zeta(i-1,j))/(dx^2) + … % Diffusion (X)
(zeta(i,j+1) – 2*zeta(i,j) + zeta(i,j-1))/(dy^2)) – … % Diffusion (Y)
Ha^2 * (V(i+1,j) – V(i-1,j))/(2*dx) ); % Hartmann term
end
end
% Enforce boundary conditions on Psi
Psi(:,1) = 0; Psi(:,end) = 0; % At Y boundaries
Psi(1,:) = 0; Psi(end,:) = 0; % At X boundaries
% Enforce boundary conditions on T
T(:,1) = -1; % At Y = 0
T(:,end) = 1; % At Y = 1
T(1,:) = T(2,:); % Neumann BC at X = 0
T(end,:) = T(end-1,:); % Neumann BC at X = A
% Optional: Display or store the solution at certain intervals
if mod(iter, 100) == 0
fprintf(‘Iteration %dn’, iter);
end
end
% Final solution display – Single graph with subplots for T and Psi
figure;
subplot(1,2,1);
contourf(linspace(0,A,Nx), linspace(0,1,Ny), T’, 20); colorbar;
title(‘Temperature Distribution T’);
xlabel(‘X’); ylabel(‘Y’);
subplot(1,2,2);
streamslice(linspace(0,A,Nx), linspace(0,1,Ny), U’, V’); % Plot streamlines for velocity
title(‘Streamlines – Fluid Flow’);
xlabel(‘X’); ylabel(‘Y’);% MATLAB code to solve the coupled temperature and vorticity equations using ADI FDM
% Parameters
Pr = 0.733; % Prandtl number
A = 1; % Length of the domain in X direction
Ha = 10; % Hartmann number (can change this to study its influence)
Gr = 2e4; % Grashof number
Nx = 41; % Number of grid points in X direction
Ny = 41; % Number of grid points in Y direction
dx = A/(Nx-1); % Grid spacing in X
dy = 1/(Ny-1); % Grid spacing in Y
dt = 0.001; % Time step size
max_iter = 1000; % Maximum iterations for time-stepping
% Initialize arrays
T = rand(Nx, Ny); % Temperature field
zeta = rand(Nx, Ny); % Vorticity field
Psi = rand(Nx, Ny); % Stream function
U = rand(Nx, Ny); % X-component of velocity
V = rand(Nx, Ny); % Y-component of velocity
% Boundary conditions for Psi and T
T(:,1) = -1; % At Y = 0, T = -1
T(:,end) = 1; % At Y = 1, T = 1
Psi(:,1) = 0; Psi(:,end) = 0; % Stream function at Y boundaries
Psi(1,:) = 0; Psi(end,:) = 0; % Stream function at X boundaries
% Time-stepping loop
for iter = 1:max_iter
% Compute velocities U and V from stream function Psi
for i = 2:Nx-1
for j = 2:Ny-1
U(i,j) = (Psi(i,j+1) – Psi(i,j-1))/(2*dy); % U = dPsi/dY
V(i,j) = -(Psi(i+1,j) – Psi(i-1,j))/(2*dx); % V = -dPsi/dX
end
end
% Solve for temperature T using ADI method (X-direction first)
for j = 2:Ny-1
for i = 2:Nx-1
T(i,j) = T(i,j) + dt * ( …
-(U(i,j) * (T(i+1,j) – T(i-1,j))/(2*dx)) – … % Advection term (X)
(V(i,j) * (T(i,j+1) – T(i,j-1))/(2*dy)) + … % Advection term (Y)
(1/Pr) * ((T(i+1,j) – 2*T(i,j) + T(i-1,j))/(dx^2) + … % Diffusion (X)
(T(i,j+1) – 2*T(i,j) + T(i,j-1))/(dy^2)) ); % Diffusion (Y)
end
end
% Solve for vorticity zeta using ADI method (Y-direction next)
for j = 2:Ny-1
for i = 2:Nx-1
zeta(i,j) = zeta(i,j) + dt * ( …
-(U(i,j) * (zeta(i+1,j) – zeta(i-1,j))/(2*dx)) – … % Advection (X)
(V(i,j) * (zeta(i,j+1) – zeta(i,j-1))/(2*dy)) + … % Advection (Y)
(Gr/2) * (T(i,j+1) – T(i,j))/(dy) + … % Buoyancy effect
((zeta(i+1,j) – 2*zeta(i,j) + zeta(i-1,j))/(dx^2) + … % Diffusion (X)
(zeta(i,j+1) – 2*zeta(i,j) + zeta(i,j-1))/(dy^2)) – … % Diffusion (Y)
Ha^2 * (V(i+1,j) – V(i-1,j))/(2*dx) ); % Hartmann term
end
end
% Enforce boundary conditions on Psi
Psi(:,1) = 0; Psi(:,end) = 0; % At Y boundaries
Psi(1,:) = 0; Psi(end,:) = 0; % At X boundaries
% Enforce boundary conditions on T
T(:,1) = -1; % At Y = 0
T(:,end) = 1; % At Y = 1
T(1,:) = T(2,:); % Neumann BC at X = 0
T(end,:) = T(end-1,:); % Neumann BC at X = A
% Optional: Display or store the solution at certain intervals
if mod(iter, 100) == 0
fprintf(‘Iteration %dn’, iter);
end
end
% Final solution display – Single graph with subplots for T and Psi
figure;
subplot(1,2,1);
contourf(linspace(0,A,Nx), linspace(0,1,Ny), T’, 20); colorbar;
title(‘Temperature Distribution T’);
xlabel(‘X’); ylabel(‘Y’);
subplot(1,2,2);
streamslice(linspace(0,A,Nx), linspace(0,1,Ny), U’, V’); % Plot streamlines for velocity
title(‘Streamlines – Fluid Flow’);
xlabel(‘X’); ylabel(‘Y’); % MATLAB code to solve the coupled temperature and vorticity equations using ADI FDM
% Parameters
Pr = 0.733; % Prandtl number
A = 1; % Length of the domain in X direction
Ha = 10; % Hartmann number (can change this to study its influence)
Gr = 2e4; % Grashof number
Nx = 41; % Number of grid points in X direction
Ny = 41; % Number of grid points in Y direction
dx = A/(Nx-1); % Grid spacing in X
dy = 1/(Ny-1); % Grid spacing in Y
dt = 0.001; % Time step size
max_iter = 1000; % Maximum iterations for time-stepping
% Initialize arrays
T = rand(Nx, Ny); % Temperature field
zeta = rand(Nx, Ny); % Vorticity field
Psi = rand(Nx, Ny); % Stream function
U = rand(Nx, Ny); % X-component of velocity
V = rand(Nx, Ny); % Y-component of velocity
% Boundary conditions for Psi and T
T(:,1) = -1; % At Y = 0, T = -1
T(:,end) = 1; % At Y = 1, T = 1
Psi(:,1) = 0; Psi(:,end) = 0; % Stream function at Y boundaries
Psi(1,:) = 0; Psi(end,:) = 0; % Stream function at X boundaries
% Time-stepping loop
for iter = 1:max_iter
% Compute velocities U and V from stream function Psi
for i = 2:Nx-1
for j = 2:Ny-1
U(i,j) = (Psi(i,j+1) – Psi(i,j-1))/(2*dy); % U = dPsi/dY
V(i,j) = -(Psi(i+1,j) – Psi(i-1,j))/(2*dx); % V = -dPsi/dX
end
end
% Solve for temperature T using ADI method (X-direction first)
for j = 2:Ny-1
for i = 2:Nx-1
T(i,j) = T(i,j) + dt * ( …
-(U(i,j) * (T(i+1,j) – T(i-1,j))/(2*dx)) – … % Advection term (X)
(V(i,j) * (T(i,j+1) – T(i,j-1))/(2*dy)) + … % Advection term (Y)
(1/Pr) * ((T(i+1,j) – 2*T(i,j) + T(i-1,j))/(dx^2) + … % Diffusion (X)
(T(i,j+1) – 2*T(i,j) + T(i,j-1))/(dy^2)) ); % Diffusion (Y)
end
end
% Solve for vorticity zeta using ADI method (Y-direction next)
for j = 2:Ny-1
for i = 2:Nx-1
zeta(i,j) = zeta(i,j) + dt * ( …
-(U(i,j) * (zeta(i+1,j) – zeta(i-1,j))/(2*dx)) – … % Advection (X)
(V(i,j) * (zeta(i,j+1) – zeta(i,j-1))/(2*dy)) + … % Advection (Y)
(Gr/2) * (T(i,j+1) – T(i,j))/(dy) + … % Buoyancy effect
((zeta(i+1,j) – 2*zeta(i,j) + zeta(i-1,j))/(dx^2) + … % Diffusion (X)
(zeta(i,j+1) – 2*zeta(i,j) + zeta(i,j-1))/(dy^2)) – … % Diffusion (Y)
Ha^2 * (V(i+1,j) – V(i-1,j))/(2*dx) ); % Hartmann term
end
end
% Enforce boundary conditions on Psi
Psi(:,1) = 0; Psi(:,end) = 0; % At Y boundaries
Psi(1,:) = 0; Psi(end,:) = 0; % At X boundaries
% Enforce boundary conditions on T
T(:,1) = -1; % At Y = 0
T(:,end) = 1; % At Y = 1
T(1,:) = T(2,:); % Neumann BC at X = 0
T(end,:) = T(end-1,:); % Neumann BC at X = A
% Optional: Display or store the solution at certain intervals
if mod(iter, 100) == 0
fprintf(‘Iteration %dn’, iter);
end
end
% Final solution display – Single graph with subplots for T and Psi
figure;
subplot(1,2,1);
contourf(linspace(0,A,Nx), linspace(0,1,Ny), T’, 20); colorbar;
title(‘Temperature Distribution T’);
xlabel(‘X’); ylabel(‘Y’);
subplot(1,2,2);
streamslice(linspace(0,A,Nx), linspace(0,1,Ny), U’, V’); % Plot streamlines for velocity
title(‘Streamlines – Fluid Flow’);
xlabel(‘X’); ylabel(‘Y’); #cfd #fdm #adi MATLAB Answers — New Questions
VBA and writing to Sharepoint files
Is it possible to write to an Excel file that is online (Sharepoint) using VBA?
I have a bunch of Excel “applications” from which I would like to push data onto a shared Excel file so my colleagues and I can use the desktop version of the “applications” on our own machines, and have the data we generate pushed up to a shared file that can be viewed by everyone (non-users, ie management) who can then create their own reports and such from.
Is it possible to write to an Excel file that is online (Sharepoint) using VBA? I have a bunch of Excel “applications” from which I would like to push data onto a shared Excel file so my colleagues and I can use the desktop version of the “applications” on our own machines, and have the data we generate pushed up to a shared file that can be viewed by everyone (non-users, ie management) who can then create their own reports and such from. Read More
Learn Live GitHub Foundations – Desenvolvendo Projetos Colaborativos no GitHub
Durante o mês de Outubro está acontecendo o evento Learn Live GitHub Foundations, uma série de lives com o objetivo de ensinar de graça sobre o GitHub e te auxiliar a conquistar sua certificação.
O evento contará com 4 aulas ao vivo acompanhado com uma trilha de estudos visando justamente te preparar para a certificação GitHub Foundations.
A Developer Advocate Cynthia Zanoni, a organizadora do evento, explicou de forma bem detalhada sobre como será essa série de eventos que estará ocorrendo entre os dias 01 a 22 de Outubro.
Para saber mais sobre a série recomendo a leitura do artigo Conquiste a Certificação GitHub Foundations
Visão Geral das Próximas Lives
A Cynthia Zanoni, durante o evento, explicou que as lives serão divididas em 4 episódios, sendo eles:
Primeiro Episódio: Desenvolvimento de projetos colaborativos no GitHub.
Segundo Episódio: Uso do GitHub Actions para automação de pipelines, deploys e testes.
Terceiro Episódio: Segurança em projetos no GitHub utilizando o GitHub Advanced Security.
Quarto Episódio: Certificação GitHub Copilot, com dicas práticas para aproveitar ao máximo essa ferramenta.
E se quiser saber mais sobre as próximas lives, a Cynthia Zanoni informou o que vem por aí:
Mas, hoje o foco será para falar sobre a primeira live que ocorreu no dia 01 de Outubro, a qual foi ministrada pelo Daniel Reis, que é Developer Advocate na ScyllaDB e Microsoft MVP e Sthefany Sther que é Software Developer na Carcará e Partner na Live Streamer na Twitch.
Vamos agora revisar os pontos altos abordados durante a live, incluindo boas práticas de versionamento, como colaborar de maneira eficaz repositórios open source e o uso de funcionalidades do GitHub, como issues e pull requests.
Introdução ao GitHub e ao Desenvolvimento Colaborativo
Antes de mais nada, se você perdeu a live, não se preocupe, pois a mesma está disponível no canal do YouTube da Microsoft Reactor e poderá ser assistida agora mesmo:
O que é o GitHub?
Bom, para quem está começando, o GitHub é uma plataforma essencial para versionamento de código e desenvolvimento colaborativo. Durante a live, Daniel e Sthefany falaram sobre como o GitHub é uma ferramenta poderosa para desenvolvedores, e como é importante entender como usá-lo de forma eficaz. Também falaram sobre como criar e manter repositórios, entender a estrutura de pastas, e, principalmente, como fazer contribuições valiosas para projetos que você admira.
Objetivos de Aprendizado
Durante a live, foram definidos alguns objetivos de aprendizado, que incluíram os principais tópicos explorados durante a sessão. Vejamos agora os principais pontos abordados!
Overview: Funcionalidades de um Repositório
Nesta seção, foi abordado o propósito de um repositório no GitHub, explicando suas funcionalidades principais e como utilizá-las de forma eficiente em projetos colaborativos. Foram apresentados elementos básicos de um repositório, como o código principal, os issues, pull requests, e outras áreas essenciais. Essas funcionalidades permitem gerenciar e organizar o desenvolvimento de um projeto de maneira mais estruturada e colaborativa.
Segurança e Licenciamento
Outro ponto abordado foi a importância de definir uma licença para o seu projeto, como MIT ou GPL, que definem como o código pode ser usado por terceiros.
Também foi discutido sobre o arquivo SECURITY.md, que orienta como reportar falhas de segurança de maneira responsável, garantindo que vulnerabilidades sejam tratadas corretamente sem expor o projeto desnecessariamente.
Vejamos alguns arquivos importantes que foram abordados durante a live:
Criação de Repositórios: Começamos criando um repositório do zero no GitHub, onde foi mostrado como adicionar um arquivo README.md. Este arquivo é a base de qualquer projeto bem documentado, descrevendo o que ele faz, as tecnologias utilizadas, como instalar, e outras informações importantes para quem deseja contribuir.
Código de Conduta: A Sthefany falou sobre a importância de ter um código de conduta em projetos open source, que estabelece as normas de comportamento dentro do projeto, garantindo que todos os colaboradores tenham um ambiente saudável e produtivo.
LICENSE (licença): Daniel falou sobre a importância de escolher uma licença para o seu projeto, que define como o código pode ser utilizado por outras pessoas. Existem várias licenças disponíveis, como a MIT, Apache, GPL, entre outras, e é importante escolher a que melhor se adequa às suas necessidades.
Outro ponto abordado foi a importância de definir uma licença para o seu projeto, como MIT ou GPL, que definem como o código pode ser usado por terceiros. Também foi discutido sobre o arquivo SECURITY.md, que orienta como reportar falhas de segurança de maneira responsável, garantindo que vulnerabilidades sejam tratadas corretamente sem expor o projeto desnecessariamente.
Logo após explicar sobre a importância de cada um desses arquivos, Daniel e Sthefany fizeram uma demonstração prática de como criar um repositório no GitHub, adicionando um arquivo README.md, CODE_OF_CONDUCT.md, LICENSE e SECURITY.md entre outros arquivos.
Branches: Um Universo Dentro de Outro
O que seria um branch? Durante a live, Daniel e Sthefany explicaram que um branch é uma ramificação do projeto principal, onde você pode trabalhar em novas funcionalidades, correções de bugs, ou qualquer outra alteração sem interferir no código principal. Isso permite que você desenvolva novas funcionalidades de forma isolada, testando e validando antes de integrar ao projeto principal.
E, novamente, foi feita uma demonstração prática de como criar um branch no GitHub, fazer alterações, e criar um pull request para integrar as mudanças ao projeto principal.
Issues: Organize suas Ideias
O que são issues? Durante a live, Daniel e Sthefany explicaram que issues são uma forma de organizar e gerenciar tarefas, bugs, e outras atividades em um projeto. Elas permitem que você crie, atribua, e acompanhe o progresso de tarefas de forma colaborativa, mantendo todos os envolvidos informados sobre o que está acontecendo no projeto.
Os issues foram destacados como uma ferramenta para organizar ideias, relatar problemas e discutir novas funcionalidades. Durante a live, enfatizou-se a importância de documentar bem cada issue, detalhando o contexto e os passos para reproduzir o problema. Além disso, foram demonstradas as boas práticas de uso das labels para categorizar os issues, como:
bug: para problemas de código
documentação: para melhorias na documentação
good first issue (para iniciantes): para tarefas mais simples e acessíveis a novos colaboradores
Ao criar as labels ajuda a organizar e priorizar as tarefas, facilitando a colaboração e o desenvolvimento do projeto.
E, claro, foi feita uma demonstração prática de como criar issues no GitHub, atribuir a colaboradores, e acompanhar o progresso das tarefas.
Pull Requests: Contribua com o Código
O que são pull requests? Durante a live, Daniel e Sthefany explicaram que pull requests são uma forma de propor mudanças em um projeto, permitindo que você contribua com código, correções, ou qualquer outra alteração. Eles são a base para a colaboração em projetos open source, permitindo que desenvolvedores proponham mudanças e que estas sejam revisadas antes de serem integradas ao projeto principal.
Os pull requests são a base para a colaboração em um projeto GitHub. Eles permitem que desenvolvedores proponham mudanças e que estas sejam revisadas antes de serem mescladas no branch principal.
Destacou-se como o feedback deve ser dado de forma construtiva, oferecendo sugestões detalhadas e evitando críticas pessoais. Diferentes tipos de status de pull requests, como “aberto”, “rascunho”, e “fechado”, também foram apresentados.
Daniel reis demonstrou como criar um pull request e enfatizou a importância das revisões de código (code reviews).
Boas Práticas de Versionamento
Durante a live, Stephany compartilhou experiências pessoais que ilustraram a importância do versionamento e das revisões de código. Ela mencionou como um erro ao não testar adequadamente uma modificação resultou na queda de um e-commerce por seis minutos. Isso destacou a necessidade de se seguir um processo rigoroso de revisão de código e testes antes de fazer qualquer merge para a branch principal.
Markdown: A Linguagem de Marcação Simples
Durante a live, Daniel e Sthefany explicaram como o Markdown é uma linguagem de marcação simples e eficaz para criar documentos, como o README.md. Eles demonstraram como usar o Markdown para adicionar formatação, links, imagens, e outros elementos ao arquivo README.md, tornando-o mais atraente e informativo para os colaboradores.
O Markdown é uma ferramenta poderosa para documentar projetos, e é essencial para quem deseja contribuir para projetos open source.
Próximos Passos
A série Learn Live está apenas começando, e esse primeiro episódio nos deu uma visão prática de como colaborar de maneira eficaz no GitHub.
É essencial para qualquer desenvolvedor, iniciante ou experiente, entender como contribuir para projetos open source, como manter um repositório organizado, e como garantir a qualidade do código através de boas práticas de versionamento e revisão.
No próximo episódio, vamos explorar o GitHub Actions, que é uma poderosa ferramenta para automatizar processos de desenvolvimento, desde testes automatizados até deploys contínuos. Não perca essa oportunidade de levar suas habilidades de colaboração e automação para o próximo nível.
Se você deseja aprender mais, não deixa de conferir os conteúdos relacionados a série de vídeos do Learn Live em: https://aka.ms/learn/github
Certificação GitHub Foundations
Se você é estudante, vale lembrar que o GitHub Student Developer Pack oferece acesso gratuito à certificação GitHub Foundations e ao GitHub Copilot, além de outros benefícios. Essa é uma excelente oportunidade para expandir seus conhecimentos e enriquecer seu currículo.
Lembrando que, todo o material está disponível no Microsoft Learn, uma plataforma onde você pode aprender de forma gratuita sobre diversos temas, incluindo GitHub, Azure, e muito mais. Aproveite essa oportunidade para aprimorar suas habilidades e se preparar para o mercado de trabalho.
Link: Curso Grátis – Gerenciando alterações de repositório usando solicitações de Pull no GitHub
Conclusão
Esperamos que tenha gostado do resumo do primeiro episódio de Learn Live GitHub Foundations. Fique ligado para os próximos episódios, onde vamos explorar mais a fundo as funcionalidades do GitHub e como você pode se tornar um colaborador ativo em projetos open source.
E, se você tiver alguma dúvida ou sugestão, não hesite em compartilhar nos comentários. Estamos aqui para te ajudar a conquistar suas metas de aprendizado e desenvolvimento profissional.
Até a próxima live! 😎
Microsoft Tech Community – Latest Blogs –Read More
get values from rapid accelerator build summary
I have a Simulink model I run routinely in rapid accelerator mode. The performance is great, but the build process sometimes encounters strange errors. To troubleshoot that, I would like my script to be able to extract information from the text build summary printed to the console. In particular, I want the three numbers from the line that says "1 of 16 models built (9 models already up to date)", so I can branch on them, like this:
try
rtp = Simulink.BlockDiagram.buildRapidAcceleratorTarget("ModelName")
catch ME
[built, total, done] = something(?);
if done < total
if built > 0
call_self_again()
else
do_something_different()
end
else
report_success_anyway()
end
end
What something can I use to tell me the values of built, total, and done?I have a Simulink model I run routinely in rapid accelerator mode. The performance is great, but the build process sometimes encounters strange errors. To troubleshoot that, I would like my script to be able to extract information from the text build summary printed to the console. In particular, I want the three numbers from the line that says "1 of 16 models built (9 models already up to date)", so I can branch on them, like this:
try
rtp = Simulink.BlockDiagram.buildRapidAcceleratorTarget("ModelName")
catch ME
[built, total, done] = something(?);
if done < total
if built > 0
call_self_again()
else
do_something_different()
end
else
report_success_anyway()
end
end
What something can I use to tell me the values of built, total, and done? I have a Simulink model I run routinely in rapid accelerator mode. The performance is great, but the build process sometimes encounters strange errors. To troubleshoot that, I would like my script to be able to extract information from the text build summary printed to the console. In particular, I want the three numbers from the line that says "1 of 16 models built (9 models already up to date)", so I can branch on them, like this:
try
rtp = Simulink.BlockDiagram.buildRapidAcceleratorTarget("ModelName")
catch ME
[built, total, done] = something(?);
if done < total
if built > 0
call_self_again()
else
do_something_different()
end
else
report_success_anyway()
end
end
What something can I use to tell me the values of built, total, and done? rapid accelerator, build summary MATLAB Answers — New Questions
troubleshoot rapid accelerator build process
I have a Simulink model I run routinely in rapid accelerator mode. My problem is the build process is strangely inconsistent. Sometimes, when I call Simulink.BlockDiagram.buildRapidAcceleratorTarget, everything goes smoothly, and builds all in one call. Other times, the same call only builds one sub-model at a time, and raises an error, but eventually succeeds when I up-arrow and hit return on the same build command, 16 times in a row. I am trying to figure out what Simulink and I are doing differently in the two cases, but I am just not seeing it.
My most recent clue is the file build times. When all is well, the overall build process from a blank slate takes about 5 minutes. When I look at the times from a build that went poorly, mexa64 files and slxc files are interleaved, one of each for each sub-model. When I look at the times from a build that went smoothly, all 16 mexa64 files are older than all of the slxc files.
Can anyone tell me what might be causing rapid accelerator to only sometimes build all the mexas first, or how I can convince it to do that every time?I have a Simulink model I run routinely in rapid accelerator mode. My problem is the build process is strangely inconsistent. Sometimes, when I call Simulink.BlockDiagram.buildRapidAcceleratorTarget, everything goes smoothly, and builds all in one call. Other times, the same call only builds one sub-model at a time, and raises an error, but eventually succeeds when I up-arrow and hit return on the same build command, 16 times in a row. I am trying to figure out what Simulink and I are doing differently in the two cases, but I am just not seeing it.
My most recent clue is the file build times. When all is well, the overall build process from a blank slate takes about 5 minutes. When I look at the times from a build that went poorly, mexa64 files and slxc files are interleaved, one of each for each sub-model. When I look at the times from a build that went smoothly, all 16 mexa64 files are older than all of the slxc files.
Can anyone tell me what might be causing rapid accelerator to only sometimes build all the mexas first, or how I can convince it to do that every time? I have a Simulink model I run routinely in rapid accelerator mode. My problem is the build process is strangely inconsistent. Sometimes, when I call Simulink.BlockDiagram.buildRapidAcceleratorTarget, everything goes smoothly, and builds all in one call. Other times, the same call only builds one sub-model at a time, and raises an error, but eventually succeeds when I up-arrow and hit return on the same build command, 16 times in a row. I am trying to figure out what Simulink and I are doing differently in the two cases, but I am just not seeing it.
My most recent clue is the file build times. When all is well, the overall build process from a blank slate takes about 5 minutes. When I look at the times from a build that went poorly, mexa64 files and slxc files are interleaved, one of each for each sub-model. When I look at the times from a build that went smoothly, all 16 mexa64 files are older than all of the slxc files.
Can anyone tell me what might be causing rapid accelerator to only sometimes build all the mexas first, or how I can convince it to do that every time? rapid accelerator MATLAB Answers — New Questions
How do I create dual sliders to filter data?
Hello,
Is there a way to create dual slider filters?
For example, if I have 3 columns with 100 rows each with numbers 1 to 100, I want to filter the rows using sliders (or if there is better way, please suggest) which meet the following criteria:
Column 1: numbers between 30-70
Column 2: numbers between 50-85
Column 3: numbers between 40-55
Once the sliders are selected, I want the rows which match all three of the criteria shown above to be displayed.
Is there a way to do this in Excel?
Hello, Is there a way to create dual slider filters? For example, if I have 3 columns with 100 rows each with numbers 1 to 100, I want to filter the rows using sliders (or if there is better way, please suggest) which meet the following criteria:Column 1: numbers between 30-70Column 2: numbers between 50-85Column 3: numbers between 40-55Once the sliders are selected, I want the rows which match all three of the criteria shown above to be displayed. Is there a way to do this in Excel? Read More
Sampling time of matlab figure data
I have some real time experiment data saved in matlab figures. While saving the data in simulink scope, the sampling time was set as the inherited sampling time of ‘-1’. Now, I have those scope data saved as only matlab figures. Is it possible to change the sampling time of the saved data to 0.1? Without changing the scope settings and running the real time experiment again?I have some real time experiment data saved in matlab figures. While saving the data in simulink scope, the sampling time was set as the inherited sampling time of ‘-1’. Now, I have those scope data saved as only matlab figures. Is it possible to change the sampling time of the saved data to 0.1? Without changing the scope settings and running the real time experiment again? I have some real time experiment data saved in matlab figures. While saving the data in simulink scope, the sampling time was set as the inherited sampling time of ‘-1’. Now, I have those scope data saved as only matlab figures. Is it possible to change the sampling time of the saved data to 0.1? Without changing the scope settings and running the real time experiment again? simulink, sampling time matlab figure data MATLAB Answers — New Questions
Only the first if-statement block executes,
Hi there!
I wrote an if-statement, followed by an if-else statement, followed by another if-else statement, followed by the end keyword.
The goal is to use different formulas for different values of alpha, something like the below.
However, it seems that only the first if-statement block executes — for all possible values of alpha, even when alpha already exceeds that interval.
Where is my mistake? Thanks in advance.
alpha = linspace(0,3*pi/2,1000)
if 0 <= alpha <= pi/2
vx = …;
vy = …;
elseif pi/2 < alpha <= pi
vx = …;
vy = …;
elseif pi < alpha <= 3*pi/2
vx = …;
vy = …;
endHi there!
I wrote an if-statement, followed by an if-else statement, followed by another if-else statement, followed by the end keyword.
The goal is to use different formulas for different values of alpha, something like the below.
However, it seems that only the first if-statement block executes — for all possible values of alpha, even when alpha already exceeds that interval.
Where is my mistake? Thanks in advance.
alpha = linspace(0,3*pi/2,1000)
if 0 <= alpha <= pi/2
vx = …;
vy = …;
elseif pi/2 < alpha <= pi
vx = …;
vy = …;
elseif pi < alpha <= 3*pi/2
vx = …;
vy = …;
end Hi there!
I wrote an if-statement, followed by an if-else statement, followed by another if-else statement, followed by the end keyword.
The goal is to use different formulas for different values of alpha, something like the below.
However, it seems that only the first if-statement block executes — for all possible values of alpha, even when alpha already exceeds that interval.
Where is my mistake? Thanks in advance.
alpha = linspace(0,3*pi/2,1000)
if 0 <= alpha <= pi/2
vx = …;
vy = …;
elseif pi/2 < alpha <= pi
vx = …;
vy = …;
elseif pi < alpha <= 3*pi/2
vx = …;
vy = …;
end if statement MATLAB Answers — New Questions
How to dewarp an image?
Hello,
I made a thermogram of one face of a cube, from 45 degrees angle. Therefore, the face does not results on the picture as a square, but it looks like a trapeze.
I would like to dewarp such image in order to get the square-shape back. How can I do it?
Thanks everybody!Hello,
I made a thermogram of one face of a cube, from 45 degrees angle. Therefore, the face does not results on the picture as a square, but it looks like a trapeze.
I would like to dewarp such image in order to get the square-shape back. How can I do it?
Thanks everybody! Hello,
I made a thermogram of one face of a cube, from 45 degrees angle. Therefore, the face does not results on the picture as a square, but it looks like a trapeze.
I would like to dewarp such image in order to get the square-shape back. How can I do it?
Thanks everybody! image processing, image analysis, image MATLAB Answers — New Questions
Plotting data dependent on three independent variables.
I have a mathematical expression which is dependent on three independent variables. Each of the three variables are one dimensional arrays or row matrices. How to plot the data as a functions of the three variables?I have a mathematical expression which is dependent on three independent variables. Each of the three variables are one dimensional arrays or row matrices. How to plot the data as a functions of the three variables? I have a mathematical expression which is dependent on three independent variables. Each of the three variables are one dimensional arrays or row matrices. How to plot the data as a functions of the three variables? matlab plot MATLAB Answers — New Questions
EF Core display up to date data on predefine delay
Hi,
I have a C#/WPF project for which I use EF Core (database first) to transact with an SQL database. I am struggling with retreiving fresh data from the server on a predefine delay to be displayed on a dashboard.
Scenario is this:
I have an entity call Cars.
Cars has a property that is a virtual ICollection of ToDo call lstToDo
Each ToDo entity has a boolean property call Completed.
The data of SQL database can be modified by many users.
The dashboard is the application running on a computer that no one is using, and that need to display the latest data from the database every X minutes.
So in my scenario everything is working fine except that whenever the property Completed is change, in the database, from false to true (or vice-versa) I am unable to get the new value. I tried using Eager Loading but without any luck.It will catch when a new row has been added to the table, but not when a change happen in an existing row.
The eager loading I use:
myContext.Cars
.Include(c => c.lstToDo)
.Load();
myCollectionViewSource.Source = myContext.Cars.Local.ToObservableCollection();
Also, in my context I configured it to use LazyLoading.
Any suggestion will be more then welcome
Hi,I have a C#/WPF project for which I use EF Core (database first) to transact with an SQL database. I am struggling with retreiving fresh data from the server on a predefine delay to be displayed on a dashboard. Scenario is this:I have an entity call Cars.Cars has a property that is a virtual ICollection of ToDo call lstToDoEach ToDo entity has a boolean property call Completed.The data of SQL database can be modified by many users.The dashboard is the application running on a computer that no one is using, and that need to display the latest data from the database every X minutes. So in my scenario everything is working fine except that whenever the property Completed is change, in the database, from false to true (or vice-versa) I am unable to get the new value. I tried using Eager Loading but without any luck.It will catch when a new row has been added to the table, but not when a change happen in an existing row.The eager loading I use: myContext.Cars
.Include(c => c.lstToDo)
.Load();
myCollectionViewSource.Source = myContext.Cars.Local.ToObservableCollection(); Also, in my context I configured it to use LazyLoading. Any suggestion will be more then welcome Read More
How can I build an input file by using one file including all necessary earthquake events’ info in Coulomb 3.4?
In Coulomb 3.4 software, when I tried to build an input file from lon&lat map section, I saw that I should write fault elements one by one. However, I want to import one file ( e.g. a txt file) including whole fault paramerters such as longitude, latitude, depth, magnitude(Mw), strike, dip, and rake. Thus, how I import that mentioned file? Is there any way to fix this problem?In Coulomb 3.4 software, when I tried to build an input file from lon&lat map section, I saw that I should write fault elements one by one. However, I want to import one file ( e.g. a txt file) including whole fault paramerters such as longitude, latitude, depth, magnitude(Mw), strike, dip, and rake. Thus, how I import that mentioned file? Is there any way to fix this problem? In Coulomb 3.4 software, when I tried to build an input file from lon&lat map section, I saw that I should write fault elements one by one. However, I want to import one file ( e.g. a txt file) including whole fault paramerters such as longitude, latitude, depth, magnitude(Mw), strike, dip, and rake. Thus, how I import that mentioned file? Is there any way to fix this problem? coulomb3.4, input file, coulomb 3.3, earthquake, fault elements, input, function, code, file, matlab MATLAB Answers — New Questions
export planner fields explained…
Is there an explanation of the fields in Planner?
When Planner exports a plan to Excel and the “Due date” is 6/6/2024 and the “Completed date” is 6/11/2024 why does the “Late” field say “False” when the task was completed late. And why if the “Due date” is 7/12/2024 and the “Completed date” is 7/09/2024 the “Late” field still shows “False”??????
Is there an explanation of the fields in Planner?When Planner exports a plan to Excel and the “Due date” is 6/6/2024 and the “Completed date” is 6/11/2024 why does the “Late” field say “False” when the task was completed late. And why if the “Due date” is 7/12/2024 and the “Completed date” is 7/09/2024 the “Late” field still shows “False”?????? Read More
Change notifications after meeting is booked
Hi,
I’ve booked many meetings but then I wanted to change something in the reminder email the clients will receive. I changed it in the services, but I can see in the Calendar, that the email remains the same as before.
I tried changing it directly in the appointment, but it somehow canceled the meeting. It’s also a lot of meetings to modify! I don’t want to have to change it for each one and everyone involved getting an email when I do.
Is there a way to do it?
Thank you!
Hi, I’ve booked many meetings but then I wanted to change something in the reminder email the clients will receive. I changed it in the services, but I can see in the Calendar, that the email remains the same as before. I tried changing it directly in the appointment, but it somehow canceled the meeting. It’s also a lot of meetings to modify! I don’t want to have to change it for each one and everyone involved getting an email when I do. Is there a way to do it? Thank you! Read More
Custom Taskbar for Separate Task View Desktops
I currently work two computer-based jobs and have also started taking classes for an interior architectural design program. This has prompted me to utilize multiple desktops via task view. This has been helpful in allowing me to toggle between responsibilities with better organization. HOWEVER, I’ve found the task view interface to be fatally flawed. If Microsoft made it possible to customize each desktop’s taskbar, it would be tenfold more useful and streamlined. I honestly can’t believe this isn’t possible!
Microsoft Gods- Please help us with this simple yet considerable software upgrade!
I currently work two computer-based jobs and have also started taking classes for an interior architectural design program. This has prompted me to utilize multiple desktops via task view. This has been helpful in allowing me to toggle between responsibilities with better organization. HOWEVER, I’ve found the task view interface to be fatally flawed. If Microsoft made it possible to customize each desktop’s taskbar, it would be tenfold more useful and streamlined. I honestly can’t believe this isn’t possible! Microsoft Gods- Please help us with this simple yet considerable software upgrade! Read More
Create an Excel spreadsheet with columns for each step
Columns for each step: “Outcome”, “Probability”, “Prize”, “EMV Contribution”. Use formulas to automate calculations. The final EMV will likely be negative, highlighting the risk involved in playing Powerball
Computing the Probabilities Associated with Powerball
Powerball is a combined large jackpot game and a cash game. Every Wednesday and Saturday night at 10:59 p.m. Eastern Time.
Produce an Excel Spreadsheet that demonstrates the calculations associated with all possible outcomes of the drawing for the given Saturday prior to the assignment due date. This would include the nine ways to win and the remaining ways to loss when playing the Powerball. Find the Expected Monetary Value of purchasing one ticket and discuss the implications for you and all who play collectively.
Make detailed calculations and results should be presented in an Excel spreadsheet, demonstrating the probabilities and expected monetary value for each possible outcome in the Powerball game. The final report should discuss the negative EMV and its implications for players, emphasizing the low likelihood of winning significant prizes despite the game’s popularity.
Columns for each step: “Outcome”, “Probability”, “Prize”, “EMV Contribution”. Use formulas to automate calculations. The final EMV will likely be negative, highlighting the risk involved in playing PowerballComputing the Probabilities Associated with PowerballPowerball is a combined large jackpot game and a cash game. Every Wednesday and Saturday night at 10:59 p.m. Eastern Time.Produce an Excel Spreadsheet that demonstrates the calculations associated with all possible outcomes of the drawing for the given Saturday prior to the assignment due date. This would include the nine ways to win and the remaining ways to loss when playing the Powerball. Find the Expected Monetary Value of purchasing one ticket and discuss the implications for you and all who play collectively.Make detailed calculations and results should be presented in an Excel spreadsheet, demonstrating the probabilities and expected monetary value for each possible outcome in the Powerball game. The final report should discuss the negative EMV and its implications for players, emphasizing the low likelihood of winning significant prizes despite the game’s popularity. Read More
Diving Into Wave 2 Copilot in PowerPoint – Copilot Snacks
Using Copilot in PowerPoint has frankly been one of my favorite uses of Copilot for some time. Being able to take an existing document and have Copilot create a presentation based on its content and get me to 80% completion without barely lifting a finger has been super useful for me here at Microsoft. But the Copilot team had some new tricks up their sleeve that kicked things up to a whole a whole other level with their Copilot Wave 2 announcements.
In this Copilot Snack video, I walk you through some of the new goodness that is possible with Copilot in PowerPoint. I think after watching you will agree with me that Copilot in PowerPoint is pretty exciting with the update and is even more useful than previously.
Resources:
Check out ALL the Copilot Snacks published to Date
Microsoft 365 Copilot Wave 2: Pages, Python in Excel, and agents | Microsoft 365 Blog
Copilot in PowerPoint short video
PowerPoint | Microsoft 365
Microsoft 365 Copilot – Microsoft Adoption
Thanks for visiting – Michael Gannotti LinkedIn
Microsoft Tech Community – Latest Blogs –Read More
Using erfcinv and array indices are being rejected as not positive or valid, despite all being positive in the vector
Hello, I am currently working on some research data analysis and have been trying to fit autocorrelated data to a plot with a 95% confidence interval to check the distribution of the residuals. To do this, I’m working from the mathworks autocorrelation page (https://www.mathworks.com/help/signal/ug/residual-analysis-with-autocorrelation.html). When trying to set the confidence interval, I get the error that all array indices must be positive or logical values. Below is the code that I’m using, as well as residual data set.
erfbatp = erfcinv(a.Residuals.Raw);
erfbatp = erfbatp’;
erfbatp = erfbatp(~isnan(erfbatp))’;
conf99batp = sqrt(2)*erfbatp(2*.05/2);
lconfbatp = -conf99batp/sqrt(length(a.Residuals.Raw));
upconfbatp = conf99batp/sqrt(length(a.Residuals.Raw));
1.52973772211594
1.58151023710729
1.53641175549635
1.68852456597857
1.36494692501592
2.07737261195390
1.50753906916397
2.02256675790035
1.05155195289689
1.40278856349961
2.16079514557325
1.43199717380622
1.48556496430640
1.42827621898581
1.62133741215299
1.34671652045243
1.62813386205574
1.41104099011439
1.50196551118339
1.34604336518968
1.47733944833881
1.19896422993831
1.72322100428785
Above is the residual values in the erfbatp variable after removing NaNs, any advice or information would be appreciated.Hello, I am currently working on some research data analysis and have been trying to fit autocorrelated data to a plot with a 95% confidence interval to check the distribution of the residuals. To do this, I’m working from the mathworks autocorrelation page (https://www.mathworks.com/help/signal/ug/residual-analysis-with-autocorrelation.html). When trying to set the confidence interval, I get the error that all array indices must be positive or logical values. Below is the code that I’m using, as well as residual data set.
erfbatp = erfcinv(a.Residuals.Raw);
erfbatp = erfbatp’;
erfbatp = erfbatp(~isnan(erfbatp))’;
conf99batp = sqrt(2)*erfbatp(2*.05/2);
lconfbatp = -conf99batp/sqrt(length(a.Residuals.Raw));
upconfbatp = conf99batp/sqrt(length(a.Residuals.Raw));
1.52973772211594
1.58151023710729
1.53641175549635
1.68852456597857
1.36494692501592
2.07737261195390
1.50753906916397
2.02256675790035
1.05155195289689
1.40278856349961
2.16079514557325
1.43199717380622
1.48556496430640
1.42827621898581
1.62133741215299
1.34671652045243
1.62813386205574
1.41104099011439
1.50196551118339
1.34604336518968
1.47733944833881
1.19896422993831
1.72322100428785
Above is the residual values in the erfbatp variable after removing NaNs, any advice or information would be appreciated. Hello, I am currently working on some research data analysis and have been trying to fit autocorrelated data to a plot with a 95% confidence interval to check the distribution of the residuals. To do this, I’m working from the mathworks autocorrelation page (https://www.mathworks.com/help/signal/ug/residual-analysis-with-autocorrelation.html). When trying to set the confidence interval, I get the error that all array indices must be positive or logical values. Below is the code that I’m using, as well as residual data set.
erfbatp = erfcinv(a.Residuals.Raw);
erfbatp = erfbatp’;
erfbatp = erfbatp(~isnan(erfbatp))’;
conf99batp = sqrt(2)*erfbatp(2*.05/2);
lconfbatp = -conf99batp/sqrt(length(a.Residuals.Raw));
upconfbatp = conf99batp/sqrt(length(a.Residuals.Raw));
1.52973772211594
1.58151023710729
1.53641175549635
1.68852456597857
1.36494692501592
2.07737261195390
1.50753906916397
2.02256675790035
1.05155195289689
1.40278856349961
2.16079514557325
1.43199717380622
1.48556496430640
1.42827621898581
1.62133741215299
1.34671652045243
1.62813386205574
1.41104099011439
1.50196551118339
1.34604336518968
1.47733944833881
1.19896422993831
1.72322100428785
Above is the residual values in the erfbatp variable after removing NaNs, any advice or information would be appreciated. data analysis, residuals, autocorrelation, erfcinv MATLAB Answers — New Questions
after inter activation key write for me Invalid Activation Key (510). For help resolving this issue, see this MATLAB Answer.
Invalid Activation Key (510). For help resolving this issue, see this MATLAB Answer.Invalid Activation Key (510). For help resolving this issue, see this MATLAB Answer. Invalid Activation Key (510). For help resolving this issue, see this MATLAB Answer. invalid activation key (510). for help resolving t MATLAB Answers — New Questions