Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • Visual Paradigm
  • IBM
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Archive for: January 2025

Month: January 2025

Problem with Code for my coursera course
Matlab News

Problem with Code for my coursera course

PuTI / 2025-01-27

This is the question I am trying to solve and I also uploading the code i have written and error I am getting, Please help me the error please.This is the question I am trying to solve and I also uploading the code i have written and error I am getting, Please help me the error please. This is the question I am trying to solve and I also uploading the code i have written and error I am getting, Please help me the error please. code, problem, urgent MATLAB Answers — New Questions

​

Intel vs AMD for a new build in 2025
Matlab News

Intel vs AMD for a new build in 2025

PuTI / 2025-01-27

Hello everyone,
I’m planning a new PC build and am currently undecided about which CPU to choose.
I understand that AMD CPUs have faced some slower performance in MATLAB due to Intel MKL but I understand it was solved with the AMD AOCL? Bench instruction results also seem to show a performance difference between Intel and AMD CPUs (but couldn’t check too many).
Intel CPUs seem to have some issues which probably have been solved for 14th gen with the new BIOS updates, and 15th gen is not quite mature. Their power dissipation is quite high.
For MATLAB, I plan to use the Parallel Computing and Optimization Toolboxes. Apart from MATLAB, ANSYS or other FEA software will be the most demanding applications, and I also plan to game from time to time.
I will pair this with an RTX3070 for the moment.
I was looking at the following CPUs:
Intel Ultra 7 265k – $230 / $600
Intel I9 14900k – $390 / $650
AMD Ryzen 7 9800x3D – $474 / $750
AMD Ryzen 7 9950X – $570 /$910
(Prices listed are current and include discounts, with $ CPU / $ CPU+Mobo+RAM)
Thank you!Hello everyone,
I’m planning a new PC build and am currently undecided about which CPU to choose.
I understand that AMD CPUs have faced some slower performance in MATLAB due to Intel MKL but I understand it was solved with the AMD AOCL? Bench instruction results also seem to show a performance difference between Intel and AMD CPUs (but couldn’t check too many).
Intel CPUs seem to have some issues which probably have been solved for 14th gen with the new BIOS updates, and 15th gen is not quite mature. Their power dissipation is quite high.
For MATLAB, I plan to use the Parallel Computing and Optimization Toolboxes. Apart from MATLAB, ANSYS or other FEA software will be the most demanding applications, and I also plan to game from time to time.
I will pair this with an RTX3070 for the moment.
I was looking at the following CPUs:
Intel Ultra 7 265k – $230 / $600
Intel I9 14900k – $390 / $650
AMD Ryzen 7 9800x3D – $474 / $750
AMD Ryzen 7 9950X – $570 /$910
(Prices listed are current and include discounts, with $ CPU / $ CPU+Mobo+RAM)
Thank you! Hello everyone,
I’m planning a new PC build and am currently undecided about which CPU to choose.
I understand that AMD CPUs have faced some slower performance in MATLAB due to Intel MKL but I understand it was solved with the AMD AOCL? Bench instruction results also seem to show a performance difference between Intel and AMD CPUs (but couldn’t check too many).
Intel CPUs seem to have some issues which probably have been solved for 14th gen with the new BIOS updates, and 15th gen is not quite mature. Their power dissipation is quite high.
For MATLAB, I plan to use the Parallel Computing and Optimization Toolboxes. Apart from MATLAB, ANSYS or other FEA software will be the most demanding applications, and I also plan to game from time to time.
I will pair this with an RTX3070 for the moment.
I was looking at the following CPUs:
Intel Ultra 7 265k – $230 / $600
Intel I9 14900k – $390 / $650
AMD Ryzen 7 9800x3D – $474 / $750
AMD Ryzen 7 9950X – $570 /$910
(Prices listed are current and include discounts, with $ CPU / $ CPU+Mobo+RAM)
Thank you! parallel computing toolbox, optimization, pc build, intel vs amd, cpu MATLAB Answers — New Questions

​

The mesh function is not working for me in offline Matlab, but when I check this code in online Matlab, it works. What is the reason?
Matlab News

The mesh function is not working for me in offline Matlab, but when I check this code in online Matlab, it works. What is the reason?

PuTI / 2025-01-27

Post Content Post Content mesh, surf MATLAB Answers — New Questions

​

Simulink dashboard button matching
Matlab News

Simulink dashboard button matching

PuTI / 2025-01-27

I’m looking for suggestions on how to approach a Simulink interface problem.
In case 1 below, both dashboard buttons have connections to constant S1 such that if you change either button, the other button will track.
In case 2 I’m looking to do something similar but with a constant and a button. If I entered 0b0 for desired state, then S2 would change to zero, and the button would shift to A. If I moved the button to B, then S2 would change back to 1, and Desired State would also change to 0b1.
This is a simplified test case of a more complex scenario I want to work up, where there is one binary input (e.g. 0b01010), and 5 buttons, and 5 constants.
In one direction, I could use a matlab function to call set_param if the binary input is changed to set the value of S2. But I am unsure about the other direction.I’m looking for suggestions on how to approach a Simulink interface problem.
In case 1 below, both dashboard buttons have connections to constant S1 such that if you change either button, the other button will track.
In case 2 I’m looking to do something similar but with a constant and a button. If I entered 0b0 for desired state, then S2 would change to zero, and the button would shift to A. If I moved the button to B, then S2 would change back to 1, and Desired State would also change to 0b1.
This is a simplified test case of a more complex scenario I want to work up, where there is one binary input (e.g. 0b01010), and 5 buttons, and 5 constants.
In one direction, I could use a matlab function to call set_param if the binary input is changed to set the value of S2. But I am unsure about the other direction. I’m looking for suggestions on how to approach a Simulink interface problem.
In case 1 below, both dashboard buttons have connections to constant S1 such that if you change either button, the other button will track.
In case 2 I’m looking to do something similar but with a constant and a button. If I entered 0b0 for desired state, then S2 would change to zero, and the button would shift to A. If I moved the button to B, then S2 would change back to 1, and Desired State would also change to 0b1.
This is a simplified test case of a more complex scenario I want to work up, where there is one binary input (e.g. 0b01010), and 5 buttons, and 5 constants.
In one direction, I could use a matlab function to call set_param if the binary input is changed to set the value of S2. But I am unsure about the other direction. simulink, dashboard, buttons, interface MATLAB Answers — New Questions

​

Spectrum analyser can’t plot the whole frequency-time spain
Matlab News

Spectrum analyser can’t plot the whole frequency-time spain

PuTI / 2025-01-27

Hi there,
i try to use Spectrum Analyzer to plot the signal, which benn calculated by Short-time Fourier Transform.
However, i can’t see the whole plot in Spectrum Analyzer, that is, it should show from 0~15s, but actually it only shows 14~15s.Hi there,
i try to use Spectrum Analyzer to plot the signal, which benn calculated by Short-time Fourier Transform.
However, i can’t see the whole plot in Spectrum Analyzer, that is, it should show from 0~15s, but actually it only shows 14~15s. Hi there,
i try to use Spectrum Analyzer to plot the signal, which benn calculated by Short-time Fourier Transform.
However, i can’t see the whole plot in Spectrum Analyzer, that is, it should show from 0~15s, but actually it only shows 14~15s. fft, simulink MATLAB Answers — New Questions

