Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

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

All Categories

  • IBM
  • Visual Paradigm
  • 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

54 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

  • IBM
  • Visual Paradigm
  • 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

54 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/Matlab

Category: Matlab

Category Archives: Matlab

Matlab News Blog From https://blogs.mathworks.com/

Issue with imdistline() function in MATLAB?
Matlab News

Issue with imdistline() function in MATLAB?

PuTI / 2025-05-11

I am trying to measure the distance two points on an image and then use that distance as an input for some other function. Here is my code:"

if true
figure, imshow(I);
h = imdistline(gca);

api = iptgetapi(h);
width = api.getDistance();
end

When I run it, I am able to drag and get the distance I want on the image, but the distance I get from using the getDistance is some default value it started with , when it opened and it does not change , even if I change it in the image. How can the variable width have the distance i measured before I press enter or any eye and close the image.

EricI am trying to measure the distance two points on an image and then use that distance as an input for some other function. Here is my code:"

if true
figure, imshow(I);
h = imdistline(gca);

api = iptgetapi(h);
width = api.getDistance();
end

When I run it, I am able to drag and get the distance I want on the image, but the distance I get from using the getDistance is some default value it started with , when it opened and it does not change , even if I change it in the image. How can the variable width have the distance i measured before I press enter or any eye and close the image.

Eric I am trying to measure the distance two points on an image and then use that distance as an input for some other function. Here is my code:"

if true
figure, imshow(I);
h = imdistline(gca);

api = iptgetapi(h);
width = api.getDistance();
end

When I run it, I am able to drag and get the distance I want on the image, but the distance I get from using the getDistance is some default value it started with , when it opened and it does not change , even if I change it in the image. How can the variable width have the distance i measured before I press enter or any eye and close the image.

Eric image processing, image, image analysis MATLAB Answers — New Questions

​

XCP internal error in arduino uno
Matlab News

XCP internal error in arduino uno

PuTI / 2025-05-11

I try to connect and use Arduino uno but I am facing this error: External Mode Open Protocol Connect command failed
Caused by: Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT commandI try to connect and use Arduino uno but I am facing this error: External Mode Open Protocol Connect command failed
Caused by: Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command I try to connect and use Arduino uno but I am facing this error: External Mode Open Protocol Connect command failed
Caused by: Could not connect to target application: XCP internal error: timeout expired, in response to XCP CONNECT command xcp internal error, arduino MATLAB Answers — New Questions

​

Ansys Motion to Simulink Interface Problem
Matlab News

Ansys Motion to Simulink Interface Problem

PuTI / 2025-05-11

Hi,
I have an MBD model in Ansys Motion with multiple inputs and outputs. I’ve created an M-file for this model using MATLAB co-sim. I want to import this into the MATLAB/Simulink environment, where I may need to design a controller later. This means I need to be able to see and control the inputs and outputs within the Simulink environment.

I’m using the ‘mbdlib’ library to import my M-file into Simulink, but I’m getting the error shown in the attachment within the S-Function block of the MBD Solver.
Also, the model indicated by the colored blocks is located inside the MBD block. Should I import the M-file into the "Dynamic Model" section here?
Could you please help me with this issue?

Best regards.Hi,
I have an MBD model in Ansys Motion with multiple inputs and outputs. I’ve created an M-file for this model using MATLAB co-sim. I want to import this into the MATLAB/Simulink environment, where I may need to design a controller later. This means I need to be able to see and control the inputs and outputs within the Simulink environment.

I’m using the ‘mbdlib’ library to import my M-file into Simulink, but I’m getting the error shown in the attachment within the S-Function block of the MBD Solver.
Also, the model indicated by the colored blocks is located inside the MBD block. Should I import the M-file into the "Dynamic Model" section here?
Could you please help me with this issue?

Best regards. Hi,
I have an MBD model in Ansys Motion with multiple inputs and outputs. I’ve created an M-file for this model using MATLAB co-sim. I want to import this into the MATLAB/Simulink environment, where I may need to design a controller later. This means I need to be able to see and control the inputs and outputs within the Simulink environment.

I’m using the ‘mbdlib’ library to import my M-file into Simulink, but I’m getting the error shown in the attachment within the S-Function block of the MBD Solver.
Also, the model indicated by the colored blocks is located inside the MBD block. Should I import the M-file into the "Dynamic Model" section here?
Could you please help me with this issue?

Best regards. simulink, co-simulation MATLAB Answers — New Questions

​

find sequence in a matrix
Matlab News

find sequence in a matrix

PuTI / 2025-05-11

Hi, it possibile to velocize it and avoid loop? (I will be a matrix .,not a single array)
(if is possible to use vectorization)

I=[0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0]
k=3;

for i=1:numel(I)
if i>=k+1
if I(i-1) && ~I(i) %%i want to find the first "1 0"
saved=i;
break;
end
end
end

savedHi, it possibile to velocize it and avoid loop? (I will be a matrix .,not a single array)
(if is possible to use vectorization)

I=[0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0]
k=3;

for i=1:numel(I)
if i>=k+1
if I(i-1) && ~I(i) %%i want to find the first "1 0"
saved=i;
break;
end
end
end

saved Hi, it possibile to velocize it and avoid loop? (I will be a matrix .,not a single array)
(if is possible to use vectorization)

I=[0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 1 0]
k=3;

for i=1:numel(I)
if i>=k+1
if I(i-1) && ~I(i) %%i want to find the first "1 0"
saved=i;
break;
end
end
end

saved find sequence in a matrix MATLAB Answers — New Questions

​

Inserting additional data in an already created table
Matlab News

Inserting additional data in an already created table

PuTI / 2025-05-10

Hello, Im messing around with tables again and create one from the user inputs from inputdlg
prompt = {‘Soak(s)’,’Soak Move (ymm)’,’Laser Volts (Soak, Image)’,’numImages(afterSOAK)’,’ZTLpos(soak), abs’,’Back To Nominal Wait Time(s)’,’NumImages (Back To Nominal)’};
dlgtitle = ‘Laser Soak’;
dims = [1 35];
definput = {’30’,’-1′,’2, 0.18′,’4′,’-1833′,’60’,’12’};
answer = inputdlg(prompt,dlgtitle,dims,definput);
answer
T = table(char(answer))

I want to add another entry to the end and thought this would do it
defaultZTL=’-2000′;
T(end+1,1)={defaultZTL}

But Im getting this error
Assigning to a character variable in a table is only supported when the right-hand side value is a table. Consider using a string
variable in the table for text data.
Error in HTS_TestSoftware/LaserSOAKButtonPushed (line 12557)
T(end+1,1)={defaultZTL}Hello, Im messing around with tables again and create one from the user inputs from inputdlg
prompt = {‘Soak(s)’,’Soak Move (ymm)’,’Laser Volts (Soak, Image)’,’numImages(afterSOAK)’,’ZTLpos(soak), abs’,’Back To Nominal Wait Time(s)’,’NumImages (Back To Nominal)’};
dlgtitle = ‘Laser Soak’;
dims = [1 35];
definput = {’30’,’-1′,’2, 0.18′,’4′,’-1833′,’60’,’12’};
answer = inputdlg(prompt,dlgtitle,dims,definput);
answer
T = table(char(answer))

