Month: August 2024
How to Solution Prevent User Downgrade Sensitivity Label is changed
Hi Everyone ,
Now I use Microsoft 365 E3 + Microsoft 365 E5 Information Protection and Governance. I am looking for a way to prevent User Downgrade Sensitivity Label from High to Low. I understand that before they change the label, they have to comment and they can change it.
Is there any solution that can block this or notify from the log?
Hi Everyone , Now I use Microsoft 365 E3 + Microsoft 365 E5 Information Protection and Governance. I am looking for a way to prevent User Downgrade Sensitivity Label from High to Low. I understand that before they change the label, they have to comment and they can change it.Is there any solution that can block this or notify from the log? Read More
Select all OKRs and initiatives in a view
Hi, is there a way to select or check all OKRs and initiatives in a view (for example to add a tag to all items in one view) without checking every single one?
Thanks,
Jonathan
Hi, is there a way to select or check all OKRs and initiatives in a view (for example to add a tag to all items in one view) without checking every single one? Thanks,Jonathan Read More
Local AI on Windows: Explaining the Audio Editor App Sample
Building Windows apps that leverage on-device AI models can seem like a daunting task – there’s a lot of work that goes into defining your use case, choosing and tuning the right models, and refining the logic surrounding the models.
While there’s no quick and easy path to learning the ins and outs of AI on Windows, we are going to breakdown an application sample that was showcased at Build to help you see how on-device models can be leveraged to power up your applications.
The sample we will be looking at is an AI-empowered Audio Editor, built with WinUI3 and WinAppSDK. The application functionality itself is minimal, but provides a good framework to showcase the AI portion of the app.
Audio Smart Trimming
The Audio Editor app uses several models to enable “smart trimming” of audio, which has a flow like this:
User uploads an audio file that includes recognizable speech
They provide a theme keyword or phrase and a trim duration
The Audio Editor generates a trimmed audio clip that contains the most relevant segment of audio related to the provided theme
The input UI for this flow helps visualize what exactly is expected in the sample:
Once Generate new clip is clicked, the new audio clip is uploaded to the app and can be played for validation:
Now let’s take a look at the models that were used to make this work.
Enabling Smart Trimming with Silero, Whisper, and MiniLML6v2
For the “smart trimming” task, it takes three different models, all of them ONNX, to process the input audio data into the output we are expecting. We’ll break down what each model does, what it accomplishes for our use case, and where you can find more info on the models.
In order of usage:
Silero Voice Activity Detection (VAD)
We use this model to “smart-chunk” our audio into smaller bits so that it can be processed by our transcription model.
This is necessary because Whisper (our transcription model) can only process thirty second snippets of audio at a time. We can’t naively cut the audio at 30 second intervals because this would chop sentences in the middle, resulting in a transcription that didn’t accurately reflect the structure and grammar of the spoken audio.
As a solution, we use Silero VAD to detect voice activity and cut on breaks in speaking, resulting in audio chunks that are small enough for Whisper to process, but are still properly sectioned portions of speech.
You can learn more about Silero VAD itself on
Whisper Tiny
After our audio has been chunked, we take the output and feed it to the Whisper Tiny model. This model transcribes speech to text and is probably the most straightforward step in our pipeline: audio chunks go in, and transcribed chunks come out.
We use the Tiny version of Whisper to optimize on performance, but it comes with some drawbacks, such as being limited to English and a possible drop off in accuracy. However, for our use case, it works great.
You can learn more about Whisper Tiny, or its variants, on HuggingFace.
MiniLM
The last model we use is a text embedding model called MiniLM. MiniLM maps written sentences to a multi-dimensional vector space that encapsulates all the semantic information contained in a sentence. In other words, this model maps all the things we inherently understand about language (like meaning, grammar, vocabulary, etc.) to a numerical representation of that information. This is useful for all sorts of tasks, but we will use it for semantic search.
For this sample, we take the text transcribed from our Whisper model, our input theme phrase to search on, and use MiniLM to generate text embeddings for both. Once we have our embeddings, we can calculate the Cosine Similarity between our theme phrase and embedded sections of our audio text to get the most semantically similar section of our audio.
From there, we just have to cut our audio based on the timestamps, load it into the player, and that’s it!
You can learn more about MiniLM on HuggingFace.
Running the Sample and Checking out the Code
If you want to run the sample for yourself, or dive into the implementation for some more details on how this all works, head over to this repository where the sample lives.
We also have a Code Walkthrough document if you want an entry point into how this sample was written.
There’s quite a bit of set-up that goes into getting all the models set up in the project (since they can’t be checked into source control), but all the prerequisite steps are defined in the README. Go check it out!
If you want to learn more using local models on Windows, head over to this documentation to learn more.
Microsoft Tech Community – Latest Blogs –Read More
Hosting WordPress Websites on Azure: A Step-by-Step Guide
Hi, I am Zil-e-huma a student ambassador from Pakistan pursuing software engineering.
Are you thinking about making your WordPress website live using Microsoft Azure. You got it to the right place! Azure is a platform offering a reliable, scalable, and easy-to-use platform for hosting your WordPress sites. If you are reading about Azure for the first time or you are an expert here for a quick refresher, this guide will take you through this procedure step by step. Let’s begin!
Step 1: Get Started on Microsoft Azure
To start go to the home page of Microsoft Azure (https://azure.microsoft.com). If you already have an account sign in otherwise sign up and you create one now.
Step 2: Create a Resource
Once you have signed in, you’ll find a button saying “+ Create a Resource” on the top left of your screen.
Step 3: Choose App Services
Alongside the Cerate resource button, you will see several resources. If you don’t find App Service there, no need to worry! Click on More Services, there in the search tab type App Services and you will find it.
Step 4: Set Up Your WordPress Website
In App Services page, on the top left there will be a Create icon. Click on it and then select WordPress on App Service. After this start setting up, hosting for WordPress site.
Step 5: Fill in Your Information
You are almost done, fill in the required information like subscription, resource groups, and name for your web app.
Pro Tip:
While naming your web app, you’ll see a radio button below the name field. Just turn it off! Why? If it is left on, Azure adds a default ID (Consisting of a random unique combination of numbers and alphabets) to your domain, making it look like `example12456f57GJ4.azurewebsites.net`. Turning off the radio button keeps your domain clean and professional, like `example.azurewebsites.net`.
Step 6: Review and Create
After filling in the details, click next and go through all the steps providing information. At the end, hit Create – and boom! Your website will have its identity within a few minutes.
Want to host a Coded Website?
If you want to host a coded website (not WordPress), don’t go for App Services, rather choose Storage App. The process is similar, but this option is tailored for non-WordPress sites.
Final Thoughts
Hosting your WordPress website on Azure might seem daunting, but with these steps, you’ll have your site up and running in no time. Azure’s powerful platform ensures your website is secure, scalable, and always available.
So, what are you waiting for? Give your WordPress website the home it deserves on Azure.
Microsoft Tech Community – Latest Blogs –Read More
Azure AI Model Inference API
The Azure AI Model Inference API provides a unified interface for developers to interact with various foundational models deployed in Azure AI Studio. This API allows developers to generate predictions from multiple models without changing their underlying code. By providing a consistent set of capabilities, the API simplifies the process of integrating and switching between different models, enabling seamless model selection based on task requirements.
Features
Foundational models have made significant advancements, particularly in natural language processing and computer vision. However, these models often excel in specific tasks and may approach the same problem differently. The Azure AI Model Inference API enables developers to:
Enhance performance by selecting the most suitable model for a particular task.
Optimize efficiency by using smaller, faster models for simpler tasks.
Create complex experiences by composing multiple models.
Maintain code portability across different models without sacrificing performance or capabilities.
Availability of Models
The Azure AI Model Inference API is available for the following models:
Serverless API Endpoints:
Cohere Embed V3 family
Cohere Command R family
Meta Llama 2 chat family
Meta Llama 3 instructs family
Mistral-Small
Mistral-Large
Jais
Jamba family
Phi-3 family
Managed Inference:
Meta Llama 3 instructs family
Phi-3 family
Mistral and Mixtral family
Additionally, the API is compatible with Azure OpenAI model deployments. Note that models deployed after June 24th, 2024, can take advantage of managed inference capabilities.
API Capabilities
The API supports multiple modalities, allowing developers to:
Retrieve model information: Get details about the deployed model.
Text embeddings: Generate an embedding vector for the input text.
Text completions: Generate text based on a provided prompt.
Chat completions: Create responses for chat conversations.
Image embeddings: Generate embedding vectors for text and image inputs.
Inference SDK Support
The Azure AI Inference SDK provides streamlined clients in several languages, including Python, JavaScript, and C#, making it easy to consume predictions from models using the Azure AI Model Inference API.
Installation
To install the Python package, use:
pip install azure-ai-inference
Example: Creating a Client for Chat Completions
Here’s a quick example of how to create a client for chat completions using Python:
import os
from azure.ai.inference import ChatCompletionsClient
from azure.core.credentials import AzureKeyCredential
# Create a client using an API key
client = ChatCompletionsClient(
endpoint=os.environ[“AZUREAI_ENDPOINT_URL”],
credential=AzureKeyCredential(os.environ[“AZUREAI_ENDPOINT_KEY”]),
)
# Create a client using Azure Entra ID
from azure.identity import DefaultAzureCredential
client = ChatCompletionsClient(
endpoint=os.environ[“AZUREAI_ENDPOINT_URL”],
credential=DefaultAzureCredential(),
)
Extensibility
The API allows developers to pass additional parameters to models beyond the specified modalities, using the extra-parameters header. For example, you can pass the safe_mode parameter to the Mistral-Large model, which isn’t specified in the API, like this:
from azure.ai.inference.models import SystemMessage, UserMessage
response = client.complete(
messages=[
SystemMessage(content=”You are a helpful assistant.”),
UserMessage(content=”How many languages are in the world?”),
],
model_extras={“safe_mode”: True}
)
print(response.choices[0].message.content)
Handling Different Model Capabilities
If a model doesn’t support a specific parameter, the API returns an error. You can handle these cases by inspecting the response:
import json
from azure.ai.inference.models import SystemMessage, UserMessage, ChatCompletionsResponseFormat
from azure.core.exceptions import HttpResponseError
try:
response = client.complete(
messages=[
SystemMessage(content=”You are a helpful assistant.”),
UserMessage(content=”How many languages are in the world?”),
],
response_format={“type”: ChatCompletionsResponseFormat.JSON_OBJECT}
)
except HttpResponseError as ex:
if ex.status_code == 422:
response = json.loads(ex.response._content.decode(‘utf-8’))
for offending in response.get(“detail”, []):
param = “.”.join(offending[“loc”])
value = offending[“input”]
print(f”Model doesn’t support the parameter ‘{param}’ with value ‘{value}'”)
else:
raise ex
Content Safety
The API also integrates with Azure AI Content Safety, filtering potentially harmful content. If a request triggers content safety measures, the response will indicate this, allowing developers to handle it accordingly.
Getting Started
To start using the Azure AI Model Inference API, deploy any of the supported models to Serverless API endpoints or Managed Online Endpoints and utilize the provided code to consume predictions.
Model Swapping Demo
Here’s an example of how easy it is to swap models in a Python solution while keeping the code consistent:
import os
from azure.ai.inference import ChatCompletionsClient
from azure.core.credentials import AzureKeyCredential
# Example function to swap models
def swap_model(endpoint_url, api_key):
client = ChatCompletionsClient(
endpoint=endpoint_url,
credential=AzureKeyCredential(api_key),
)
return client
# Swapping between two models for evaluation
model_1 = swap_model(os.environ[“MODEL1_ENDPOINT”], os.environ[“MODEL1_KEY”])
model_2 = swap_model(os.environ[“MODEL2_ENDPOINT”], os.environ[“MODEL2_KEY”])
response_1 = model_1.complete(messages=[UserMessage(content=”What’s the weather today?”)])
response_2 = model_2.complete(messages=[UserMessage(content=”What’s the weather today?”)])
# Compare the results from the two models
print(“Model 1 Response:”, response_1.choices[0].message.content)
print(“Model 2 Response:”, response_2.choices[0].message.content)
Comparing Model Outputs using the Azure Inference API
The Azure Inference API provides a convenient way to evaluate the effectiveness of different models and compare their outputs. By using the API, you can easily swap between models and test their performance on a given input prompt.
Here is an example of how to use the Azure Inference API to compare the outputs of two models:
import os
from azure.ai.inference import ChatCompletionsClient
from azure.core.credentials import AzureKeyCredential
from azure.ai.inference.models import UserMessage
# Set up the models
model_1_endpoint = “https://your-resource-name.cognitiveservices.azure.com/”
model_1_key = “your-model-1-key”
model_2_endpoint = “https://your-resource-name.cognitiveservices.azure.com/”
model_2_key = “your-model-2-key”
# Example function to swap models
def swap_model(endpoint_url, api_key):
client = ChatCompletionsClient(
endpoint=endpoint_url,
credential=AzureKeyCredential(api_key),
)
return client
# Swapping between two models for evaluation
model_1 = swap_model(model_1_endpoint, model_1_key)
model_2 = swap_model(model_2_endpoint, model_2_key)
# Set the model names for clarity
model_1_name = “text-davinci-002”
model_2_name = “text-curie-001”
# Set the input prompt
input_prompt = “What’s the weather today?”
# Get responses from both models
response_1 = model_1.complete(messages=[UserMessage(content=input_prompt)], model=model_1_name)
response_2 = model_2.complete(messages=[UserMessage(content=input_prompt)], model=model_2_name)
# Compare the results from the two models
print(f”Model 1 ({model_1_name}) Response:”, response_1.choices[0].message.content)
print(f”Model 2 ({model_2_name}) Response:”, response_2.choices[0].message.content)
Comparison and Contrast:
Both models respond to the input prompt but with different styles and levels of detail.
text-davinci-002 (Model 1) provides a more conversational and friendly response, acknowledging the user’s question and offering suggestions on how to find the answer. The response is longer and more elaborate, with a more personal touch.
text-curie-001 (Model 2) provides a more concise and direct response, simply stating that it’s not aware of the current weather and offering suggestions on how to find out. The response is shorter and more to the point.
In general, text-davinci-002 is known for its ability to generate more creative and conversational responses, while text-curie-001 is known for its ability to provide more accurate and informative responses. This is reflected in their responses to this input prompt.
Conclusion:
Using the Azure Inference API is a great way to evaluate the effectiveness of models and compare outputs quickly and easily. By swapping between models and testing their performance on a given input prompt, you can gain valuable insights into the strengths and weaknesses of each model and make informed decisions about which model to use for your specific use case.
Explore our samples and read the API reference documentation to get yourself started.
Microsoft Tech Community – Latest Blogs –Read More
Must return a column vector error when using “ode45”
%% Clean the Workspace
clc
clear all
%% Format
format long
%% Variables
global m_ExtraSteam U0_shell V rho_0 U_steam
T0_shell = 105; % initial shell side temp, degC
P0_shell = 1.2; % initial pressure, bara
U0_shell = XSteam(‘uV_p’, P0_shell);
Plimit = 3.3; % max pressure, bara
MW = 0.018015; % kg/mol
R = 0.00008205736; % bar.m3/mol.K
V = 233.21; % m3
rho_0 = XSteam(‘rhoV_p’, P0_shell);
tb = 20; % Upper time interval limit
m_ExtraSteam = 35.08; % Flowrate of extra steam due to ST trip, kg/sec
t_interval = [0.001 tb]; % Time interval
%% Solve the DE
[tsol,Usol] = ode45(@(t, U_steam) cfunc(t, U_steam) , t_interval , U0_shell); % Temperature with time, degC
%% Dynamic Parameter Calculation
Ptube_in = 7;
Ptube_out = 6.5;
m_tube = [707.9 707.9 707.9 707.9];
T_tube_in = [91.7 91.7 91.7 91.7];
for m=1:lenght(Usol)
U_steam = Usol(m);
Tsol(m) = fsolve(@TfinderwU,100);
end
for p=5:length(Tsol)
T_tube_in(p) = 80.1;
m_tube(p) = 1131.2;
end
T_tube_out = 98;
for k = 1:length(Tsol)
deltaH_tube(k) = XSteam(‘h_pT’, Ptube_out, T_tube_out) – XSteam(‘h_pT’, Ptube_in, T_tube_in(k)); % Specific enthalpy difference between the inlet and outlet of the tube side, kJ/kg
if ((m_tube(k)*deltaH_tube(k))/(XSteam(‘hV_T’, Tsol(k)) – XSteam(‘hL_T’, Tsol(k)))) >= m_ExtraSteam
m_ExtraSteam_Condensation(k) = m_ExtraSteam;
else
m_ExtraSteam_Condensation(k) = (m_tube(k)*deltaH_tube(k))/(XSteam(‘hV_T’, Tsol(k)) – XSteam(‘hL_T’, Tsol(k)));
end
end
m_steam_accumulated = (m_ExtraSteam – m_ExtraSteam_Condensation)’; % Steam accumulated in the shell side, kg/sec
nfor(1) = m_steam_accumulated(1)*(tsol(1))/MW;
for k1 = 2:length(Tsol)
nfor(k1) = m_steam_accumulated(k1)*(tsol(k1)-tsol(k1-1))/MW;
end
%% Final Pressure Calculation
%% Plotting
figure(‘Name’,’Temperature, Pressure vs Time’,’NumberTitle’,’off’);
yyaxis left % subplot(1,2,1)
plot(tsol,Tsol)
xlabel(‘Time (s)’)
ylabel(‘Temperature (C)’)
yyaxis right % subplot(1,2,2)
plot(tsol,Psol)
xlabel(‘Time (s)’)
ylabel(‘Pressure (bara)’)
%% Display Results
fprintf(‘Max pressure during the observed time interval = %.3f bara.n’, max(Psol))
%% Functions
% Main Function
function dUdt = cfunc(t,U_steam)
% Variables
global m_ExtraSteam U0_shell V rho_0 U_steam
Ptube_in = 7;
Ptube_out = 6.5;
T_tube_out = 98;
if t<3.3
m_tube = 707.9;
T_tube_in = 91.7;
else
m_tube = 1131.2;
T_tube_in = 80.1;
end
% Find the Temp with Internal Energy
T = fsolve(@TfinderwU,100);
deltaH_tube = XSteam(‘h_pT’, Ptube_out, T_tube_out) – XSteam(‘h_pT’, Ptube_in, T_tube_in); % Specific enthalpy difference between the inlet and outlet of the tube side, kJ/kg
if ((m_tube*deltaH_tube)/(XSteam(‘hV_T’, T) – XSteam(‘hL_T’, T))) >= m_ExtraSteam
m_ExtraSteam_Condensation = m_ExtraSteam;
else
m_ExtraSteam_Condensation = (m_tube*deltaH_tube)/(XSteam(‘hV_T’, T) – XSteam(‘hL_T’, T));
end
m_steam_accumulated = m_ExtraSteam – m_ExtraSteam_Condensation; % Steam accumulated in the shell side, kg/sec
steam_mass = rho_0*V + m_steam_accumulated*t;
U_condensate = XSteam(‘uL_T’, T);
CpL = XSteam(‘CpL_T’, T);
Qcv = m_tube*CpL*(T_tube_out-T_tube_in);
% Differential Equation
dUdt = (-Qcv + m_ExtraSteam*U0_shell – m_ExtraSteam_Condensation*U_condensate – U_steam*m_steam_accumulated)/steam_mass;
end
% Temperature Finder Function with Internal Energy
function Obj = TfinderwU(T)
global U_steam
uV_T = XSteam(‘uV_T’, T);
Obj = U_steam- uV_T;
end%% Clean the Workspace
clc
clear all
%% Format
format long
%% Variables
global m_ExtraSteam U0_shell V rho_0 U_steam
T0_shell = 105; % initial shell side temp, degC
P0_shell = 1.2; % initial pressure, bara
U0_shell = XSteam(‘uV_p’, P0_shell);
Plimit = 3.3; % max pressure, bara
MW = 0.018015; % kg/mol
R = 0.00008205736; % bar.m3/mol.K
V = 233.21; % m3
rho_0 = XSteam(‘rhoV_p’, P0_shell);
tb = 20; % Upper time interval limit
m_ExtraSteam = 35.08; % Flowrate of extra steam due to ST trip, kg/sec
t_interval = [0.001 tb]; % Time interval
%% Solve the DE
[tsol,Usol] = ode45(@(t, U_steam) cfunc(t, U_steam) , t_interval , U0_shell); % Temperature with time, degC
%% Dynamic Parameter Calculation
Ptube_in = 7;
Ptube_out = 6.5;
m_tube = [707.9 707.9 707.9 707.9];
T_tube_in = [91.7 91.7 91.7 91.7];
for m=1:lenght(Usol)
U_steam = Usol(m);
Tsol(m) = fsolve(@TfinderwU,100);
end
for p=5:length(Tsol)
T_tube_in(p) = 80.1;
m_tube(p) = 1131.2;
end
T_tube_out = 98;
for k = 1:length(Tsol)
deltaH_tube(k) = XSteam(‘h_pT’, Ptube_out, T_tube_out) – XSteam(‘h_pT’, Ptube_in, T_tube_in(k)); % Specific enthalpy difference between the inlet and outlet of the tube side, kJ/kg
if ((m_tube(k)*deltaH_tube(k))/(XSteam(‘hV_T’, Tsol(k)) – XSteam(‘hL_T’, Tsol(k)))) >= m_ExtraSteam
m_ExtraSteam_Condensation(k) = m_ExtraSteam;
else
m_ExtraSteam_Condensation(k) = (m_tube(k)*deltaH_tube(k))/(XSteam(‘hV_T’, Tsol(k)) – XSteam(‘hL_T’, Tsol(k)));
end
end
m_steam_accumulated = (m_ExtraSteam – m_ExtraSteam_Condensation)’; % Steam accumulated in the shell side, kg/sec
nfor(1) = m_steam_accumulated(1)*(tsol(1))/MW;
for k1 = 2:length(Tsol)
nfor(k1) = m_steam_accumulated(k1)*(tsol(k1)-tsol(k1-1))/MW;
end
%% Final Pressure Calculation
%% Plotting
figure(‘Name’,’Temperature, Pressure vs Time’,’NumberTitle’,’off’);
yyaxis left % subplot(1,2,1)
plot(tsol,Tsol)
xlabel(‘Time (s)’)
ylabel(‘Temperature (C)’)
yyaxis right % subplot(1,2,2)
plot(tsol,Psol)
xlabel(‘Time (s)’)
ylabel(‘Pressure (bara)’)
%% Display Results
fprintf(‘Max pressure during the observed time interval = %.3f bara.n’, max(Psol))
%% Functions
% Main Function
function dUdt = cfunc(t,U_steam)
% Variables
global m_ExtraSteam U0_shell V rho_0 U_steam
Ptube_in = 7;
Ptube_out = 6.5;
T_tube_out = 98;
if t<3.3
m_tube = 707.9;
T_tube_in = 91.7;
else
m_tube = 1131.2;
T_tube_in = 80.1;
end
% Find the Temp with Internal Energy
T = fsolve(@TfinderwU,100);
deltaH_tube = XSteam(‘h_pT’, Ptube_out, T_tube_out) – XSteam(‘h_pT’, Ptube_in, T_tube_in); % Specific enthalpy difference between the inlet and outlet of the tube side, kJ/kg
if ((m_tube*deltaH_tube)/(XSteam(‘hV_T’, T) – XSteam(‘hL_T’, T))) >= m_ExtraSteam
m_ExtraSteam_Condensation = m_ExtraSteam;
else
m_ExtraSteam_Condensation = (m_tube*deltaH_tube)/(XSteam(‘hV_T’, T) – XSteam(‘hL_T’, T));
end
m_steam_accumulated = m_ExtraSteam – m_ExtraSteam_Condensation; % Steam accumulated in the shell side, kg/sec
steam_mass = rho_0*V + m_steam_accumulated*t;
U_condensate = XSteam(‘uL_T’, T);
CpL = XSteam(‘CpL_T’, T);
Qcv = m_tube*CpL*(T_tube_out-T_tube_in);
% Differential Equation
dUdt = (-Qcv + m_ExtraSteam*U0_shell – m_ExtraSteam_Condensation*U_condensate – U_steam*m_steam_accumulated)/steam_mass;
end
% Temperature Finder Function with Internal Energy
function Obj = TfinderwU(T)
global U_steam
uV_T = XSteam(‘uV_T’, T);
Obj = U_steam- uV_T;
end %% Clean the Workspace
clc
clear all
%% Format
format long
%% Variables
global m_ExtraSteam U0_shell V rho_0 U_steam
T0_shell = 105; % initial shell side temp, degC
P0_shell = 1.2; % initial pressure, bara
U0_shell = XSteam(‘uV_p’, P0_shell);
Plimit = 3.3; % max pressure, bara
MW = 0.018015; % kg/mol
R = 0.00008205736; % bar.m3/mol.K
V = 233.21; % m3
rho_0 = XSteam(‘rhoV_p’, P0_shell);
tb = 20; % Upper time interval limit
m_ExtraSteam = 35.08; % Flowrate of extra steam due to ST trip, kg/sec
t_interval = [0.001 tb]; % Time interval
%% Solve the DE
[tsol,Usol] = ode45(@(t, U_steam) cfunc(t, U_steam) , t_interval , U0_shell); % Temperature with time, degC
%% Dynamic Parameter Calculation
Ptube_in = 7;
Ptube_out = 6.5;
m_tube = [707.9 707.9 707.9 707.9];
T_tube_in = [91.7 91.7 91.7 91.7];
for m=1:lenght(Usol)
U_steam = Usol(m);
Tsol(m) = fsolve(@TfinderwU,100);
end
for p=5:length(Tsol)
T_tube_in(p) = 80.1;
m_tube(p) = 1131.2;
end
T_tube_out = 98;
for k = 1:length(Tsol)
deltaH_tube(k) = XSteam(‘h_pT’, Ptube_out, T_tube_out) – XSteam(‘h_pT’, Ptube_in, T_tube_in(k)); % Specific enthalpy difference between the inlet and outlet of the tube side, kJ/kg
if ((m_tube(k)*deltaH_tube(k))/(XSteam(‘hV_T’, Tsol(k)) – XSteam(‘hL_T’, Tsol(k)))) >= m_ExtraSteam
m_ExtraSteam_Condensation(k) = m_ExtraSteam;
else
m_ExtraSteam_Condensation(k) = (m_tube(k)*deltaH_tube(k))/(XSteam(‘hV_T’, Tsol(k)) – XSteam(‘hL_T’, Tsol(k)));
end
end
m_steam_accumulated = (m_ExtraSteam – m_ExtraSteam_Condensation)’; % Steam accumulated in the shell side, kg/sec
nfor(1) = m_steam_accumulated(1)*(tsol(1))/MW;
for k1 = 2:length(Tsol)
nfor(k1) = m_steam_accumulated(k1)*(tsol(k1)-tsol(k1-1))/MW;
end
%% Final Pressure Calculation
%% Plotting
figure(‘Name’,’Temperature, Pressure vs Time’,’NumberTitle’,’off’);
yyaxis left % subplot(1,2,1)
plot(tsol,Tsol)
xlabel(‘Time (s)’)
ylabel(‘Temperature (C)’)
yyaxis right % subplot(1,2,2)
plot(tsol,Psol)
xlabel(‘Time (s)’)
ylabel(‘Pressure (bara)’)
%% Display Results
fprintf(‘Max pressure during the observed time interval = %.3f bara.n’, max(Psol))
%% Functions
% Main Function
function dUdt = cfunc(t,U_steam)
% Variables
global m_ExtraSteam U0_shell V rho_0 U_steam
Ptube_in = 7;
Ptube_out = 6.5;
T_tube_out = 98;
if t<3.3
m_tube = 707.9;
T_tube_in = 91.7;
else
m_tube = 1131.2;
T_tube_in = 80.1;
end
% Find the Temp with Internal Energy
T = fsolve(@TfinderwU,100);
deltaH_tube = XSteam(‘h_pT’, Ptube_out, T_tube_out) – XSteam(‘h_pT’, Ptube_in, T_tube_in); % Specific enthalpy difference between the inlet and outlet of the tube side, kJ/kg
if ((m_tube*deltaH_tube)/(XSteam(‘hV_T’, T) – XSteam(‘hL_T’, T))) >= m_ExtraSteam
m_ExtraSteam_Condensation = m_ExtraSteam;
else
m_ExtraSteam_Condensation = (m_tube*deltaH_tube)/(XSteam(‘hV_T’, T) – XSteam(‘hL_T’, T));
end
m_steam_accumulated = m_ExtraSteam – m_ExtraSteam_Condensation; % Steam accumulated in the shell side, kg/sec
steam_mass = rho_0*V + m_steam_accumulated*t;
U_condensate = XSteam(‘uL_T’, T);
CpL = XSteam(‘CpL_T’, T);
Qcv = m_tube*CpL*(T_tube_out-T_tube_in);
% Differential Equation
dUdt = (-Qcv + m_ExtraSteam*U0_shell – m_ExtraSteam_Condensation*U_condensate – U_steam*m_steam_accumulated)/steam_mass;
end
% Temperature Finder Function with Internal Energy
function Obj = TfinderwU(T)
global U_steam
uV_T = XSteam(‘uV_T’, T);
Obj = U_steam- uV_T;
end ode45, function, error MATLAB Answers — New Questions
how to write objective function
i want to pso algorithm on svr model ,as far as i know i need to write objective function in first code and determine other parameter to rest.
i got the objective function svr but i don’t know how to write that i used it in my pso algorithm then i found optimaziton of costfunction and penalty factor and insensitive lossi want to pso algorithm on svr model ,as far as i know i need to write objective function in first code and determine other parameter to rest.
i got the objective function svr but i don’t know how to write that i used it in my pso algorithm then i found optimaziton of costfunction and penalty factor and insensitive loss i want to pso algorithm on svr model ,as far as i know i need to write objective function in first code and determine other parameter to rest.
i got the objective function svr but i don’t know how to write that i used it in my pso algorithm then i found optimaziton of costfunction and penalty factor and insensitive loss svr, pso MATLAB Answers — New Questions
Optimization with 3 variables- how to find the values of each variable to minimize mass?
I have an infrastructure where a metal sheet must be produced. An excavator, an electrolysis reactor, and a 3D printer must be used.
All this has to be performed in 3650 days. So, I am trying to kind of optimize it and find how many excavators, reactors, and 3D printers will give the smallest mass but will also be able to get the job done in 3650 days. I am not sure if and how a code can be written for that. Any help would be appreciated.
days_req=3650; %
m_sheet=linspace(100,10000,200); % mass of a metal sheet
% excavator
n_excav=1:1:200; % number of excavators
m_excav=67; % mass of each excavator
m_tot_excav=n_RASSORs*m_RASSOR; % mass for n excavators
excav_cap=n_excav*6536; % kg/day
days_excav=ceil(m_sheet./excav_cap./n_excav); % days to excavate
% electrolysis reactor
n_react=1:1:200; % number of reactors
m_react=2000; % mass of each reactor
m_tot_react=n_react*m_react; % mass for n reactors
prod_rate_react=7*24; % kg/day of regolith
days_react=ceil(m_sheet./prod_rate_react./n_react); % days to process m_sheet
% printer
n_printer=1:1:200; % number of printers
m_printer=3500; % mass of each printer
m_tot_printer=n_printer*m_printer; % mass for n printers
deposition_rate=n_printer*14.4; % kg/day
days_print=ceil(m_sheet./deposition_rate./n_printer); % days to printI have an infrastructure where a metal sheet must be produced. An excavator, an electrolysis reactor, and a 3D printer must be used.
All this has to be performed in 3650 days. So, I am trying to kind of optimize it and find how many excavators, reactors, and 3D printers will give the smallest mass but will also be able to get the job done in 3650 days. I am not sure if and how a code can be written for that. Any help would be appreciated.
days_req=3650; %
m_sheet=linspace(100,10000,200); % mass of a metal sheet
% excavator
n_excav=1:1:200; % number of excavators
m_excav=67; % mass of each excavator
m_tot_excav=n_RASSORs*m_RASSOR; % mass for n excavators
excav_cap=n_excav*6536; % kg/day
days_excav=ceil(m_sheet./excav_cap./n_excav); % days to excavate
% electrolysis reactor
n_react=1:1:200; % number of reactors
m_react=2000; % mass of each reactor
m_tot_react=n_react*m_react; % mass for n reactors
prod_rate_react=7*24; % kg/day of regolith
days_react=ceil(m_sheet./prod_rate_react./n_react); % days to process m_sheet
% printer
n_printer=1:1:200; % number of printers
m_printer=3500; % mass of each printer
m_tot_printer=n_printer*m_printer; % mass for n printers
deposition_rate=n_printer*14.4; % kg/day
days_print=ceil(m_sheet./deposition_rate./n_printer); % days to print I have an infrastructure where a metal sheet must be produced. An excavator, an electrolysis reactor, and a 3D printer must be used.
All this has to be performed in 3650 days. So, I am trying to kind of optimize it and find how many excavators, reactors, and 3D printers will give the smallest mass but will also be able to get the job done in 3650 days. I am not sure if and how a code can be written for that. Any help would be appreciated.
days_req=3650; %
m_sheet=linspace(100,10000,200); % mass of a metal sheet
% excavator
n_excav=1:1:200; % number of excavators
m_excav=67; % mass of each excavator
m_tot_excav=n_RASSORs*m_RASSOR; % mass for n excavators
excav_cap=n_excav*6536; % kg/day
days_excav=ceil(m_sheet./excav_cap./n_excav); % days to excavate
% electrolysis reactor
n_react=1:1:200; % number of reactors
m_react=2000; % mass of each reactor
m_tot_react=n_react*m_react; % mass for n reactors
prod_rate_react=7*24; % kg/day of regolith
days_react=ceil(m_sheet./prod_rate_react./n_react); % days to process m_sheet
% printer
n_printer=1:1:200; % number of printers
m_printer=3500; % mass of each printer
m_tot_printer=n_printer*m_printer; % mass for n printers
deposition_rate=n_printer*14.4; % kg/day
days_print=ceil(m_sheet./deposition_rate./n_printer); % days to print optimization MATLAB Answers — New Questions
For Loop to Cycle through Struct
I have a 6×1 struct and want to create a for loop that will cycle through and pull out the name field of the 1×1 struct.
How can I do that? ** I am using R2012a **
I apologize for the strange format, the toolbar at the top of the body is missing and I’m still trying to fix it.I have a 6×1 struct and want to create a for loop that will cycle through and pull out the name field of the 1×1 struct.
How can I do that? ** I am using R2012a **
I apologize for the strange format, the toolbar at the top of the body is missing and I’m still trying to fix it. I have a 6×1 struct and want to create a for loop that will cycle through and pull out the name field of the 1×1 struct.
How can I do that? ** I am using R2012a **
I apologize for the strange format, the toolbar at the top of the body is missing and I’m still trying to fix it. struct, fieldname MATLAB Answers — New Questions
Entra enforcing MFA
Hi All,
I understand MFA is being enforced from October or so as per this – Mandatory Microsoft Entra multifactor authentication (MFA) – Microsoft Entra ID | Microsoft Learn
Is this MFA enforced to all users in Entra or just the admins (regardless of all admin roles)?
Hi All,I understand MFA is being enforced from October or so as per this – Mandatory Microsoft Entra multifactor authentication (MFA) – Microsoft Entra ID | Microsoft Learn Is this MFA enforced to all users in Entra or just the admins (regardless of all admin roles)? Read More
Teams call queue not redirecting
Hi,
We have an issue with our reception call queue, we have it set to redirect after 20 seconds, and I’ve set it to to redirect if no agents opted or signed in, however when our reception locks her computer it still takes 20 seconds before overflow and the reception handset doesnt ring(because she is set to away)
any suggestions?
Hi, We have an issue with our reception call queue, we have it set to redirect after 20 seconds, and I’ve set it to to redirect if no agents opted or signed in, however when our reception locks her computer it still takes 20 seconds before overflow and the reception handset doesnt ring(because she is set to away) any suggestions? Read More
Inquiry Regarding Tenant Attach for MDE and Potential Limitations in Intune
Hello,
I am seeking some guidance regarding the use of Tenant Attach for Microsoft Defender for Endpoint. Specifically, I would like to understand if there are any limitations or restrictions associated with this approach that might prevent us from utilizing certain features or functionalities within Microsoft Intune.
Your insights on this matter would be greatly appreciated. Thank you in advance for your assistance.
Hello,I am seeking some guidance regarding the use of Tenant Attach for Microsoft Defender for Endpoint. Specifically, I would like to understand if there are any limitations or restrictions associated with this approach that might prevent us from utilizing certain features or functionalities within Microsoft Intune.Your insights on this matter would be greatly appreciated. Thank you in advance for your assistance. Read More
Error while loading the old session in PIVlab (the GUI says loading session but it never loads)
Post Content Post Content pivlab, piv MATLAB Answers — New Questions
A problem about implementing soft-decision decode in an OFDM system
Hello,everyone. Recently I am working on a project of simulating a whole OFDM system.
I have made some progress. Now I want to change me (2,1,7) convolutional code – hard decode to soft-decision decode in order to get a better performance. I have learned from the matlab example how to implement soft-decision decode in an AWGN channel. But now I also want to apply it to a fast and multi-path fading channel. As a result of that, I am not sure about the value of noise power when calculate LLR.
I first pass my signal to a fading channel by using comm.RayleighChannel() , then I add noise by using awgn() block. This will give a noise power value.
[y_re,noise_var]=awgn(x_tr,SNR_dB(i),’measured’);
Then I do LS channel estimation and equalization at the receiver. This will change the value of the signal, so as the value of the noise. So I also calculate the noise power at this time.
noise_var_1= 10^(-SNR_dB(i)/10)* mean(Y_equalized.*conj(Y_equalized));
The two power values will be totally different since one is computed with the channel effect and one is not (with channel equalization). So wich value should I use to calculate LLR?
Thanks for your reading and hope you have some ideas about this question.Hello,everyone. Recently I am working on a project of simulating a whole OFDM system.
I have made some progress. Now I want to change me (2,1,7) convolutional code – hard decode to soft-decision decode in order to get a better performance. I have learned from the matlab example how to implement soft-decision decode in an AWGN channel. But now I also want to apply it to a fast and multi-path fading channel. As a result of that, I am not sure about the value of noise power when calculate LLR.
I first pass my signal to a fading channel by using comm.RayleighChannel() , then I add noise by using awgn() block. This will give a noise power value.
[y_re,noise_var]=awgn(x_tr,SNR_dB(i),’measured’);
Then I do LS channel estimation and equalization at the receiver. This will change the value of the signal, so as the value of the noise. So I also calculate the noise power at this time.
noise_var_1= 10^(-SNR_dB(i)/10)* mean(Y_equalized.*conj(Y_equalized));
The two power values will be totally different since one is computed with the channel effect and one is not (with channel equalization). So wich value should I use to calculate LLR?
Thanks for your reading and hope you have some ideas about this question. Hello,everyone. Recently I am working on a project of simulating a whole OFDM system.
I have made some progress. Now I want to change me (2,1,7) convolutional code – hard decode to soft-decision decode in order to get a better performance. I have learned from the matlab example how to implement soft-decision decode in an AWGN channel. But now I also want to apply it to a fast and multi-path fading channel. As a result of that, I am not sure about the value of noise power when calculate LLR.
I first pass my signal to a fading channel by using comm.RayleighChannel() , then I add noise by using awgn() block. This will give a noise power value.
[y_re,noise_var]=awgn(x_tr,SNR_dB(i),’measured’);
Then I do LS channel estimation and equalization at the receiver. This will change the value of the signal, so as the value of the noise. So I also calculate the noise power at this time.
noise_var_1= 10^(-SNR_dB(i)/10)* mean(Y_equalized.*conj(Y_equalized));
The two power values will be totally different since one is computed with the channel effect and one is not (with channel equalization). So wich value should I use to calculate LLR?
Thanks for your reading and hope you have some ideas about this question. ofdm, soft-decison decode MATLAB Answers — New Questions
Filtering multiple .csv files based on data from a table
Hello all,
I am trying to filter multiple .csv files (based on data in a separate table. To be more specific I am trying to filter the data from dataTables by "d_Data.Actual.Calculated_Flow" variable, so that it filters the data that are below minFlow or above maxFlow, which are listed in dataList. dataList has several columns the first one lists Tablename that corresponds with names of the tables in dataTables, the 4th & 5th lists corresponding maxFlow & minFlow that I would like to apply for filtering. How can I achieve this?
here is the code:
dataListDir="zoznam_merani.xlsx";
dataDir=’C:UsersU430746OneDrive – DanfossDesktopEHAEHA 1MatlabMatlabSimulation EHA V1Test DataOneDrive_2024-08-16Flow controlEHA_Flow_Control_standard modeEHA_Flow_Control’;
% Loads dataList
dataList=readtable(dataListDir);
% Loads direction to .csv files
dataFiles = dir(fullfile(dataDir, ‘*.csv’));
% Inicialize a cell array for input of tables
dataTables = cell(1, length(dataFiles));
% Loads tables to the dataTables cell array
for i = 1:length(dataFiles)
fileName = fullfile(dataDir, dataFiles(i).name);
dataTables{i} = readtable(fileName,"VariableNamingRule","preserve");
end
% Inicialize a cell array for filtered data
filteredDataTables = cell(1, length(dataFiles));
% Runs through all the tables in dataTables
for i = 1:length(dataTables)
% Finds a row that corresponds with the TableName
rowIndex = strcmp(dataList.TableName, dataFiles(i).name);
if any(rowIndex)
% Gets minFlow & maxFlow for the actual table
minFlow = dataList.minFlow(rowIndex);
maxFlow = dataList.maxFlow(rowIndex);
% Filters the tables based on minFlow & maxFlow
filteredDataTables{i} = dataTables{i}(dataTables{i}.("d_Data.Actual.Calculated_Flow") >= minFlow & dataTables{i}.("d_Data.Actual.Calculated_Flow") <= maxFlow, :);
else
% If the tableName is not available executes no changes
filteredDataTables{i} = dataTables{i};
end
endHello all,
I am trying to filter multiple .csv files (based on data in a separate table. To be more specific I am trying to filter the data from dataTables by "d_Data.Actual.Calculated_Flow" variable, so that it filters the data that are below minFlow or above maxFlow, which are listed in dataList. dataList has several columns the first one lists Tablename that corresponds with names of the tables in dataTables, the 4th & 5th lists corresponding maxFlow & minFlow that I would like to apply for filtering. How can I achieve this?
here is the code:
dataListDir="zoznam_merani.xlsx";
dataDir=’C:UsersU430746OneDrive – DanfossDesktopEHAEHA 1MatlabMatlabSimulation EHA V1Test DataOneDrive_2024-08-16Flow controlEHA_Flow_Control_standard modeEHA_Flow_Control’;
% Loads dataList
dataList=readtable(dataListDir);
% Loads direction to .csv files
dataFiles = dir(fullfile(dataDir, ‘*.csv’));
% Inicialize a cell array for input of tables
dataTables = cell(1, length(dataFiles));
% Loads tables to the dataTables cell array
for i = 1:length(dataFiles)
fileName = fullfile(dataDir, dataFiles(i).name);
dataTables{i} = readtable(fileName,"VariableNamingRule","preserve");
end
% Inicialize a cell array for filtered data
filteredDataTables = cell(1, length(dataFiles));
% Runs through all the tables in dataTables
for i = 1:length(dataTables)
% Finds a row that corresponds with the TableName
rowIndex = strcmp(dataList.TableName, dataFiles(i).name);
if any(rowIndex)
% Gets minFlow & maxFlow for the actual table
minFlow = dataList.minFlow(rowIndex);
maxFlow = dataList.maxFlow(rowIndex);
% Filters the tables based on minFlow & maxFlow
filteredDataTables{i} = dataTables{i}(dataTables{i}.("d_Data.Actual.Calculated_Flow") >= minFlow & dataTables{i}.("d_Data.Actual.Calculated_Flow") <= maxFlow, :);
else
% If the tableName is not available executes no changes
filteredDataTables{i} = dataTables{i};
end
end Hello all,
I am trying to filter multiple .csv files (based on data in a separate table. To be more specific I am trying to filter the data from dataTables by "d_Data.Actual.Calculated_Flow" variable, so that it filters the data that are below minFlow or above maxFlow, which are listed in dataList. dataList has several columns the first one lists Tablename that corresponds with names of the tables in dataTables, the 4th & 5th lists corresponding maxFlow & minFlow that I would like to apply for filtering. How can I achieve this?
here is the code:
dataListDir="zoznam_merani.xlsx";
dataDir=’C:UsersU430746OneDrive – DanfossDesktopEHAEHA 1MatlabMatlabSimulation EHA V1Test DataOneDrive_2024-08-16Flow controlEHA_Flow_Control_standard modeEHA_Flow_Control’;
% Loads dataList
dataList=readtable(dataListDir);
% Loads direction to .csv files
dataFiles = dir(fullfile(dataDir, ‘*.csv’));
% Inicialize a cell array for input of tables
dataTables = cell(1, length(dataFiles));
% Loads tables to the dataTables cell array
for i = 1:length(dataFiles)
fileName = fullfile(dataDir, dataFiles(i).name);
dataTables{i} = readtable(fileName,"VariableNamingRule","preserve");
end
% Inicialize a cell array for filtered data
filteredDataTables = cell(1, length(dataFiles));
% Runs through all the tables in dataTables
for i = 1:length(dataTables)
% Finds a row that corresponds with the TableName
rowIndex = strcmp(dataList.TableName, dataFiles(i).name);
if any(rowIndex)
% Gets minFlow & maxFlow for the actual table
minFlow = dataList.minFlow(rowIndex);
maxFlow = dataList.maxFlow(rowIndex);
% Filters the tables based on minFlow & maxFlow
filteredDataTables{i} = dataTables{i}(dataTables{i}.("d_Data.Actual.Calculated_Flow") >= minFlow & dataTables{i}.("d_Data.Actual.Calculated_Flow") <= maxFlow, :);
else
% If the tableName is not available executes no changes
filteredDataTables{i} = dataTables{i};
end
end filter, csv, cell array, multiple tables, multiple MATLAB Answers — New Questions
Is Acrobat Pro DC Desktop App supported on Azure Virtual Desktop – Pooled Desktop or as Remote apps?
Hello,
Is Adobe Pro DC Desktop App supported on Azure Virtual Desktop- Pooled Desktop or as Remote apps.
Thanks in Advance for your support.
Hello, Is Adobe Pro DC Desktop App supported on Azure Virtual Desktop- Pooled Desktop or as Remote apps. Thanks in Advance for your support. Read More
Powershell error with the below code
Hi Champions,
Can someone please help me with the below powershell code which i want to upload the key vault secrets excel csv file to azure key vault. But it is giving below error.
$keyVaultName = “Test-marketing”
$data = Import-Csv “C:UsersRam.MuppaneniDownloadsmarketing.csv”
# Iterate over each row in the CSV and create/update the secrets in the Key Vault
foreach ($row in $data) {
$secretName = $row.Name
$secretValue = $row.Secretvalue
# Create or update the secret
Set-AzKeyVaultSecret -VaultName $keyVaultName -Name $secretName -SecretValue $secretValue
}
Getting below error:
Line |
6 | … -VaultName $keyVaultName -Name $secretName -SecretValue $secretValue
| ~~~~~~~~~~~~
| Cannot bind argument to parameter ‘SecretValue’ because it is null.
Excel csv file columns and sample data are below three
Name Secretvalue Type
Marketingpassword1kitchen refrigerator password
I would like to add the above column “Type” as well to the code which needs to upload the data to the keyvault along with the Name and Secretvalue.
Please assist.
Looking forward to hear from you.
Cheers,
Ram
Hi Champions,Can someone please help me with the below powershell code which i want to upload the key vault secrets excel csv file to azure key vault. But it is giving below error.$keyVaultName = “Test-marketing”$data = Import-Csv “C:UsersRam.MuppaneniDownloadsmarketing.csv”# Iterate over each row in the CSV and create/update the secrets in the Key Vaultforeach ($row in $data) {$secretName = $row.Name$secretValue = $row.Secretvalue# Create or update the secretSet-AzKeyVaultSecret -VaultName $keyVaultName -Name $secretName -SecretValue $secretValue}Getting below error:Line |6 | … -VaultName $keyVaultName -Name $secretName -SecretValue $secretValue| ~~~~~~~~~~~~| Cannot bind argument to parameter ‘SecretValue’ because it is null.Excel csv file columns and sample data are below threeName Secretvalue TypeMarketingpassword1kitchen refrigerator password I would like to add the above column “Type” as well to the code which needs to upload the data to the keyvault along with the Name and Secretvalue.Please assist. Looking forward to hear from you.Cheers,Ram Read More
Why is the preprocessor check #if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) ) being generated in private.h?
In the generated code for my model, I have noticed that the following code is generated in the "model_private.h" file:
#if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) )
#error Code was generated for compiler with different sized uchar/char.
Consider adjusting Test hardware word size settings on the
Hardware Implementation pane to match your compiler word sizes as
defined in limits.h of the compiler. Alternatively, you can
select the Test hardware is the same as production hardware option and
select the Enable portable word sizes option on the Code Generation >
Verification pane for ERT based targets, which will disable the
preprocessor word size checks.
#endif
Why is this code being generated?In the generated code for my model, I have noticed that the following code is generated in the "model_private.h" file:
#if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) )
#error Code was generated for compiler with different sized uchar/char.
Consider adjusting Test hardware word size settings on the
Hardware Implementation pane to match your compiler word sizes as
defined in limits.h of the compiler. Alternatively, you can
select the Test hardware is the same as production hardware option and
select the Enable portable word sizes option on the Code Generation >
Verification pane for ERT based targets, which will disable the
preprocessor word size checks.
#endif
Why is this code being generated? In the generated code for my model, I have noticed that the following code is generated in the "model_private.h" file:
#if ( UCHAR_MAX != (0xFFU) ) || ( SCHAR_MAX != (0x7F) )
#error Code was generated for compiler with different sized uchar/char.
Consider adjusting Test hardware word size settings on the
Hardware Implementation pane to match your compiler word sizes as
defined in limits.h of the compiler. Alternatively, you can
select the Test hardware is the same as production hardware option and
select the Enable portable word sizes option on the Code Generation >
Verification pane for ERT based targets, which will disable the
preprocessor word size checks.
#endif
Why is this code being generated? fixedpoint, codegen, header, check, limit MATLAB Answers — New Questions
how to create a histogram for featim?
hi matlab community, is something wrong with my coding below? i want to create a histogram for featim. thnkyou so much.
feat=zeros(982,40);
for k=1:982
A=FYPdatabase{k,1};
featim=gmlog(A);
FYPdatabase{k,5}=featim;
end
hist3(featim);hi matlab community, is something wrong with my coding below? i want to create a histogram for featim. thnkyou so much.
feat=zeros(982,40);
for k=1:982
A=FYPdatabase{k,1};
featim=gmlog(A);
FYPdatabase{k,5}=featim;
end
hist3(featim); hi matlab community, is something wrong with my coding below? i want to create a histogram for featim. thnkyou so much.
feat=zeros(982,40);
for k=1:982
A=FYPdatabase{k,1};
featim=gmlog(A);
FYPdatabase{k,5}=featim;
end
hist3(featim); image processing MATLAB Answers — New Questions
Halo i want to combine 2d slices oct skin images into 3d, after that i want to make an automatic detection volume of epidermis and stratum corneum
i already combine like this
% Initialize variables
rows = []; columns = [];
% Loop through each slice
for k = 1:100
fileName = sprintf(‘_%d.txt’, k);
% Read the text file
sliceImage = dlmread(fileName);
% Check the size of the first slice to initialize the 3D array
if isempty(rows) || isempty(columns)
[rows, columns] = size(sliceImage);
image3d = zeros(rows, columns, 8, ‘uint8’); % Initialize 3D array
end
% Convert to uint8
sliceImage = uint8(sliceImage);
% Put this slice into plane k of the 3D image
image3d(:, :, k) = sliceImage;
endi already combine like this
% Initialize variables
rows = []; columns = [];
% Loop through each slice
for k = 1:100
fileName = sprintf(‘_%d.txt’, k);
% Read the text file
sliceImage = dlmread(fileName);
% Check the size of the first slice to initialize the 3D array
if isempty(rows) || isempty(columns)
[rows, columns] = size(sliceImage);
image3d = zeros(rows, columns, 8, ‘uint8’); % Initialize 3D array
end
% Convert to uint8
sliceImage = uint8(sliceImage);
% Put this slice into plane k of the 3D image
image3d(:, :, k) = sliceImage;
end i already combine like this
% Initialize variables
rows = []; columns = [];
% Loop through each slice
for k = 1:100
fileName = sprintf(‘_%d.txt’, k);
% Read the text file
sliceImage = dlmread(fileName);
% Check the size of the first slice to initialize the 3D array
if isempty(rows) || isempty(columns)
[rows, columns] = size(sliceImage);
image3d = zeros(rows, columns, 8, ‘uint8’); % Initialize 3D array
end
% Convert to uint8
sliceImage = uint8(sliceImage);
% Put this slice into plane k of the 3D image
image3d(:, :, k) = sliceImage;
end 3d plots, image segmentation MATLAB Answers — New Questions