​

MATLAB doesn’t recognize the function optimoptions
Matlab News

MATLAB doesn’t recognize the function optimoptions

PuTI / 2025-01-27

I’m getting an error at the following line:
options = optimoptions(‘ga’,’PopulationSize’,10,’MaxGenerations’,10);
The following message exemplifies the problem.
I’m using the version 9.10 (R2021a) of MATLAB and the version 4.5 (R2021a) of the Global Optimization Toolbox

Any suggestions will be appreciatedI’m getting an error at the following line:
options = optimoptions(‘ga’,’PopulationSize’,10,’MaxGenerations’,10);
The following message exemplifies the problem.
I’m using the version 9.10 (R2021a) of MATLAB and the version 4.5 (R2021a) of the Global Optimization Toolbox

Any suggestions will be appreciated I’m getting an error at the following line:
options = optimoptions(‘ga’,’PopulationSize’,10,’MaxGenerations’,10);
The following message exemplifies the problem.
I’m using the version 9.10 (R2021a) of MATLAB and the version 4.5 (R2021a) of the Global Optimization Toolbox

Any suggestions will be appreciated #unrecognized, optimoptions, #ga MATLAB Answers — New Questions

​

I am trying to edit an old code to simplify it but I keep getting errors. Right now I am getting the script name error even though I have followed instructions fo rnaming
Matlab News

I am trying to edit an old code to simplify it but I keep getting errors. Right now I am getting the script name error even though I have followed instructions fo rnaming

PuTI / 2025-01-27

I get the error saying i can’t have the same script name as the function but it worked before and I haven’t changed the name

%% problem 1c – projectile Quadratic
function [root] = Quadratic(a, b, c, plusOrMinus)
% Quadratic – determine the root of the projectile using the quadratic equation
% a, b, and c are the coefficients of the quadratic equation, plusOrMinus
% is a multiplier (+1 or -1) that selects the + or – in the quadratic
% formula. root is a single root of the quadratic equation that is
% computed using the quadratic formula.
% Erin Gibbs, u1556567, ME EN 1010, HW#2
root = (-b + plusOrMinus * (sqrt(b^2 – (4*a*c)))) / (2 * a);
end
%% test case 1 (positive plusOrMinus)
% equation: x^2 – x – 2 = 0
a = 1;
b = -1;
c = -2;
plusOrMinus = 1;
[root] = Quadratic(a, b, c, plusOrMinus)I get the error saying i can’t have the same script name as the function but it worked before and I haven’t changed the name

%% problem 1c – projectile Quadratic
function [root] = Quadratic(a, b, c, plusOrMinus)
% Quadratic – determine the root of the projectile using the quadratic equation
% a, b, and c are the coefficients of the quadratic equation, plusOrMinus
% is a multiplier (+1 or -1) that selects the + or – in the quadratic
% formula. root is a single root of the quadratic equation that is
% computed using the quadratic formula.
% Erin Gibbs, u1556567, ME EN 1010, HW#2
root = (-b + plusOrMinus * (sqrt(b^2 – (4*a*c)))) / (2 * a);
end
%% test case 1 (positive plusOrMinus)
% equation: x^2 – x – 2 = 0
a = 1;
b = -1;
c = -2;
plusOrMinus = 1;
[root] = Quadratic(a, b, c, plusOrMinus) I get the error saying i can’t have the same script name as the function but it worked before and I haven’t changed the name

%% problem 1c – projectile Quadratic
function [root] = Quadratic(a, b, c, plusOrMinus)
% Quadratic – determine the root of the projectile using the quadratic equation
% a, b, and c are the coefficients of the quadratic equation, plusOrMinus
% is a multiplier (+1 or -1) that selects the + or – in the quadratic
% formula. root is a single root of the quadratic equation that is
% computed using the quadratic formula.
% Erin Gibbs, u1556567, ME EN 1010, HW#2
root = (-b + plusOrMinus * (sqrt(b^2 – (4*a*c)))) / (2 * a);
end
%% test case 1 (positive plusOrMinus)
% equation: x^2 – x – 2 = 0
a = 1;
b = -1;
c = -2;
plusOrMinus = 1;
[root] = Quadratic(a, b, c, plusOrMinus) arduino, function, script name MATLAB Answers — New Questions

​

PC specs for heavy & complex simulations
Matlab News

PC specs for heavy & complex simulations

PuTI / 2025-01-27

Hello everone,
I have a complex model which takes very long time to be built, too much time in simulation & may cause MATLAB to crash.
In my last trial, the CPU load was around 89% & memory usage was 90%.
I want to know what specs should I have to simulate large & complex model easily without heavy loading & taking much time, my currently specs are: CPU: 13th Gen Intel® Core™ i5-1335U 1.3 GHz // RAM: 16 GB DDR4 3200 MHz // GPU: Intel® Iris® Xe Graphics Family.Hello everone,
I have a complex model which takes very long time to be built, too much time in simulation & may cause MATLAB to crash.
In my last trial, the CPU load was around 89% & memory usage was 90%.
I want to know what specs should I have to simulate large & complex model easily without heavy loading & taking much time, my currently specs are: CPU: 13th Gen Intel® Core™ i5-1335U 1.3 GHz // RAM: 16 GB DDR4 3200 MHz // GPU: Intel® Iris® Xe Graphics Family. Hello everone,
I have a complex model which takes very long time to be built, too much time in simulation & may cause MATLAB to crash.
In my last trial, the CPU load was around 89% & memory usage was 90%.
I want to know what specs should I have to simulate large & complex model easily without heavy loading & taking much time, my currently specs are: CPU: 13th Gen Intel® Core™ i5-1335U 1.3 GHz // RAM: 16 GB DDR4 3200 MHz // GPU: Intel® Iris® Xe Graphics Family. simulation, simulink, matlab, specs, cpu load, model, complex MATLAB Answers — New Questions

​

Thingspeak update with error code 211 from Arduinos
Matlab News

Thingspeak update with error code 211 from Arduinos

PuTI / 2025-01-27

Hello, I have been encountering several times a day for a few weeks an error when updating my data stored on Thingspeak (computerized hive parameters).
The return code of my Arduinos is 211!
But I can’t find the meaning of this code anywhere…

Does anyone know more?
Here is one of my hives: https://thingspeak.mathworks.com/channels/1289244
Thanks
PS: The update continues to be done but it seems to be missing points (those that return the error 211)Hello, I have been encountering several times a day for a few weeks an error when updating my data stored on Thingspeak (computerized hive parameters).
The return code of my Arduinos is 211!
But I can’t find the meaning of this code anywhere…

Does anyone know more?
Here is one of my hives: https://thingspeak.mathworks.com/channels/1289244
Thanks
PS: The update continues to be done but it seems to be missing points (those that return the error 211) Hello, I have been encountering several times a day for a few weeks an error when updating my data stored on Thingspeak (computerized hive parameters).
The return code of my Arduinos is 211!
But I can’t find the meaning of this code anywhere…

Does anyone know more?
Here is one of my hives: https://thingspeak.mathworks.com/channels/1289244
Thanks
PS: The update continues to be done but it seems to be missing points (those that return the error 211) thingspeak, arduino, error 211 MATLAB Answers — New Questions