I want to add another entry to the end and thought this would do it
defaultZTL=’-2000′;
T(end+1,1)={defaultZTL}

But Im getting this error
Assigning to a character variable in a table is only supported when the right-hand side value is a table. Consider using a string
variable in the table for text data.
Error in HTS_TestSoftware/LaserSOAKButtonPushed (line 12557)
T(end+1,1)={defaultZTL} Hello, Im messing around with tables again and create one from the user inputs from inputdlg
prompt = {‘Soak(s)’,’Soak Move (ymm)’,’Laser Volts (Soak, Image)’,’numImages(afterSOAK)’,’ZTLpos(soak), abs’,’Back To Nominal Wait Time(s)’,’NumImages (Back To Nominal)’};
dlgtitle = ‘Laser Soak’;
dims = [1 35];
definput = {’30’,’-1′,’2, 0.18′,’4′,’-1833′,’60’,’12’};
answer = inputdlg(prompt,dlgtitle,dims,definput);
answer
T = table(char(answer))

I want to add another entry to the end and thought this would do it
defaultZTL=’-2000′;
T(end+1,1)={defaultZTL}

But Im getting this error
Assigning to a character variable in a table is only supported when the right-hand side value is a table. Consider using a string
variable in the table for text data.
Error in HTS_TestSoftware/LaserSOAKButtonPushed (line 12557)
T(end+1,1)={defaultZTL} table MATLAB Answers — New Questions

​

Programmatically create histograms like Color Thresholder
Matlab News

Programmatically create histograms like Color Thresholder

PuTI / 2025-05-10

How can I programaticlly in Matlab code create image histograms that look like the ones in Color Thresholder? I don’t want to launch Color Thresholder from the Matlab prompt. I want to generate my own histograms that looks like the ones in Color Thresholder. Ideally I would like to create this identical histogram in a script without having to manually open Color Thresholder, load my image, and then switch to YCbCr.How can I programaticlly in Matlab code create image histograms that look like the ones in Color Thresholder? I don’t want to launch Color Thresholder from the Matlab prompt. I want to generate my own histograms that looks like the ones in Color Thresholder. Ideally I would like to create this identical histogram in a script without having to manually open Color Thresholder, load my image, and then switch to YCbCr. How can I programaticlly in Matlab code create image histograms that look like the ones in Color Thresholder? I don’t want to launch Color Thresholder from the Matlab prompt. I want to generate my own histograms that looks like the ones in Color Thresholder. Ideally I would like to create this identical histogram in a script without having to manually open Color Thresholder, load my image, and then switch to YCbCr. image-processing, histogram MATLAB Answers — New Questions

​

How to plot function x(2)=-1/2*x(1)+t?
Matlab News

How to plot function x(2)=-1/2*x(1)+t?

PuTI / 2025-05-10