​

Can’t solve linker error in building  S-Function Builder
Matlab News

Can’t solve linker error in building S-Function Builder

PuTI / 2025-01-26

I got this kind of model with S-Function Builder as shown in this image.

But When I build it, I got this error.
#’smex_builder.cpp’
was created successfully

###’smex_builder_wrapper.cpp’
was created successfully

###’smex_builder.tlc’
was created successfully
????? smex_builder.lib ??????? smex_builder.exp ???? smex_builder_wrapper.obj : error LNK2019: ?????????? OrtGetApiBase ??? "void __cdecl `dynamic initializer for ‘public: static struct OrtApi const * const Ort::Global::api_”(void)" (??__E?api_@?$Global@X@Ort@@2PEBUOrtApi@@EB@@YAXXZ) ???????? smex_builder.mexw64 : fatal error LNK1120: 1 ??????????

Also, I set parameter tab and library tab like this.
[Port and parameter] tab

[library] tab

I run " mex -setup C++" command and it shows Visual Studio 2022.
I use attached ONNX model as zip file.(out_modified_empty_model.onnx)
Structure of my onnx is like this.

Do you happen to know the solution?
I’m not sure about why this error… I’d be happy if you could give me any advice.

For your information,
I tried this C++ code in S-Function Builder Editor, but I can not figure out what is the cause and where I am missing.

#include "mex.h"
#include <math.h>
#include <onnxruntime_cxx_api.h>
#include <vector>
#include <memory>

extern std::unique_ptrOrt::Env g_env;
extern std::unique_ptrOrt::Session g_session;
extern std::vector<const char> g_input_node_names;
extern std::vector<const char*> g_output_node_names;

void smex_builder_Start_wrapper(void)
{

try {

g_env = std::make_uniqueOrt::Env(ORT_LOGGING_LEVEL_WARNING, "test");

Ort::SessionOptions session_options;
session_options.SetIntraOpNumThreads(1);
session_options.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED);

const wchar_t model_path = L"out_modified_empty_model.onnx";
g_session = std::make_uniqueOrt::Session(g_env, model_path, session_options);

Ort::AllocatorWithDefaultOptions allocator;

size_t num_input_nodes = g_session->GetInputCount();
g_input_node_names.resize(num_input_nodes);
for (size_t i = 0; i < num_input_nodes; i++) {
auto input_name = g_session->GetInputNameAllocated(i, allocator);
g_input_node_names[i] = input_name.get();
}

size_t num_output_nodes = g_session->GetOutputCount();
g_output_node_names.resize(num_output_nodes);
for (size_t i = 0; i < num_output_nodes; i++) {
auto output_name = g_session->GetOutputNameAllocated(i, allocator);
g_output_node_names[i] = output_name.get();
}
}
catch (const Ort::Exception& ex) {
mexErrMsgIdAndTxt("myOnnxSfunc:InitError", "初期化エラー: %s", ex.what());
}

}

void smex_builder_Outputs_wrapper(const real_T *u0,
const real_T *u1,
const real_T *u2,
const real_T *u3,
const real_T *u4,
const real_T *u5,
const real_T *u6,
real_T *y0,
real_T y1)
{

mexErrMsgIdAndTxt("mySfunc:TestError", "mexErrMsgIdAndTxt のテストエラー");

try {

std::vector<float> input_data(7);

input_data[0] = static_cast<float>(*u0);
input_data[1] = static_cast<float>(*u1);
input_data[2] = static_cast<float>(*u2);
input_data[3] = static_cast<float>(*u3);
input_data[4] = static_cast<float>(u4);
input_data[5] = static_cast<float>(u5);
input_data[6] = static_cast<float>(u6);

std::vector<int64_t> input_shape = { 1, 7 };
Ort::MemoryInfo memory_info = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
Ort::Value input_tensor = Ort::Value::CreateTensor<float>(
memory_info,
input_data.data(),
input_data.size(),
input_shape.data(),
input_shape.size()
);

auto output_tensors = g_session->Run(
Ort::RunOptions{ nullptr },
g_input_node_names.data(),
&input_tensor,
1,
g_output_node_names.data(),
g_output_node_names.size()
);

// Assuming your model outputs two tensors.
if (output_tensors.size() != 2) {
mexErrMsgIdAndTxt("myOnnxSfunc:OutputError",
"モデルは2つのテンソルを出力する必要があります。");
}

// Check the shape of the first output tensor.
float output_data0 = output_tensors[0].GetTensorMutableData<float>();
auto type_info0 = output_tensors[0].GetTensorTypeAndShapeInfo();
auto output_shape0 = type_info0.GetShape();

if (output_shape0.size() != 2 || output_shape0[0] != 1 || output_shape0[1] != 1) {
mexErrMsgIdAndTxt("myOnnxSfunc:OutputError",
"出力テンソル0の形状が不正です。期待される形状: (1, 1)");
}

// Check the shape of the second output tensor.
float output_data1 = output_tensors[1].GetTensorMutableData<float>();
auto type_info1 = output_tensors[1].GetTensorTypeAndShapeInfo();
auto output_shape1 = type_info1.GetShape();

if (output_shape1.size() != 2 || output_shape1[0] != 1 || output_shape1[1] != 1) {
mexErrMsgIdAndTxt("myOnnxSfunc:OutputError",
"出力テンソル1の形状が不正です。期待される形状: (1, 1)");
}
// Simulink出力ポートへの書き込み
y0[0] = static_cast<double>(output_data0[0]); // y0 に最初の出力
y1[0] = static_cast<double>(output_data1[0]); // y1 に2番目の出力
}
catch (const Ort::Exception& ex) {
mexErrMsgIdAndTxt("myOnnxSfunc:RuntimeError", "実行時エラー: %s", ex.what());
}

}

void smex_builder_Terminate_wrapper(void)
{

g_session.reset();
g_env.reset();
g_input_node_names.clear();
g_output_node_names.clear();

}I got this kind of model with S-Function Builder as shown in this image.

But When I build it, I got this error.
#’smex_builder.cpp’
was created successfully

###’smex_builder_wrapper.cpp’
was created successfully

###’smex_builder.tlc’
was created successfully
????? smex_builder.lib ??????? smex_builder.exp ???? smex_builder_wrapper.obj : error LNK2019: ?????????? OrtGetApiBase ??? "void __cdecl `dynamic initializer for ‘public: static struct OrtApi const * const Ort::Global::api_”(void)" (??__E?api_@?$Global@X@Ort@@2PEBUOrtApi@@EB@@YAXXZ) ???????? smex_builder.mexw64 : fatal error LNK1120: 1 ??????????

Also, I set parameter tab and library tab like this.
[Port and parameter] tab

[library] tab

I run " mex -setup C++" command and it shows Visual Studio 2022.
I use attached ONNX model as zip file.(out_modified_empty_model.onnx)
Structure of my onnx is like this.

Do you happen to know the solution?
I’m not sure about why this error… I’d be happy if you could give me any advice.

For your information,
I tried this C++ code in S-Function Builder Editor, but I can not figure out what is the cause and where I am missing.

#include "mex.h"
#include <math.h>
#include <onnxruntime_cxx_api.h>
#include <vector>
#include <memory>

extern std::unique_ptrOrt::Env g_env;
extern std::unique_ptrOrt::Session g_session;
extern std::vector<const char> g_input_node_names;
extern std::vector<const char*> g_output_node_names;

void smex_builder_Start_wrapper(void)
{

try {

g_env = std::make_uniqueOrt::Env(ORT_LOGGING_LEVEL_WARNING, "test");

Ort::SessionOptions session_options;
session_options.SetIntraOpNumThreads(1);
session_options.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED);

const wchar_t model_path = L"out_modified_empty_model.onnx";
g_session = std::make_uniqueOrt::Session(g_env, model_path, session_options);

Ort::AllocatorWithDefaultOptions allocator;

size_t num_input_nodes = g_session->GetInputCount();
g_input_node_names.resize(num_input_nodes);
for (size_t i = 0; i < num_input_nodes; i++) {
auto input_name = g_session->GetInputNameAllocated(i, allocator);
g_input_node_names[i] = input_name.get();
}

size_t num_output_nodes = g_session->GetOutputCount();
g_output_node_names.resize(num_output_nodes);
for (size_t i = 0; i < num_output_nodes; i++) {
auto output_name = g_session->GetOutputNameAllocated(i, allocator);
g_output_node_names[i] = output_name.get();
}
}
catch (const Ort::Exception& ex) {
mexErrMsgIdAndTxt("myOnnxSfunc:InitError", "初期化エラー: %s", ex.what());
}

}

void smex_builder_Outputs_wrapper(const real_T *u0,
const real_T *u1,
const real_T *u2,
const real_T *u3,
const real_T *u4,
const real_T *u5,
const real_T *u6,
real_T *y0,
real_T y1)
{

mexErrMsgIdAndTxt("mySfunc:TestError", "mexErrMsgIdAndTxt のテストエラー");

try {

std::vector<float> input_data(7);

input_data[0] = static_cast<float>(*u0);
input_data[1] = static_cast<float>(*u1);
input_data[2] = static_cast<float>(*u2);
input_data[3] = static_cast<float>(*u3);
input_data[4] = static_cast<float>(u4);
input_data[5] = static_cast<float>(u5);
input_data[6] = static_cast<float>(u6);

std::vector<int64_t> input_shape = { 1, 7 };
Ort::MemoryInfo memory_info = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
Ort::Value input_tensor = Ort::Value::CreateTensor<float>(
memory_info,
input_data.data(),
input_data.size(),
input_shape.data(),
input_shape.size()
);

auto output_tensors = g_session->Run(
Ort::RunOptions{ nullptr },
g_input_node_names.data(),
&input_tensor,
1,
g_output_node_names.data(),
g_output_node_names.size()
);

// Assuming your model outputs two tensors.
if (output_tensors.size() != 2) {
mexErrMsgIdAndTxt("myOnnxSfunc:OutputError",
"モデルは2つのテンソルを出力する必要があります。");
}

// Check the shape of the first output tensor.
float output_data0 = output_tensors[0].GetTensorMutableData<float>();
auto type_info0 = output_tensors[0].GetTensorTypeAndShapeInfo();
auto output_shape0 = type_info0.GetShape();

if (output_shape0.size() != 2 || output_shape0[0] != 1 || output_shape0[1] != 1) {
mexErrMsgIdAndTxt("myOnnxSfunc:OutputError",
"出力テンソル0の形状が不正です。期待される形状: (1, 1)");
}

// Check the shape of the second output tensor.
float output_data1 = output_tensors[1].GetTensorMutableData<float>();
auto type_info1 = output_tensors[1].GetTensorTypeAndShapeInfo();
auto output_shape1 = type_info1.GetShape();

if (output_shape1.size() != 2 || output_shape1[0] != 1 || output_shape1[1] != 1) {
mexErrMsgIdAndTxt("myOnnxSfunc:OutputError",
"出力テンソル1の形状が不正です。期待される形状: (1, 1)");
}
// Simulink出力ポートへの書き込み
y0[0] = static_cast<double>(output_data0[0]); // y0 に最初の出力
y1[0] = static_cast<double>(output_data1[0]); // y1 に2番目の出力
}
catch (const Ort::Exception& ex) {
mexErrMsgIdAndTxt("myOnnxSfunc:RuntimeError", "実行時エラー: %s", ex.what());
}

}

void smex_builder_Terminate_wrapper(void)
{

g_session.reset();
g_env.reset();
g_input_node_names.clear();
g_output_node_names.clear();

} I got this kind of model with S-Function Builder as shown in this image.

But When I build it, I got this error.
#’smex_builder.cpp’
was created successfully

###’smex_builder_wrapper.cpp’
was created successfully

###’smex_builder.tlc’
was created successfully
????? smex_builder.lib ??????? smex_builder.exp ???? smex_builder_wrapper.obj : error LNK2019: ?????????? OrtGetApiBase ??? "void __cdecl `dynamic initializer for ‘public: static struct OrtApi const * const Ort::Global::api_”(void)" (??__E?api_@?$Global@X@Ort@@2PEBUOrtApi@@EB@@YAXXZ) ???????? smex_builder.mexw64 : fatal error LNK1120: 1 ??????????

Also, I set parameter tab and library tab like this.
[Port and parameter] tab

[library] tab

I run " mex -setup C++" command and it shows Visual Studio 2022.
I use attached ONNX model as zip file.(out_modified_empty_model.onnx)
Structure of my onnx is like this.

Do you happen to know the solution?
I’m not sure about why this error… I’d be happy if you could give me any advice.

For your information,
I tried this C++ code in S-Function Builder Editor, but I can not figure out what is the cause and where I am missing.

#include "mex.h"
#include <math.h>
#include <onnxruntime_cxx_api.h>
#include <vector>
#include <memory>

extern std::unique_ptrOrt::Env g_env;
extern std::unique_ptrOrt::Session g_session;
extern std::vector<const char> g_input_node_names;
extern std::vector<const char*> g_output_node_names;

void smex_builder_Start_wrapper(void)
{

try {

g_env = std::make_uniqueOrt::Env(ORT_LOGGING_LEVEL_WARNING, "test");

Ort::SessionOptions session_options;
session_options.SetIntraOpNumThreads(1);
session_options.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED);

const wchar_t model_path = L"out_modified_empty_model.onnx";
g_session = std::make_uniqueOrt::Session(g_env, model_path, session_options);

Ort::AllocatorWithDefaultOptions allocator;

size_t num_input_nodes = g_session->GetInputCount();
g_input_node_names.resize(num_input_nodes);
for (size_t i = 0; i < num_input_nodes; i++) {
auto input_name = g_session->GetInputNameAllocated(i, allocator);
g_input_node_names[i] = input_name.get();
}

size_t num_output_nodes = g_session->GetOutputCount();
g_output_node_names.resize(num_output_nodes);
for (size_t i = 0; i < num_output_nodes; i++) {
auto output_name = g_session->GetOutputNameAllocated(i, allocator);
g_output_node_names[i] = output_name.get();
}
}
catch (const Ort::Exception& ex) {
mexErrMsgIdAndTxt("myOnnxSfunc:InitError", "初期化エラー: %s", ex.what());
}

}