clc;
clear;
close;
x1=3+3/8;
u=8;
teta(1)=0;
%teta(u+2)=0.2;
for i=1:u
teta(i+1)=i/5;
end
for j=1:1
for k=1:u
%initial_func=[x1,x2];
[t,x] = ode45(@IJP4,[teta(k):0.0001:teta(k+1)], x1(j));%
n=length(t);
%disp(size(x));
x1(j)=x(n,1)+4*x(n,1);
hold on
%view(30,15);
x(2)=-1/2*x(1)+t;
hold on
figure(1)
subplot(2,1,1);
plot(t,x(:,2),’color’,’g’,’Linewidth’,1.2);
xlabel(‘bf t’); ylabel(‘$$z$$’,’interpreter’,’latex’,’fontsize’,16); zlabel(‘bf psi_2’);
grid on
hold on
subplot(2,1,2);
plot(t,x(:,1),’color’,’g’,’Linewidth’,1.2);
xlabel(‘bf t’); ylabel(‘$$y$$’,’interpreter’,’latex’,’fontsize’,16); zlabel(‘bf psi_3’);
grid on
hold on
figure(2)
plot3(t,x(:,1),x(:,1),’g’);
xlabel(‘$$t$$’,’interpreter’,’latex’,’fontsize’,16)
%ylabel(‘phi_{2}’,’fontsize’,16)
ylabel(‘$$z$$’,’interpreter’,’latex’,’fontsize’,16)
zlabel(‘$$y$$’,’interpreter’,’latex’,’fontsize’,16);
grid on
hold on
end
end
function dx=IJP4(t,x)
dx=zeros(1,1); % создает нулевой вектор-столбец
dx(1)=-3/2*x(1)-6*x(1);
endclc;
clear;
close;
x1=3+3/8;
u=8;
teta(1)=0;
%teta(u+2)=0.2;
for i=1:u
teta(i+1)=i/5;
end
for j=1:1
for k=1:u
%initial_func=[x1,x2];
[t,x] = ode45(@IJP4,[teta(k):0.0001:teta(k+1)], x1(j));%
n=length(t);
%disp(size(x));
x1(j)=x(n,1)+4*x(n,1);
hold on
%view(30,15);
x(2)=-1/2*x(1)+t;
hold on
figure(1)
subplot(2,1,1);
plot(t,x(:,2),’color’,’g’,’Linewidth’,1.2);
xlabel(‘bf t’); ylabel(‘$$z$$’,’interpreter’,’latex’,’fontsize’,16); zlabel(‘bf psi_2’);
grid on
hold on
subplot(2,1,2);
plot(t,x(:,1),’color’,’g’,’Linewidth’,1.2);
xlabel(‘bf t’); ylabel(‘$$y$$’,’interpreter’,’latex’,’fontsize’,16); zlabel(‘bf psi_3’);
grid on
hold on
figure(2)
plot3(t,x(:,1),x(:,1),’g’);
xlabel(‘$$t$$’,’interpreter’,’latex’,’fontsize’,16)
%ylabel(‘phi_{2}’,’fontsize’,16)
ylabel(‘$$z$$’,’interpreter’,’latex’,’fontsize’,16)
zlabel(‘$$y$$’,’interpreter’,’latex’,’fontsize’,16);
grid on
hold on
end
end
function dx=IJP4(t,x)
dx=zeros(1,1); % создает нулевой вектор-столбец
dx(1)=-3/2*x(1)-6*x(1);
end clc;
clear;
close;
x1=3+3/8;
u=8;
teta(1)=0;
%teta(u+2)=0.2;
for i=1:u
teta(i+1)=i/5;
end
for j=1:1
for k=1:u
%initial_func=[x1,x2];
[t,x] = ode45(@IJP4,[teta(k):0.0001:teta(k+1)], x1(j));%
n=length(t);
%disp(size(x));
x1(j)=x(n,1)+4*x(n,1);
hold on
%view(30,15);
x(2)=-1/2*x(1)+t;
hold on
figure(1)
subplot(2,1,1);
plot(t,x(:,2),’color’,’g’,’Linewidth’,1.2);
xlabel(‘bf t’); ylabel(‘$$z$$’,’interpreter’,’latex’,’fontsize’,16); zlabel(‘bf psi_2’);
grid on
hold on
subplot(2,1,2);
plot(t,x(:,1),’color’,’g’,’Linewidth’,1.2);
xlabel(‘bf t’); ylabel(‘$$y$$’,’interpreter’,’latex’,’fontsize’,16); zlabel(‘bf psi_3’);
grid on
hold on
figure(2)
plot3(t,x(:,1),x(:,1),’g’);
xlabel(‘$$t$$’,’interpreter’,’latex’,’fontsize’,16)
%ylabel(‘phi_{2}’,’fontsize’,16)
ylabel(‘$$z$$’,’interpreter’,’latex’,’fontsize’,16)
zlabel(‘$$y$$’,’interpreter’,’latex’,’fontsize’,16);
grid on
hold on
end
end
function dx=IJP4(t,x)
dx=zeros(1,1); % создает нулевой вектор-столбец
dx(1)=-3/2*x(1)-6*x(1);
end index in position 2 exceeds array bounds (must not MATLAB Answers — New Questions

​

I am trying to incorporate multiple IF statements in my ODE to generate a single output.
Matlab News

I am trying to incorporate multiple IF statements in my ODE to generate a single output.

PuTI / 2025-05-10

There are four cases that I am trying to incorporate as multiple IF statements. Here are the four cases below. The first case is the one I used in my code to generate the output.
dx(1,1) > 0 && dx(3,1) > 0
dx(1,1) > 0 || dx(3,1) > 0
dx(1,1) > 0 && dx(3,1) <= 0
dx(1,1) <= 0 && dx(3,1) > 0
Below is the code that I used to generate the first case:
close all
clear all
clc

tspan = [0 100];
y0 = 0.7; % initial value of state variable x1
r0 = 0.7; % initial value of state variable x2
w0 = 0.8; % initial value of state variable x3
x0 = [y0; r0; w0];
[t, x] = ode45(@odefcn, tspan, x0);

%% Plot results
figure
subplot(3,1,1);
plot(t, x(:,1)); grid on
xlabel(‘Time’), ylabel(‘Output’);

subplot(3,1,2);
plot(t, x(:,2)); grid on
xlabel(‘Time’), ylabel(‘Policy Rate’);

subplot(3,1,3);
plot(t, x(:,3)); grid on
xlabel(‘Time’), ylabel(‘Wage Share’);
y0 = [0.7; 0.7; 0.8];

%% System of three differential equations
function dx = odefcn(t, x)
% definitions
y = x(1);
r = x(2);
w = x(3);

% parameters
alpha = 1.0;
beta = 1.0;
gamma = 0.6;
delta = 0.6;
mu = 0.1;
lambda = 0.6;
theta = 0.4;
omega = 0.4;
sigma = 0.1;
tau = 0.1;

% ODEs
dx(1,1) = alpha * y – beta * r * y;
dx(3,1) = – theta * w + lambda * y * w – mu * w * w;

% Asymmetrical Reaction Function
if dx(1,1) > 0 && dx(3,1) > 0
dx(2,1) = – omega * r + gamma * w * r + sigma * w * r + delta * y * r + tau * y * r;
else
dx(2,1) = – omega * r + gamma * w * r + delta * y * r;
end
endThere are four cases that I am trying to incorporate as multiple IF statements. Here are the four cases below. The first case is the one I used in my code to generate the output.
dx(1,1) > 0 && dx(3,1) > 0
dx(1,1) > 0 || dx(3,1) > 0
dx(1,1) > 0 && dx(3,1) <= 0
dx(1,1) <= 0 && dx(3,1) > 0
Below is the code that I used to generate the first case:
close all
clear all
clc

tspan = [0 100];
y0 = 0.7; % initial value of state variable x1
r0 = 0.7; % initial value of state variable x2
w0 = 0.8; % initial value of state variable x3
x0 = [y0; r0; w0];
[t, x] = ode45(@odefcn, tspan, x0);

%% Plot results
figure
subplot(3,1,1);
plot(t, x(:,1)); grid on
xlabel(‘Time’), ylabel(‘Output’);

subplot(3,1,2);
plot(t, x(:,2)); grid on
xlabel(‘Time’), ylabel(‘Policy Rate’);

subplot(3,1,3);
plot(t, x(:,3)); grid on
xlabel(‘Time’), ylabel(‘Wage Share’);
y0 = [0.7; 0.7; 0.8];

%% System of three differential equations
function dx = odefcn(t, x)
% definitions
y = x(1);
r = x(2);
w = x(3);

% parameters
alpha = 1.0;
beta = 1.0;
gamma = 0.6;
delta = 0.6;
mu = 0.1;
lambda = 0.6;
theta = 0.4;
omega = 0.4;
sigma = 0.1;
tau = 0.1;

% ODEs
dx(1,1) = alpha * y – beta * r * y;
dx(3,1) = – theta * w + lambda * y * w – mu * w * w;

% Asymmetrical Reaction Function
if dx(1,1) > 0 && dx(3,1) > 0
dx(2,1) = – omega * r + gamma * w * r + sigma * w * r + delta * y * r + tau * y * r;
else
dx(2,1) = – omega * r + gamma * w * r + delta * y * r;
end
end There are four cases that I am trying to incorporate as multiple IF statements. Here are the four cases below. The first case is the one I used in my code to generate the output.
dx(1,1) > 0 && dx(3,1) > 0
dx(1,1) > 0 || dx(3,1) > 0
dx(1,1) > 0 && dx(3,1) <= 0
dx(1,1) <= 0 && dx(3,1) > 0
Below is the code that I used to generate the first case:
close all
clear all
clc

tspan = [0 100];
y0 = 0.7; % initial value of state variable x1
r0 = 0.7; % initial value of state variable x2
w0 = 0.8; % initial value of state variable x3
x0 = [y0; r0; w0];
[t, x] = ode45(@odefcn, tspan, x0);

%% Plot results
figure
subplot(3,1,1);
plot(t, x(:,1)); grid on
xlabel(‘Time’), ylabel(‘Output’);

subplot(3,1,2);
plot(t, x(:,2)); grid on
xlabel(‘Time’), ylabel(‘Policy Rate’);

subplot(3,1,3);
plot(t, x(:,3)); grid on
xlabel(‘Time’), ylabel(‘Wage Share’);
y0 = [0.7; 0.7; 0.8];

%% System of three differential equations
function dx = odefcn(t, x)
% definitions
y = x(1);
r = x(2);
w = x(3);

% parameters
alpha = 1.0;
beta = 1.0;
gamma = 0.6;
delta = 0.6;
mu = 0.1;
lambda = 0.6;
theta = 0.4;
omega = 0.4;
sigma = 0.1;
tau = 0.1;

% ODEs
dx(1,1) = alpha * y – beta * r * y;
dx(3,1) = – theta * w + lambda * y * w – mu * w * w;

% Asymmetrical Reaction Function
if dx(1,1) > 0 && dx(3,1) > 0
dx(2,1) = – omega * r + gamma * w * r + sigma * w * r + delta * y * r + tau * y * r;
else
dx(2,1) = – omega * r + gamma * w * r + delta * y * r;
end
end ode, differential equations, if statement MATLAB Answers — New Questions

​

How do I find the corner points of an mask
Matlab News

How do I find the corner points of an mask

PuTI / 2025-05-09

I have various mask and i want to find the exact four courner coordinates, but when some mask objects with an rotation and little odd shape comes i find it difficult to find the corner points.
I have attached the mask and pointed the points i want to findI have various mask and i want to find the exact four courner coordinates, but when some mask objects with an rotation and little odd shape comes i find it difficult to find the corner points.
I have attached the mask and pointed the points i want to find I have various mask and i want to find the exact four courner coordinates, but when some mask objects with an rotation and little odd shape comes i find it difficult to find the corner points.
I have attached the mask and pointed the points i want to find image processing, digital image processing, computer vision MATLAB Answers — New Questions

​

Upper limit on the number of UIAxes children allowed
Matlab News

Upper limit on the number of UIAxes children allowed

PuTI / 2025-05-09

I am plotting orbital data, using plot3 to progressively lengthen the orbital track of a spacecraft.
plot3(earthMoon.UIAxes, x,y,z,"w’);
Each time I do this, another "Children’ is added to the UIAxes instance. Eventually, when the number of children approaches 200 or so, the graphical object management becomes unwieldy and my GUI stops responding to button pushes; even the Matlab STOP and CONTINUE buttons fail to respond.
I found a similar question and answer here:
https://www.mathworks.com/matlabcentral/answers/433845-maximum-number-of-uiaxes-in-app-designer-2017b?s_tid=prof_contriblnk
Is there a better way to manage the Children? I have tried thinning out my track data to reducte the number of points, but that results in jerky updates that don’t align with the orbital state. I have also looked at using splines, but I will still need to limit the number of current track points to something under 200.
I have another app for displaying radar data where I progressively delete the oldest children in the UIApp, so I never have more than about 50. That works well, but for orbital data I would like to display the whole trajectory from launch to current time. It appears I can’t have it both ways.I am plotting orbital data, using plot3 to progressively lengthen the orbital track of a spacecraft.
plot3(earthMoon.UIAxes, x,y,z,"w’);
Each time I do this, another "Children’ is added to the UIAxes instance. Eventually, when the number of children approaches 200 or so, the graphical object management becomes unwieldy and my GUI stops responding to button pushes; even the Matlab STOP and CONTINUE buttons fail to respond.
I found a similar question and answer here:
https://www.mathworks.com/matlabcentral/answers/433845-maximum-number-of-uiaxes-in-app-designer-2017b?s_tid=prof_contriblnk
Is there a better way to manage the Children? I have tried thinning out my track data to reducte the number of points, but that results in jerky updates that don’t align with the orbital state. I have also looked at using splines, but I will still need to limit the number of current track points to something under 200.
I have another app for displaying radar data where I progressively delete the oldest children in the UIApp, so I never have more than about 50. That works well, but for orbital data I would like to display the whole trajectory from launch to current time. It appears I can’t have it both ways. I am plotting orbital data, using plot3 to progressively lengthen the orbital track of a spacecraft.
plot3(earthMoon.UIAxes, x,y,z,"w’);
Each time I do this, another "Children’ is added to the UIAxes instance. Eventually, when the number of children approaches 200 or so, the graphical object management becomes unwieldy and my GUI stops responding to button pushes; even the Matlab STOP and CONTINUE buttons fail to respond.
I found a similar question and answer here:
https://www.mathworks.com/matlabcentral/answers/433845-maximum-number-of-uiaxes-in-app-designer-2017b?s_tid=prof_contriblnk
Is there a better way to manage the Children? I have tried thinning out my track data to reducte the number of points, but that results in jerky updates that don’t align with the orbital state. I have also looked at using splines, but I will still need to limit the number of current track points to something under 200.
I have another app for displaying radar data where I progressively delete the oldest children in the UIApp, so I never have more than about 50. That works well, but for orbital data I would like to display the whole trajectory from launch to current time. It appears I can’t have it both ways. plot3, uiaxes, uifigure MATLAB Answers — New Questions

​

Running Simulink Online on Selfhosted Docker MATLAB Online Instance
Matlab News

Running Simulink Online on Selfhosted Docker MATLAB Online Instance

PuTI / 2025-05-09

Hello, I’m currently running MATLAB on my server along with JupyterLab using jupyter-matlab-proxy based on Docker.
This extension allows us to integrate MATLAB with JupyterLab and also allows us to use selfhosted instance of MATLAB Online if needed.

All features of MATLAB Online wors very well just as locally installed MATLAB desktop application.
However, as I try to run Simulink Online and create a Blank Model on it, it gives me a following error:
———-
Unable to run the ‘fevalJSON’ function because it calls the ‘open_system’ function, which is not supported for MATLAB Online. To use this function, use an installed version of MATLAB on your computer.
———-

As far as I know, MATLAB already provides Simulink Online service on their official server instance.
I do installed Simulink and many other toolboxes required for running Simulink on my container image.
Is is not supported on user-created docker image (Which installs MATLAB by MATLAB Package Manager, MPM) or am I doing something wrong?
I’d really appreciate if I can run a selfhosted Simulink Server.

Thank you.Hello, I’m currently running MATLAB on my server along with JupyterLab using jupyter-matlab-proxy based on Docker.
This extension allows us to integrate MATLAB with JupyterLab and also allows us to use selfhosted instance of MATLAB Online if needed.

All features of MATLAB Online wors very well just as locally installed MATLAB desktop application.
However, as I try to run Simulink Online and create a Blank Model on it, it gives me a following error:
———-
Unable to run the ‘fevalJSON’ function because it calls the ‘open_system’ function, which is not supported for MATLAB Online. To use this function, use an installed version of MATLAB on your computer.
———-

As far as I know, MATLAB already provides Simulink Online service on their official server instance.
I do installed Simulink and many other toolboxes required for running Simulink on my container image.
Is is not supported on user-created docker image (Which installs MATLAB by MATLAB Package Manager, MPM) or am I doing something wrong?
I’d really appreciate if I can run a selfhosted Simulink Server.

Thank you. Hello, I’m currently running MATLAB on my server along with JupyterLab using jupyter-matlab-proxy based on Docker.
This extension allows us to integrate MATLAB with JupyterLab and also allows us to use selfhosted instance of MATLAB Online if needed.

All features of MATLAB Online wors very well just as locally installed MATLAB desktop application.
However, as I try to run Simulink Online and create a Blank Model on it, it gives me a following error:
———-
Unable to run the ‘fevalJSON’ function because it calls the ‘open_system’ function, which is not supported for MATLAB Online. To use this function, use an installed version of MATLAB on your computer.
———-

As far as I know, MATLAB already provides Simulink Online service on their official server instance.
I do installed Simulink and many other toolboxes required for running Simulink on my container image.
Is is not supported on user-created docker image (Which installs MATLAB by MATLAB Package Manager, MPM) or am I doing something wrong?
I’d really appreciate if I can run a selfhosted Simulink Server.

Thank you. docker, server, matlab online, simulink online, simulink, jupyter-matlab-proxy, r2022b, mpm MATLAB Answers — New Questions

​

How do I add semi-colons to lines of MATLAB code automatically in MATLAB?
Matlab News

How do I add semi-colons to lines of MATLAB code automatically in MATLAB?

PuTI / 2025-05-09

I want to add semi-colons to multiple lines of MATLAB code automatically.I want to add semi-colons to multiple lines of MATLAB code automatically. I want to add semi-colons to multiple lines of MATLAB code automatically. semicolon, multilinesemicolon MATLAB Answers — New Questions

​

help me get the points of the mask
Matlab News

help me get the points of the mask

PuTI / 2025-05-09

I have shapes like this and i want the four points like what i have marked and the enclosing are i drew with linesI have shapes like this and i want the four points like what i have marked and the enclosing are i drew with lines I have shapes like this and i want the four points like what i have marked and the enclosing are i drew with lines computer vision, image analysis, image processing, minimum perimeter polygon MATLAB Answers — New Questions

​

How to specify intervals of increasing, decreasing of a function in MATLAB
Matlab News

How to specify intervals of increasing, decreasing of a function in MATLAB

PuTI / 2025-05-09

Hello, I want to specify intervals of increasing & decreasing of a function for a specific range; say -20-20. This is my code here:
clc, close, clear
syms x y real

dy=1-(4/x^2); x=~0; % This is the derivative of the function
% dy=(sin(x)-1)*(2*cos(x)+1); % (0<=x<=2*pi) % Code doesn’t work for this.

fplot(dy); hold on; axis([-5, 5, -5, 5]);
j=xline(0); set(j,’color’,’black’,’Linewidth’, 1.5)
k=yline(0); set(k,’color’,’black’,’Linewidth’, 1.5)
cp=solve(dy); % Finding critical points
y_cp=subs(dy,cp);
[~,idx] = unique(cp);
cp = cp(idx);
y_cp = y_cp(idx);
[num, den]=numden(dy); % Not a conventional way to find other critical points
cp2=solve(den==0);
disp(‘The critical points are:’)
for k =1:length(cp)
fprintf("(%.2f,%.2f)n",cp(k), y_cp(k))
plot(cp,y_cp,’*’, ‘color’, ‘black’);
end
for k =1:length(cp2)
fprintf("x = %.2f is a critical point, y is undefinedn",cp2(k))
end
% y is increasing if dy > 0, decreasing if dy < 0, if dy=0 it’s a critical point. Code below doesn’t work.
for i = -20:20
dy_sub_i=subs(dy,i);
end
if dy_sub_i>0
fprintf(‘f is increasing in %s-%s’, i(0), i);
elseif dy_sub_i<0
fprintf(‘f is decreasing in ‘);
endHello, I want to specify intervals of increasing & decreasing of a function for a specific range; say -20-20. This is my code here:
clc, close, clear
syms x y real

dy=1-(4/x^2); x=~0; % This is the derivative of the function
% dy=(sin(x)-1)*(2*cos(x)+1); % (0<=x<=2*pi) % Code doesn’t work for this.

fplot(dy); hold on; axis([-5, 5, -5, 5]);
j=xline(0); set(j,’color’,’black’,’Linewidth’, 1.5)
k=yline(0); set(k,’color’,’black’,’Linewidth’, 1.5)
cp=solve(dy); % Finding critical points
y_cp=subs(dy,cp);
[~,idx] = unique(cp);
cp = cp(idx);
y_cp = y_cp(idx);
[num, den]=numden(dy); % Not a conventional way to find other critical points
cp2=solve(den==0);
disp(‘The critical points are:’)
for k =1:length(cp)
fprintf("(%.2f,%.2f)n",cp(k), y_cp(k))
plot(cp,y_cp,’*’, ‘color’, ‘black’);
end
for k =1:length(cp2)
fprintf("x = %.2f is a critical point, y is undefinedn",cp2(k))
end
% y is increasing if dy > 0, decreasing if dy < 0, if dy=0 it’s a critical point. Code below doesn’t work.
for i = -20:20
dy_sub_i=subs(dy,i);
end
if dy_sub_i>0
fprintf(‘f is increasing in %s-%s’, i(0), i);
elseif dy_sub_i<0
fprintf(‘f is decreasing in ‘);
end Hello, I want to specify intervals of increasing & decreasing of a function for a specific range; say -20-20. This is my code here:
clc, close, clear
syms x y real

dy=1-(4/x^2); x=~0; % This is the derivative of the function
% dy=(sin(x)-1)*(2*cos(x)+1); % (0<=x<=2*pi) % Code doesn’t work for this.

fplot(dy); hold on; axis([-5, 5, -5, 5]);
j=xline(0); set(j,’color’,’black’,’Linewidth’, 1.5)
k=yline(0); set(k,’color’,’black’,’Linewidth’, 1.5)
cp=solve(dy); % Finding critical points
y_cp=subs(dy,cp);
[~,idx] = unique(cp);
cp = cp(idx);
y_cp = y_cp(idx);
[num, den]=numden(dy); % Not a conventional way to find other critical points
cp2=solve(den==0);
disp(‘The critical points are:’)
for k =1:length(cp)
fprintf("(%.2f,%.2f)n",cp(k), y_cp(k))
plot(cp,y_cp,’*’, ‘color’, ‘black’);
end
for k =1:length(cp2)
fprintf("x = %.2f is a critical point, y is undefinedn",cp2(k))
end
% y is increasing if dy > 0, decreasing if dy < 0, if dy=0 it’s a critical point. Code below doesn’t work.
for i = -20:20
dy_sub_i=subs(dy,i);
end
if dy_sub_i>0
fprintf(‘f is increasing in %s-%s’, i(0), i);
elseif dy_sub_i<0
fprintf(‘f is decreasing in ‘);
end for loop, fplot, fprintf MATLAB Answers — New Questions

​

Interference between channels in the Analogue Input block of Simulink Desktop Real-Time
Matlab News

Interference between channels in the Analogue Input block of Simulink Desktop Real-Time

PuTI / 2025-05-08

I’m experiencing a problem with channel interference when using the Analog Input block of Simulink Desktop Real-Time (SDRT). Although it initially appears to be a case of ‘crosstalk’, the problem also occurs when measuring DC signals from very low impedance sources compared to the input impedance of the data acquisition boards used (National Instruments).
Test description
– I set up several simple voltage dividers (two 10 kΩ resistors in series) powered by an external 5 V supply.
– The voltage at the center of the dividers was measured using a single Analog Input block configured to access multiple channels in vector form [1:n].
– When I short-circuited the resistor connected to GND on the channel (1), its voltage dropped to zero as expected, but I observed a change of around 30 mV in the voltage measured on the channel (2).
– This behavior occurs consistently between any channel (n) and the subsequent channel (n+1).
Additional Tests
– I repeated the test using independent Analog Input blocks for each channel, and, in this case, the problem did not occur for any of the channels, demonstrating that the behavior is related to the vector configuration of the block.
– However, according to the SDRT user guide and the recommendation of MathWorks experts in the past, using a single Analog Input block for multiple signals, using vector notation for channel selection. This approach is necessary to maintain real-time operation, as using independent blocks introduces significant delays, even at low sampling frequencies.
Additional Information
– The same tests were carried out on two different computes (one slower and one faster and robut), with different cards of acquisition (PCI-6221 and PCIe-6323) and in two versions of MATLAB (2021b and 2024a).
– I also randomly changed the order of the input channels to rule out possible problems related to the sequence of the channels.
– The behavior persisted in all the configurations tested.
Requesting Assistance
Are there any known limitations or solutions to this behavior when using the Analog Input block in vector configuration? Considering that SDRT recommends this approach for multiple channels, would a technical review or guidance be possible to solve or mitigate the problem?
.I’m experiencing a problem with channel interference when using the Analog Input block of Simulink Desktop Real-Time (SDRT). Although it initially appears to be a case of ‘crosstalk’, the problem also occurs when measuring DC signals from very low impedance sources compared to the input impedance of the data acquisition boards used (National Instruments).
Test description
– I set up several simple voltage dividers (two 10 kΩ resistors in series) powered by an external 5 V supply.
– The voltage at the center of the dividers was measured using a single Analog Input block configured to access multiple channels in vector form [1:n].
– When I short-circuited the resistor connected to GND on the channel (1), its voltage dropped to zero as expected, but I observed a change of around 30 mV in the voltage measured on the channel (2).
– This behavior occurs consistently between any channel (n) and the subsequent channel (n+1).
Additional Tests
– I repeated the test using independent Analog Input blocks for each channel, and, in this case, the problem did not occur for any of the channels, demonstrating that the behavior is related to the vector configuration of the block.
– However, according to the SDRT user guide and the recommendation of MathWorks experts in the past, using a single Analog Input block for multiple signals, using vector notation for channel selection. This approach is necessary to maintain real-time operation, as using independent blocks introduces significant delays, even at low sampling frequencies.
Additional Information
– The same tests were carried out on two different computes (one slower and one faster and robut), with different cards of acquisition (PCI-6221 and PCIe-6323) and in two versions of MATLAB (2021b and 2024a).
– I also randomly changed the order of the input channels to rule out possible problems related to the sequence of the channels.
– The behavior persisted in all the configurations tested.
Requesting Assistance
Are there any known limitations or solutions to this behavior when using the Analog Input block in vector configuration? Considering that SDRT recommends this approach for multiple channels, would a technical review or guidance be possible to solve or mitigate the problem?
. I’m experiencing a problem with channel interference when using the Analog Input block of Simulink Desktop Real-Time (SDRT). Although it initially appears to be a case of ‘crosstalk’, the problem also occurs when measuring DC signals from very low impedance sources compared to the input impedance of the data acquisition boards used (National Instruments).
Test description
– I set up several simple voltage dividers (two 10 kΩ resistors in series) powered by an external 5 V supply.
– The voltage at the center of the dividers was measured using a single Analog Input block configured to access multiple channels in vector form [1:n].
– When I short-circuited the resistor connected to GND on the channel (1), its voltage dropped to zero as expected, but I observed a change of around 30 mV in the voltage measured on the channel (2).
– This behavior occurs consistently between any channel (n) and the subsequent channel (n+1).
Additional Tests
– I repeated the test using independent Analog Input blocks for each channel, and, in this case, the problem did not occur for any of the channels, demonstrating that the behavior is related to the vector configuration of the block.
– However, according to the SDRT user guide and the recommendation of MathWorks experts in the past, using a single Analog Input block for multiple signals, using vector notation for channel selection. This approach is necessary to maintain real-time operation, as using independent blocks introduces significant delays, even at low sampling frequencies.
Additional Information
– The same tests were carried out on two different computes (one slower and one faster and robut), with different cards of acquisition (PCI-6221 and PCIe-6323) and in two versions of MATLAB (2021b and 2024a).
– I also randomly changed the order of the input channels to rule out possible problems related to the sequence of the channels.
– The behavior persisted in all the configurations tested.
Requesting Assistance
Are there any known limitations or solutions to this behavior when using the Analog Input block in vector configuration? Considering that SDRT recommends this approach for multiple channels, would a technical review or guidance be possible to solve or mitigate the problem?
. #input interference, #simulink, #sdrt MATLAB Answers — New Questions

​

How can I pass an image to a figure ?
Matlab News

How can I pass an image to a figure ?

PuTI / 2025-05-08

Hello. How can I pass an image to a figure in a MATLAB script?
% Generate a wood grain pattern (example)
grain = rand(300, 400);
grain_thresholded = grain > 0.5; % Creates a binary pattern
% Apply color values to simulate wood grain
image(:,:,1) = grain_thresholded * 0.8 + (1 – grain_thresholded) * 0.4; % Red
image(:,:,2) = grain_thresholded * 0.6 + (1 – grain_thresholded) * 0.2; % Green
image(:,:,3) = grain_thresholded * 0.3 + (1 – grain_thresholded) * 0.1; % Blue
% Display the image
figure;
imshow(image);
The existing figure code is below. I want to replace the brown/tan RGB figure color with the above image color and pattern. Thanks for any help !
% Plot beam cross section
% A = base*h; % beam area, in^2
figure()
pgon = polyshape([0 0 23.5 23.5],[12 0 0 12]);
H = plot(pgon,’FaceColor’,[0.666, 0.392, 0.196],’FaceAlpha’,0.5); % use 0.666, 0.392, 0.196
% RGB: (202 164 114) = 0.79 0.643 0.447 wood color
H.LineStyle = ‘–‘;
H.EdgeColor = ‘black’;
hold on
axis equal
grid on
x6 =[0 23.5];
y6 =[6 6];
line(x6,y6,’Color’,’red’,’LineStyle’,’-.’) % adds a line at ‘c = 6’
title(‘Cross Section of Designed Beam’)
xlabel(‘base (in)’); ylabel(‘height (depth) (in)’)Hello. How can I pass an image to a figure in a MATLAB script?
% Generate a wood grain pattern (example)
grain = rand(300, 400);
grain_thresholded = grain > 0.5; % Creates a binary pattern
% Apply color values to simulate wood grain
image(:,:,1) = grain_thresholded * 0.8 + (1 – grain_thresholded) * 0.4; % Red
image(:,:,2) = grain_thresholded * 0.6 + (1 – grain_thresholded) * 0.2; % Green
image(:,:,3) = grain_thresholded * 0.3 + (1 – grain_thresholded) * 0.1; % Blue
% Display the image
figure;
imshow(image);
The existing figure code is below. I want to replace the brown/tan RGB figure color with the above image color and pattern. Thanks for any help !
% Plot beam cross section
% A = base*h; % beam area, in^2
figure()
pgon = polyshape([0 0 23.5 23.5],[12 0 0 12]);
H = plot(pgon,’FaceColor’,[0.666, 0.392, 0.196],’FaceAlpha’,0.5); % use 0.666, 0.392, 0.196
% RGB: (202 164 114) = 0.79 0.643 0.447 wood color
H.LineStyle = ‘–‘;
H.EdgeColor = ‘black’;
hold on
axis equal
grid on
x6 =[0 23.5];
y6 =[6 6];
line(x6,y6,’Color’,’red’,’LineStyle’,’-.’) % adds a line at ‘c = 6’
title(‘Cross Section of Designed Beam’)
xlabel(‘base (in)’); ylabel(‘height (depth) (in)’) Hello. How can I pass an image to a figure in a MATLAB script?
% Generate a wood grain pattern (example)
grain = rand(300, 400);
grain_thresholded = grain > 0.5; % Creates a binary pattern
% Apply color values to simulate wood grain
image(:,:,1) = grain_thresholded * 0.8 + (1 – grain_thresholded) * 0.4; % Red
image(:,:,2) = grain_thresholded * 0.6 + (1 – grain_thresholded) * 0.2; % Green
image(:,:,3) = grain_thresholded * 0.3 + (1 – grain_thresholded) * 0.1; % Blue
% Display the image
figure;
imshow(image);
The existing figure code is below. I want to replace the brown/tan RGB figure color with the above image color and pattern. Thanks for any help !
% Plot beam cross section
% A = base*h; % beam area, in^2
figure()
pgon = polyshape([0 0 23.5 23.5],[12 0 0 12]);
H = plot(pgon,’FaceColor’,[0.666, 0.392, 0.196],’FaceAlpha’,0.5); % use 0.666, 0.392, 0.196
% RGB: (202 164 114) = 0.79 0.643 0.447 wood color
H.LineStyle = ‘–‘;
H.EdgeColor = ‘black’;
hold on
axis equal
grid on
x6 =[0 23.5];
y6 =[6 6];
line(x6,y6,’Color’,’red’,’LineStyle’,’-.’) % adds a line at ‘c = 6’
title(‘Cross Section of Designed Beam’)
xlabel(‘base (in)’); ylabel(‘height (depth) (in)’) image, imshow, figure, rgb, polyshape, pgon MATLAB Answers — New Questions

​

Resetting a Simscape Slider-Crank Angular Position Signal to a 0 Value with a Trigger Signal.
Matlab News

Resetting a Simscape Slider-Crank Angular Position Signal to a 0 Value with a Trigger Signal.

PuTI / 2025-05-08

Hi All,
Forgive me if this topic of signal resetting in Simscape has been ask and solved countless times before. However, I am struggling to what seems a basic bit of logic in my Simscape model, and the solutons in the MATHWORKS examples I can find, seem to not reset the angular position signal by way of my trigger signal (I also have a rising edge signal).
Simply need to reset the angular position output from the Ideal Rotational Motion Sensor (converted to degrees) when my piston reaches its TDC position.
Using triggered subsystems to pass the signal through, or an integrator with a reset and manual swiches, are not permit the signal value to increase at each time-step once reset to 0.
Any pointer would be great on what should be a 5 minute task.
Thanks again.

Patrick

TDC Switch

Rising Edge SignalHi All,
Forgive me if this topic of signal resetting in Simscape has been ask and solved countless times before. However, I am struggling to what seems a basic bit of logic in my Simscape model, and the solutons in the MATHWORKS examples I can find, seem to not reset the angular position signal by way of my trigger signal (I also have a rising edge signal).
Simply need to reset the angular position output from the Ideal Rotational Motion Sensor (converted to degrees) when my piston reaches its TDC position.
Using triggered subsystems to pass the signal through, or an integrator with a reset and manual swiches, are not permit the signal value to increase at each time-step once reset to 0.
Any pointer would be great on what should be a 5 minute task.
Thanks again.

Patrick

TDC Switch

Rising Edge Signal Hi All,
Forgive me if this topic of signal resetting in Simscape has been ask and solved countless times before. However, I am struggling to what seems a basic bit of logic in my Simscape model, and the solutons in the MATHWORKS examples I can find, seem to not reset the angular position signal by way of my trigger signal (I also have a rising edge signal).
Simply need to reset the angular position output from the Ideal Rotational Motion Sensor (converted to degrees) when my piston reaches its TDC position.
Using triggered subsystems to pass the signal through, or an integrator with a reset and manual swiches, are not permit the signal value to increase at each time-step once reset to 0.
Any pointer would be great on what should be a 5 minute task.
Thanks again.

Patrick

TDC Switch

Rising Edge Signal simulink, simscape, stateflow MATLAB Answers — New Questions

​

Why does my daily median calculation and write to channel fail unpredictably?
Matlab News

Why does my daily median calculation and write to channel fail unpredictably?

PuTI / 2025-05-08

I am trying to calculate the daily median across a range of channels and write the result to a new field for each channel. The code seems to run sometimes, but runs into rate limitation other times. I’m not sure why since I am only writing once and to different channels?
Error using Median calcs (line 39)
Requests are too frequent. For further information, see Limitations in the documentation.
My code is:
% Sensor/channel configuration
sensors = [
struct(‘name’, ‘McKinley’,’channelID’, 28xxxx, ‘writeKey’, ‘G3WPJ586M55Gxxxx’)
struct(‘name’, ‘DPI’, ‘channelID’, 80xxxx, ‘writeKey’, ‘S0E0LB45GQLMxxxx’)
struct(‘name’, ‘Bryony’,’channelID’, 29xxxx, ‘writeKey’, ‘2BPCI0IOAINPxxxx’)
];

% Define date range (last 24 hours to midnight)
endTime = dateshift(datetime(‘now’), ‘start’, ‘day’);
startTime = endTime – hours(24);

% Preallocate a results array
results = [];

% Step 1: Read and calculate all medians
for i = 1:length(sensors)
s = sensors(i);

% Read Field 1 for the past 24 hours
[weight, ~] = thingSpeakRead(s.channelID, ‘DateRange’, [startTime, endTime], ‘Fields’, 1);

% Compute median, ignoring NaNs
medianWeight = round(median(weight, ‘omitnan’),2);

% Store in results
results(i).name = s.name;
results(i).channelID = s.channelID;
results(i).writeKey = s.writeKey;
results(i).value = medianWeight;
end

% Step 2: Display results
for i = 1:length(results)
r = results(i);
fprintf(‘%s (Channel %d) → 24hr Median: %.2fn’, r.name, r.channelID, r.value);
end

% Step 3: Write results
thingSpeakWrite(results(1).channelID, ‘Fields’, 6, ‘Values’, {results(1).value}, ‘WriteKey’, results(1).writeKey);
thingSpeakWrite(results(2).channelID, ‘Fields’, 6, ‘Values’, {results(2).value}, ‘WriteKey’, results(2).writeKey);
thingSpeakWrite(results(3).channelID, ‘Fields’, 6, ‘Values’, {results(3).value}, ‘WriteKey’, results(3).writeKey);I am trying to calculate the daily median across a range of channels and write the result to a new field for each channel. The code seems to run sometimes, but runs into rate limitation other times. I’m not sure why since I am only writing once and to different channels?
Error using Median calcs (line 39)
Requests are too frequent. For further information, see Limitations in the documentation.
My code is:
% Sensor/channel configuration
sensors = [
struct(‘name’, ‘McKinley’,’channelID’, 28xxxx, ‘writeKey’, ‘G3WPJ586M55Gxxxx’)
struct(‘name’, ‘DPI’, ‘channelID’, 80xxxx, ‘writeKey’, ‘S0E0LB45GQLMxxxx’)
struct(‘name’, ‘Bryony’,’channelID’, 29xxxx, ‘writeKey’, ‘2BPCI0IOAINPxxxx’)
];

% Define date range (last 24 hours to midnight)
endTime = dateshift(datetime(‘now’), ‘start’, ‘day’);
startTime = endTime – hours(24);

% Preallocate a results array
results = [];

% Step 1: Read and calculate all medians
for i = 1:length(sensors)
s = sensors(i);

% Read Field 1 for the past 24 hours
[weight, ~] = thingSpeakRead(s.channelID, ‘DateRange’, [startTime, endTime], ‘Fields’, 1);

% Compute median, ignoring NaNs
medianWeight = round(median(weight, ‘omitnan’),2);

% Store in results
results(i).name = s.name;
results(i).channelID = s.channelID;
results(i).writeKey = s.writeKey;
results(i).value = medianWeight;
end

% Step 2: Display results
for i = 1:length(results)
r = results(i);
fprintf(‘%s (Channel %d) → 24hr Median: %.2fn’, r.name, r.channelID, r.value);
end

% Step 3: Write results
thingSpeakWrite(results(1).channelID, ‘Fields’, 6, ‘Values’, {results(1).value}, ‘WriteKey’, results(1).writeKey);
thingSpeakWrite(results(2).channelID, ‘Fields’, 6, ‘Values’, {results(2).value}, ‘WriteKey’, results(2).writeKey);
thingSpeakWrite(results(3).channelID, ‘Fields’, 6, ‘Values’, {results(3).value}, ‘WriteKey’, results(3).writeKey); I am trying to calculate the daily median across a range of channels and write the result to a new field for each channel. The code seems to run sometimes, but runs into rate limitation other times. I’m not sure why since I am only writing once and to different channels?
Error using Median calcs (line 39)
Requests are too frequent. For further information, see Limitations in the documentation.
My code is:
% Sensor/channel configuration
sensors = [
struct(‘name’, ‘McKinley’,’channelID’, 28xxxx, ‘writeKey’, ‘G3WPJ586M55Gxxxx’)
struct(‘name’, ‘DPI’, ‘channelID’, 80xxxx, ‘writeKey’, ‘S0E0LB45GQLMxxxx’)
struct(‘name’, ‘Bryony’,’channelID’, 29xxxx, ‘writeKey’, ‘2BPCI0IOAINPxxxx’)
];

% Define date range (last 24 hours to midnight)
endTime = dateshift(datetime(‘now’), ‘start’, ‘day’);
startTime = endTime – hours(24);

% Preallocate a results array
results = [];

% Step 1: Read and calculate all medians
for i = 1:length(sensors)
s = sensors(i);

% Read Field 1 for the past 24 hours
[weight, ~] = thingSpeakRead(s.channelID, ‘DateRange’, [startTime, endTime], ‘Fields’, 1);

% Compute median, ignoring NaNs
medianWeight = round(median(weight, ‘omitnan’),2);

% Store in results
results(i).name = s.name;
results(i).channelID = s.channelID;
results(i).writeKey = s.writeKey;
results(i).value = medianWeight;
end

% Step 2: Display results
for i = 1:length(results)
r = results(i);
fprintf(‘%s (Channel %d) → 24hr Median: %.2fn’, r.name, r.channelID, r.value);
end

% Step 3: Write results
thingSpeakWrite(results(1).channelID, ‘Fields’, 6, ‘Values’, {results(1).value}, ‘WriteKey’, results(1).writeKey);
thingSpeakWrite(results(2).channelID, ‘Fields’, 6, ‘Values’, {results(2).value}, ‘WriteKey’, results(2).writeKey);
thingSpeakWrite(results(3).channelID, ‘Fields’, 6, ‘Values’, {results(3).value}, ‘WriteKey’, results(3).writeKey); write limitation, thingspeak MATLAB Answers — New Questions

​

Simultaneously send data over SCIA-UART port and logging data on SD-card using an TI F28P65
Matlab News

Simultaneously send data over SCIA-UART port and logging data on SD-card using an TI F28P65

PuTI / 2025-05-08

Good evening,
I am writing code in Simulink for the TI f28p65 Launchpad of Texas instruments. Over all I use the c2000 library.
Following the tutorial https://de.mathworks.com/help/ti-c2000/ug/mat-file-sd-card-logging.html I am using a Scope block to log the data via the SPI-interface. Additionally I use SCIA-UART transmit to output the data in form of a string.
Sending the data via UART works fine in case I dont enable the sd card logging.
I have checked the correct setting of the pins as well as the funcitonality of the cables.

A similar issue occured already for the microcontroller, only it was programmed in c, such that no help was given for simulink. (https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1080828/tms320f280025-uart-and-spi)

I am looking forward to hearing from you!

Cheers,
IsabellaGood evening,
I am writing code in Simulink for the TI f28p65 Launchpad of Texas instruments. Over all I use the c2000 library.
Following the tutorial https://de.mathworks.com/help/ti-c2000/ug/mat-file-sd-card-logging.html I am using a Scope block to log the data via the SPI-interface. Additionally I use SCIA-UART transmit to output the data in form of a string.
Sending the data via UART works fine in case I dont enable the sd card logging.
I have checked the correct setting of the pins as well as the funcitonality of the cables.

A similar issue occured already for the microcontroller, only it was programmed in c, such that no help was given for simulink. (https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1080828/tms320f280025-uart-and-spi)

I am looking forward to hearing from you!

Cheers,
Isabella Good evening,
I am writing code in Simulink for the TI f28p65 Launchpad of Texas instruments. Over all I use the c2000 library.
Following the tutorial https://de.mathworks.com/help/ti-c2000/ug/mat-file-sd-card-logging.html I am using a Scope block to log the data via the SPI-interface. Additionally I use SCIA-UART transmit to output the data in form of a string.
Sending the data via UART works fine in case I dont enable the sd card logging.
I have checked the correct setting of the pins as well as the funcitonality of the cables.

A similar issue occured already for the microcontroller, only it was programmed in c, such that no help was given for simulink. (https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1080828/tms320f280025-uart-and-spi)

I am looking forward to hearing from you!

Cheers,
Isabella c2000, simulink, sdcardlogging, sci MATLAB Answers — New Questions

​

Infineon Buck Simscape Example – View_system(‘BuckSystem’) unrecognized function or variable ‘view system” error
Matlab News

Infineon Buck Simscape Example – View_system(‘BuckSystem’) unrecognized function or variable ‘view system” error

PuTI / 2025-05-07

I’ve tried running the "Infineon Buck Simscape Example" both online and locally and get the following error
View_system(‘BuckSystem’) unrecognized function or variable ‘view system"
I’m running R2023bI’ve tried running the "Infineon Buck Simscape Example" both online and locally and get the following error
View_system(‘BuckSystem’) unrecognized function or variable ‘view system"
I’m running R2023b I’ve tried running the "Infineon Buck Simscape Example" both online and locally and get the following error
View_system(‘BuckSystem’) unrecognized function or variable ‘view system"
I’m running R2023b infineon buck, view_system MATLAB Answers — New Questions

​

Previous 1 2 3 4 5 … 101 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