void smex_builder_Outputs_wrapper(const real_T *u0,
const real_T *u1,
const real_T *u2,
const real_T *u3,
const real_T *u4,
const real_T *u5,
const real_T *u6,
real_T *y0,
real_T y1)
{

mexErrMsgIdAndTxt("mySfunc:TestError", "mexErrMsgIdAndTxt のテストエラー");

try {

std::vector<float> input_data(7);

input_data[0] = static_cast<float>(*u0);
input_data[1] = static_cast<float>(*u1);
input_data[2] = static_cast<float>(*u2);
input_data[3] = static_cast<float>(*u3);
input_data[4] = static_cast<float>(u4);
input_data[5] = static_cast<float>(u5);
input_data[6] = static_cast<float>(u6);

std::vector<int64_t> input_shape = { 1, 7 };
Ort::MemoryInfo memory_info = Ort::MemoryInfo::CreateCpu(OrtDeviceAllocator, OrtMemTypeCPU);
Ort::Value input_tensor = Ort::Value::CreateTensor<float>(
memory_info,
input_data.data(),
input_data.size(),
input_shape.data(),
input_shape.size()
);

auto output_tensors = g_session->Run(
Ort::RunOptions{ nullptr },
g_input_node_names.data(),
&input_tensor,
1,
g_output_node_names.data(),
g_output_node_names.size()
);

// Assuming your model outputs two tensors.
if (output_tensors.size() != 2) {
mexErrMsgIdAndTxt("myOnnxSfunc:OutputError",
"モデルは2つのテンソルを出力する必要があります。");
}

// Check the shape of the first output tensor.
float output_data0 = output_tensors[0].GetTensorMutableData<float>();
auto type_info0 = output_tensors[0].GetTensorTypeAndShapeInfo();
auto output_shape0 = type_info0.GetShape();

if (output_shape0.size() != 2 || output_shape0[0] != 1 || output_shape0[1] != 1) {
mexErrMsgIdAndTxt("myOnnxSfunc:OutputError",
"出力テンソル0の形状が不正です。期待される形状: (1, 1)");
}

// Check the shape of the second output tensor.
float output_data1 = output_tensors[1].GetTensorMutableData<float>();
auto type_info1 = output_tensors[1].GetTensorTypeAndShapeInfo();
auto output_shape1 = type_info1.GetShape();

if (output_shape1.size() != 2 || output_shape1[0] != 1 || output_shape1[1] != 1) {
mexErrMsgIdAndTxt("myOnnxSfunc:OutputError",
"出力テンソル1の形状が不正です。期待される形状: (1, 1)");
}
// Simulink出力ポートへの書き込み
y0[0] = static_cast<double>(output_data0[0]); // y0 に最初の出力
y1[0] = static_cast<double>(output_data1[0]); // y1 に2番目の出力
}
catch (const Ort::Exception& ex) {
mexErrMsgIdAndTxt("myOnnxSfunc:RuntimeError", "実行時エラー: %s", ex.what());
}

}

void smex_builder_Terminate_wrapper(void)
{

g_session.reset();
g_env.reset();
g_input_node_names.clear();
g_output_node_names.clear();

} s-function, c++ MATLAB Answers — New Questions

​

How to Create a Standalone .exe File from Simulink Code?
Matlab News

How to Create a Standalone .exe File from Simulink Code?

PuTI / 2025-01-26

Hello Community,
I’m currently working on creating a standalone executable (.exe) from my Simulink project, and I need some guidance.
Here’s my current setup:
I have a .m file that loads variables into the workspace and runs the simulation. It also processes and visualizes the results afterward.
I used Simulink Coder to generate C code from the Simulink model. I chose the option to generate code only (without "Execute Makefile"), so now I have a collection of .c and .h files.
My questions:
How can I use these generated files to build a standalone .exe file?
Do I need additional files from the MATLAB/Simulink installation (e.g., libraries, .c files or other runtime components)?
Is it possible to use Visual Studio or another compiler to compile the .c files into an executable? If yes, are there specific steps or configurations I need to follow?
I’m relatively new to this process, so I appreciate any instructions or resources to help me bridge the gap from generated C code to a functional executable.
Thank you in advance for your help!
Best regards,
AaronHello Community,
I’m currently working on creating a standalone executable (.exe) from my Simulink project, and I need some guidance.
Here’s my current setup:
I have a .m file that loads variables into the workspace and runs the simulation. It also processes and visualizes the results afterward.
I used Simulink Coder to generate C code from the Simulink model. I chose the option to generate code only (without "Execute Makefile"), so now I have a collection of .c and .h files.
My questions:
How can I use these generated files to build a standalone .exe file?
Do I need additional files from the MATLAB/Simulink installation (e.g., libraries, .c files or other runtime components)?
Is it possible to use Visual Studio or another compiler to compile the .c files into an executable? If yes, are there specific steps or configurations I need to follow?
I’m relatively new to this process, so I appreciate any instructions or resources to help me bridge the gap from generated C code to a functional executable.
Thank you in advance for your help!
Best regards,
Aaron Hello Community,
I’m currently working on creating a standalone executable (.exe) from my Simulink project, and I need some guidance.
Here’s my current setup:
I have a .m file that loads variables into the workspace and runs the simulation. It also processes and visualizes the results afterward.
I used Simulink Coder to generate C code from the Simulink model. I chose the option to generate code only (without "Execute Makefile"), so now I have a collection of .c and .h files.
My questions:
How can I use these generated files to build a standalone .exe file?
Do I need additional files from the MATLAB/Simulink installation (e.g., libraries, .c files or other runtime components)?
Is it possible to use Visual Studio or another compiler to compile the .c files into an executable? If yes, are there specific steps or configurations I need to follow?
I’m relatively new to this process, so I appreciate any instructions or resources to help me bridge the gap from generated C code to a functional executable.
Thank you in advance for your help!
Best regards,
Aaron exe, c++, simulink MATLAB Answers — New Questions

​

Trying to plot two vectors of unequal lengths on the same X and Y axes
Matlab News

Trying to plot two vectors of unequal lengths on the same X and Y axes

PuTI / 2025-01-26

Hello, I am trying to plot two vectors of unequal lengths on the same set of axes. One potential solution I have thought of is to bin the longer vector, such that the number of bins equals the length of the smaller vector. Then, I could take the average within each bin. However, I dont know how I would go about doing this, or if there is some other way.
I would appreciate any help in trying to figure this out! Thank you!Hello, I am trying to plot two vectors of unequal lengths on the same set of axes. One potential solution I have thought of is to bin the longer vector, such that the number of bins equals the length of the smaller vector. Then, I could take the average within each bin. However, I dont know how I would go about doing this, or if there is some other way.
I would appreciate any help in trying to figure this out! Thank you! Hello, I am trying to plot two vectors of unequal lengths on the same set of axes. One potential solution I have thought of is to bin the longer vector, such that the number of bins equals the length of the smaller vector. Then, I could take the average within each bin. However, I dont know how I would go about doing this, or if there is some other way.
I would appreciate any help in trying to figure this out! Thank you! vectors, binning, average, plot MATLAB Answers — New Questions

​

Which statistic is minimized in curve fitting app
Matlab News

Which statistic is minimized in curve fitting app

PuTI / 2025-01-26

Dear colleagues,
The statistics which evaluate the goodness of in the Curve Fitting app are shown in the picture below.

At this link is given a description of each of these.
https://nl.mathworks.com/help/curvefit/evaluating-goodness-of-fit.html
My question is what parameter/statistic is minimized to make a fit? In another discussion I have read something about 2-norm. So is some of shown above a 2-norm?Dear colleagues,
The statistics which evaluate the goodness of in the Curve Fitting app are shown in the picture below.

At this link is given a description of each of these.
https://nl.mathworks.com/help/curvefit/evaluating-goodness-of-fit.html
My question is what parameter/statistic is minimized to make a fit? In another discussion I have read something about 2-norm. So is some of shown above a 2-norm? Dear colleagues,
The statistics which evaluate the goodness of in the Curve Fitting app are shown in the picture below.

At this link is given a description of each of these.
https://nl.mathworks.com/help/curvefit/evaluating-goodness-of-fit.html
My question is what parameter/statistic is minimized to make a fit? In another discussion I have read something about 2-norm. So is some of shown above a 2-norm? curve fitting MATLAB Answers — New Questions

​

CRLB in Mean Square Error
Matlab News

CRLB in Mean Square Error

PuTI / 2025-01-26

in my code i am having FIM Function[ function [J_11, J_12, J_22] = FIM(para, Rx, beta, scale)]. i want to use this function in my dnn for MSE to calculate traces of CRLB. how i can doin my code i am having FIM Function[ function [J_11, J_12, J_22] = FIM(para, Rx, beta, scale)]. i want to use this function in my dnn for MSE to calculate traces of CRLB. how i can do in my code i am having FIM Function[ function [J_11, J_12, J_22] = FIM(para, Rx, beta, scale)]. i want to use this function in my dnn for MSE to calculate traces of CRLB. how i can do crlb, mse MATLAB Answers — New Questions

​

What happens if I set both RelTol and AbsTol for ODE45 and/or both TolX and Tolfun for FSOLVE?
Matlab News

What happens if I set both RelTol and AbsTol for ODE45 and/or both TolX and Tolfun for FSOLVE?

PuTI / 2025-01-26

I’m solving an eigenvalue problem via a combination of ODE45 and FSOLVE, and I’m not sure what happens if I set both RelTol and AbsTol for the former and both TolX and Tolfun for the latter. Do these functions refine steps, etc. until both requirements are satisfied or only one of them?I’m solving an eigenvalue problem via a combination of ODE45 and FSOLVE, and I’m not sure what happens if I set both RelTol and AbsTol for the former and both TolX and Tolfun for the latter. Do these functions refine steps, etc. until both requirements are satisfied or only one of them? I’m solving an eigenvalue problem via a combination of ODE45 and FSOLVE, and I’m not sure what happens if I set both RelTol and AbsTol for the former and both TolX and Tolfun for the latter. Do these functions refine steps, etc. until both requirements are satisfied or only one of them? ode45, fsolve, tolerance MATLAB Answers — New Questions

​

PNG file saving in power point presentation
Matlab News

PNG file saving in power point presentation

PuTI / 2025-01-26

clear
clc

%removed the clear all, close all, clc, as they are irrelevant here and can only cause problems
project_dir = pwd(); %new
% List all current folder contents ending with .png. Resulting names will
% appear in the order returned by the operating system.
files = dir( fullfile(project_dir, ‘*.png’)); %changed
% Create Common Object Model (COM) server so MATLAB can export data to
% PowerPoint
g = actxserver(‘powerpoint.application’);
% Open PowerPoint and make it visible
g.Visible = 1;
Presentation = g.Presentation;
% Prompt the user for the PowerPoint file to amend
[fn, pn] = uigetfile(‘*.pptx’, ‘Select PowerPoint File To Amend’);
filename = fullfile(pn, fn); %changed
Presentation = invoke(Presentation, ‘open’, filename);
% Get current number of slides
slide_count = get(Presentation.Slides, ‘Count’);
% Export all PNGs in the current directory to the PowerPoint file specified
% above. The following slides will be added to the END of the PowerPoint
% file. All slides will have a common title.
for i=1:length(files)
slide_count = int32(double(slide_count)+1);
slide = invoke(Presentation.Slides, ‘Add’, slide_count{i}, 11);
set(slide.Shapes.Title.Textframe.Textrange, ‘Text’, ‘SomeTitle’);
slidefile = fullfile(project_dir, files(i).name); %new
Image{i} = slide.Shapes.AddPicture(slidefile, ‘msoFalse’, ‘msoTrue’, 0, 80, 720, 440); %changed
end
% Save the amended PowerPoint presentation to the current directory
outfile = fullfile(project_dir, ‘DRAFT.pptx’); %new
Presentation.SaveAs(outfile); %changed
% Close PowerPoint as a COM automation server
g.Quit;
g.delete;
If i have 4 PNG images in a folder , how can i save (present) those in a single slide in power point using MATLAB code? I am using the code below but showing some error.clear
clc

%removed the clear all, close all, clc, as they are irrelevant here and can only cause problems
project_dir = pwd(); %new
% List all current folder contents ending with .png. Resulting names will
% appear in the order returned by the operating system.
files = dir( fullfile(project_dir, ‘*.png’)); %changed
% Create Common Object Model (COM) server so MATLAB can export data to
% PowerPoint
g = actxserver(‘powerpoint.application’);
% Open PowerPoint and make it visible
g.Visible = 1;
Presentation = g.Presentation;
% Prompt the user for the PowerPoint file to amend
[fn, pn] = uigetfile(‘*.pptx’, ‘Select PowerPoint File To Amend’);
filename = fullfile(pn, fn); %changed
Presentation = invoke(Presentation, ‘open’, filename);
% Get current number of slides
slide_count = get(Presentation.Slides, ‘Count’);
% Export all PNGs in the current directory to the PowerPoint file specified
% above. The following slides will be added to the END of the PowerPoint
% file. All slides will have a common title.
for i=1:length(files)
slide_count = int32(double(slide_count)+1);
slide = invoke(Presentation.Slides, ‘Add’, slide_count{i}, 11);
set(slide.Shapes.Title.Textframe.Textrange, ‘Text’, ‘SomeTitle’);
slidefile = fullfile(project_dir, files(i).name); %new
Image{i} = slide.Shapes.AddPicture(slidefile, ‘msoFalse’, ‘msoTrue’, 0, 80, 720, 440); %changed
end
% Save the amended PowerPoint presentation to the current directory
outfile = fullfile(project_dir, ‘DRAFT.pptx’); %new
Presentation.SaveAs(outfile); %changed
% Close PowerPoint as a COM automation server
g.Quit;
g.delete;
If i have 4 PNG images in a folder , how can i save (present) those in a single slide in power point using MATLAB code? I am using the code below but showing some error. clear
clc

%removed the clear all, close all, clc, as they are irrelevant here and can only cause problems
project_dir = pwd(); %new
% List all current folder contents ending with .png. Resulting names will
% appear in the order returned by the operating system.
files = dir( fullfile(project_dir, ‘*.png’)); %changed
% Create Common Object Model (COM) server so MATLAB can export data to
% PowerPoint
g = actxserver(‘powerpoint.application’);
% Open PowerPoint and make it visible
g.Visible = 1;
Presentation = g.Presentation;
% Prompt the user for the PowerPoint file to amend
[fn, pn] = uigetfile(‘*.pptx’, ‘Select PowerPoint File To Amend’);
filename = fullfile(pn, fn); %changed
Presentation = invoke(Presentation, ‘open’, filename);
% Get current number of slides
slide_count = get(Presentation.Slides, ‘Count’);
% Export all PNGs in the current directory to the PowerPoint file specified
% above. The following slides will be added to the END of the PowerPoint
% file. All slides will have a common title.
for i=1:length(files)
slide_count = int32(double(slide_count)+1);
slide = invoke(Presentation.Slides, ‘Add’, slide_count{i}, 11);
set(slide.Shapes.Title.Textframe.Textrange, ‘Text’, ‘SomeTitle’);
slidefile = fullfile(project_dir, files(i).name); %new
Image{i} = slide.Shapes.AddPicture(slidefile, ‘msoFalse’, ‘msoTrue’, 0, 80, 720, 440); %changed
end
% Save the amended PowerPoint presentation to the current directory
outfile = fullfile(project_dir, ‘DRAFT.pptx’); %new
Presentation.SaveAs(outfile); %changed
% Close PowerPoint as a COM automation server
g.Quit;
g.delete;
If i have 4 PNG images in a folder , how can i save (present) those in a single slide in power point using MATLAB code? I am using the code below but showing some error. image MATLAB Answers — New Questions

​

I need to draw a shape in matlab help me
Matlab News

I need to draw a shape in matlab help me

PuTI / 2025-01-26

Hi,I simulate something in matlab .For those wondering, this is the cross section of the rotor in the axial compressor.. I want to draw this picture in matlab same dimensions,same angles,and same shape.Additionally, I would like to have red dots at the corners of the angled areas where they intersect with the horizontal axes. I am open to your suggestions regarding this.Of course, dashed lines also need to be drawn. The dashed lines can be in blue. My drawing needs to start from the origin point.It needs to be added to the code I will post below and changed when I change the values related to the shape in the code.
% datas
rpm = 30000; % rev/min
Pti_Pte = 1.5; % compression ratio
efficiency = 0.9; % isentropic efficiency
mass_flow_rate = 1.6; % kg/s
r1s = 0.15; % m (stator distance from rotor axis)
aspect_ratio = 0.7; % geometrical ratio
P_amb = 101325; % Pa
T0 = 288.15; % K (environmental temperature)
gamma = 1.4; % specific heat ratio of air
cp = 1005; % J/(kg·K)
load_coefficient = 0.4;

% Calculating chord length and r2h from aspect ratio
chord = r1s / aspect_ratio; % chord = span / aspect_ratio
r2h = r1s – chord; % Shroud radius

% Step 1: Isenthalpic Relations and Tt2s Calculation
Tt1 = T0; % St2-St1 = 0
Tt2s = Tt1 * (Pti_Pte ^ ((gamma – 1) / gamma));

% Step 2: Tt2 calculations
Tt2 = Tt1 + (Tt2s – Tt1) / efficiency;

% Step 3: Enthalpy change (Delta H)
delta_h = cp * (Tt2 – Tt1); % J/kg

% Step 4: Umean calculation
U_mean = sqrt(delta_h / load_coefficient); % m/s

% Step 5: Axial velocity ve Mach Number
rho = P_amb / (287 * T0); % Density, ideal gas equation
V_axial = U_mean *0.5; % Axial hız
Mach = V_axial / sqrt(gamma * 287 * T0); % Mach sayısı

% Step 6: Calculation of Angles
V_theta2 = delta_h / U_mean; %
beta1 = atan(U_mean / V_axial)* (180 / pi); % Beta1 angle (degree)
beta2 = atan((U_mean – V_theta2) / V_axial) * (180 / pi); % Beta2 angle (degree)

% % Visualization of Results
fprintf(‘Tt2s: %.2f Kn’, Tt2s);
fprintf(‘Tt2: %.2f Kn’, Tt2);
fprintf(‘Delta H: %.2f J/kgn’, delta_h);
fprintf(‘Umean: %.2f m/sn’, U_mean);
fprintf(‘Mach Number: %.2fn’, Mach);
fprintf(‘V_axial: %.2f m/sn’, V_axial);
fprintf(‘V_theta2: %.2f m/sn’, V_theta2);
fprintf(‘Beta1: %.2f derecen’, beta1);
fprintf(‘Beta2: %.2f derecen’, beta2);Hi,I simulate something in matlab .For those wondering, this is the cross section of the rotor in the axial compressor.. I want to draw this picture in matlab same dimensions,same angles,and same shape.Additionally, I would like to have red dots at the corners of the angled areas where they intersect with the horizontal axes. I am open to your suggestions regarding this.Of course, dashed lines also need to be drawn. The dashed lines can be in blue. My drawing needs to start from the origin point.It needs to be added to the code I will post below and changed when I change the values related to the shape in the code.
% datas
rpm = 30000; % rev/min
Pti_Pte = 1.5; % compression ratio
efficiency = 0.9; % isentropic efficiency
mass_flow_rate = 1.6; % kg/s
r1s = 0.15; % m (stator distance from rotor axis)
aspect_ratio = 0.7; % geometrical ratio
P_amb = 101325; % Pa
T0 = 288.15; % K (environmental temperature)
gamma = 1.4; % specific heat ratio of air
cp = 1005; % J/(kg·K)
load_coefficient = 0.4;

% Calculating chord length and r2h from aspect ratio
chord = r1s / aspect_ratio; % chord = span / aspect_ratio
r2h = r1s – chord; % Shroud radius

% Step 1: Isenthalpic Relations and Tt2s Calculation
Tt1 = T0; % St2-St1 = 0
Tt2s = Tt1 * (Pti_Pte ^ ((gamma – 1) / gamma));

% Step 2: Tt2 calculations
Tt2 = Tt1 + (Tt2s – Tt1) / efficiency;

% Step 3: Enthalpy change (Delta H)
delta_h = cp * (Tt2 – Tt1); % J/kg

% Step 4: Umean calculation
U_mean = sqrt(delta_h / load_coefficient); % m/s

% Step 5: Axial velocity ve Mach Number
rho = P_amb / (287 * T0); % Density, ideal gas equation
V_axial = U_mean *0.5; % Axial hız
Mach = V_axial / sqrt(gamma * 287 * T0); % Mach sayısı

% Step 6: Calculation of Angles
V_theta2 = delta_h / U_mean; %
beta1 = atan(U_mean / V_axial)* (180 / pi); % Beta1 angle (degree)
beta2 = atan((U_mean – V_theta2) / V_axial) * (180 / pi); % Beta2 angle (degree)

% % Visualization of Results
fprintf(‘Tt2s: %.2f Kn’, Tt2s);
fprintf(‘Tt2: %.2f Kn’, Tt2);
fprintf(‘Delta H: %.2f J/kgn’, delta_h);
fprintf(‘Umean: %.2f m/sn’, U_mean);
fprintf(‘Mach Number: %.2fn’, Mach);
fprintf(‘V_axial: %.2f m/sn’, V_axial);
fprintf(‘V_theta2: %.2f m/sn’, V_theta2);
fprintf(‘Beta1: %.2f derecen’, beta1);
fprintf(‘Beta2: %.2f derecen’, beta2); Hi,I simulate something in matlab .For those wondering, this is the cross section of the rotor in the axial compressor.. I want to draw this picture in matlab same dimensions,same angles,and same shape.Additionally, I would like to have red dots at the corners of the angled areas where they intersect with the horizontal axes. I am open to your suggestions regarding this.Of course, dashed lines also need to be drawn. The dashed lines can be in blue. My drawing needs to start from the origin point.It needs to be added to the code I will post below and changed when I change the values related to the shape in the code.
% datas
rpm = 30000; % rev/min
Pti_Pte = 1.5; % compression ratio
efficiency = 0.9; % isentropic efficiency
mass_flow_rate = 1.6; % kg/s
r1s = 0.15; % m (stator distance from rotor axis)
aspect_ratio = 0.7; % geometrical ratio
P_amb = 101325; % Pa
T0 = 288.15; % K (environmental temperature)
gamma = 1.4; % specific heat ratio of air
cp = 1005; % J/(kg·K)
load_coefficient = 0.4;

% Calculating chord length and r2h from aspect ratio
chord = r1s / aspect_ratio; % chord = span / aspect_ratio
r2h = r1s – chord; % Shroud radius

% Step 1: Isenthalpic Relations and Tt2s Calculation
Tt1 = T0; % St2-St1 = 0
Tt2s = Tt1 * (Pti_Pte ^ ((gamma – 1) / gamma));

% Step 2: Tt2 calculations
Tt2 = Tt1 + (Tt2s – Tt1) / efficiency;

% Step 3: Enthalpy change (Delta H)
delta_h = cp * (Tt2 – Tt1); % J/kg

% Step 4: Umean calculation
U_mean = sqrt(delta_h / load_coefficient); % m/s

% Step 5: Axial velocity ve Mach Number
rho = P_amb / (287 * T0); % Density, ideal gas equation
V_axial = U_mean *0.5; % Axial hız
Mach = V_axial / sqrt(gamma * 287 * T0); % Mach sayısı

% Step 6: Calculation of Angles
V_theta2 = delta_h / U_mean; %
beta1 = atan(U_mean / V_axial)* (180 / pi); % Beta1 angle (degree)
beta2 = atan((U_mean – V_theta2) / V_axial) * (180 / pi); % Beta2 angle (degree)

% % Visualization of Results
fprintf(‘Tt2s: %.2f Kn’, Tt2s);
fprintf(‘Tt2: %.2f Kn’, Tt2);
fprintf(‘Delta H: %.2f J/kgn’, delta_h);
fprintf(‘Umean: %.2f m/sn’, U_mean);
fprintf(‘Mach Number: %.2fn’, Mach);
fprintf(‘V_axial: %.2f m/sn’, V_axial);
fprintf(‘V_theta2: %.2f m/sn’, V_theta2);
fprintf(‘Beta1: %.2f derecen’, beta1);
fprintf(‘Beta2: %.2f derecen’, beta2); figure, circle, gas turbine, compressor, rotor, color, variable MATLAB Answers — New Questions

​

Microsoft Word Check Box
Matlab News

Microsoft Word Check Box

PuTI / 2025-01-26

HI,
Could someone offer a solution to use Matlab to read a word template and Tick Check Boxes such the ones illustrated below. ThanksHI,
Could someone offer a solution to use Matlab to read a word template and Tick Check Boxes such the ones illustrated below. Thanks HI,
Could someone offer a solution to use Matlab to read a word template and Tick Check Boxes such the ones illustrated below. Thanks word, check box MATLAB Answers — New Questions

​

command history with updates
Matlab News

command history with updates

PuTI / 2025-01-26

How do I import my command history from a previous release, once I have installed a new one ?How do I import my command history from a previous release, once I have installed a new one ? How do I import my command history from a previous release, once I have installed a new one ? command history MATLAB Answers — New Questions

​

How to solve the error: Exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException: Comparison method violates its general contract!
Matlab News

How to solve the error: Exception in thread “AWT-EventQueue-0” java.lang.IllegalArgumentException: Comparison method violates its general contract!

PuTI / 2025-01-26

Hello,

I started receiving an error in matlab, which prevents me to see the command window but does not prevent the code from executing. I attached all the error message below. I do not know why this is happening but I guess it started after I used "save" commands in the editor. I basically load data into the editor and then preprocess the data so that I can use them later, and I save the new data for future computations. Since when I started saving data, this problem has been initiated. Now, I can’t stop matlab to produce this error every time I run any code. Can you please help me with this? I really appreciate that, thank you.

Original error:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.ArrayList.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at com.mathworks.widgets.grouptable.GroupingTableUtils.sortNonRecursively(GroupingTableUtils.java:296)
at com.mathworks.widgets.grouptable.RowListTransactionTarget.finishTransaction(RowListTransactionTarget.java:115)
at com.mathworks.widgets.grouptable.GroupingTableTransaction$1.run(GroupingTableTransaction.java:112)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
>>

Sincerely,

Irem VelibeyogluHello,

I started receiving an error in matlab, which prevents me to see the command window but does not prevent the code from executing. I attached all the error message below. I do not know why this is happening but I guess it started after I used "save" commands in the editor. I basically load data into the editor and then preprocess the data so that I can use them later, and I save the new data for future computations. Since when I started saving data, this problem has been initiated. Now, I can’t stop matlab to produce this error every time I run any code. Can you please help me with this? I really appreciate that, thank you.

Original error:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.ArrayList.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at com.mathworks.widgets.grouptable.GroupingTableUtils.sortNonRecursively(GroupingTableUtils.java:296)
at com.mathworks.widgets.grouptable.RowListTransactionTarget.finishTransaction(RowListTransactionTarget.java:115)
at com.mathworks.widgets.grouptable.GroupingTableTransaction$1.run(GroupingTableTransaction.java:112)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
>>

Sincerely,

Irem Velibeyoglu Hello,

I started receiving an error in matlab, which prevents me to see the command window but does not prevent the code from executing. I attached all the error message below. I do not know why this is happening but I guess it started after I used "save" commands in the editor. I basically load data into the editor and then preprocess the data so that I can use them later, and I save the new data for future computations. Since when I started saving data, this problem has been initiated. Now, I can’t stop matlab to produce this error every time I run any code. Can you please help me with this? I really appreciate that, thank you.

Original error:

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Comparison method violates its general contract!
at java.util.TimSort.mergeHi(Unknown Source)
at java.util.TimSort.mergeAt(Unknown Source)
at java.util.TimSort.mergeCollapse(Unknown Source)
at java.util.TimSort.sort(Unknown Source)
at java.util.Arrays.sort(Unknown Source)
at java.util.ArrayList.sort(Unknown Source)
at java.util.Collections.sort(Unknown Source)
at com.mathworks.widgets.grouptable.GroupingTableUtils.sortNonRecursively(GroupingTableUtils.java:296)
at com.mathworks.widgets.grouptable.RowListTransactionTarget.finishTransaction(RowListTransactionTarget.java:115)
at com.mathworks.widgets.grouptable.GroupingTableTransaction$1.run(GroupingTableTransaction.java:112)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
>>

Sincerely,

Irem Velibeyoglu java error MATLAB Answers — New Questions

​

Previous 1 … 15 16 17 18 19 … 69 Next

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss