Author: PuTI
Determine the Bode diagram or a transfer function with input output data without tfest
In a partially unknown system, I measured a square-wave signal as input and the associated system response. Now I would like to use fft() to determine the transfer function or the Bode diagram. I have attached the measurements. I have the following code (also from this forum) but it results in this very bad bode plot. where is my mistake?
input = x3bzeit((23000:39000),2);
output = x3bzeit((23000:39000),3);
time = x3bzeit((23000:39000),1)*10^(-6);
Fs = 1/mean(diff(time)); % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
L = numel(time);
FTinp = fft(input)/L;
FTout = fft(output)/L;
TF = FTout ./ FTinp; % Transfer Function
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
subplot(2,1,1)
plot(Fv, 20*log10(abs(TF(Iv))))
set(gca, ‘XScale’, ‘log’)
title(‘Amplitude’)
ylabel(‘dB’)
subplot(2,1,2)
plot(Fv, angle(TF(Iv))*180/pi)
title(‘Phase’)
ylabel(‘°’)In a partially unknown system, I measured a square-wave signal as input and the associated system response. Now I would like to use fft() to determine the transfer function or the Bode diagram. I have attached the measurements. I have the following code (also from this forum) but it results in this very bad bode plot. where is my mistake?
input = x3bzeit((23000:39000),2);
output = x3bzeit((23000:39000),3);
time = x3bzeit((23000:39000),1)*10^(-6);
Fs = 1/mean(diff(time)); % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
L = numel(time);
FTinp = fft(input)/L;
FTout = fft(output)/L;
TF = FTout ./ FTinp; % Transfer Function
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
subplot(2,1,1)
plot(Fv, 20*log10(abs(TF(Iv))))
set(gca, ‘XScale’, ‘log’)
title(‘Amplitude’)
ylabel(‘dB’)
subplot(2,1,2)
plot(Fv, angle(TF(Iv))*180/pi)
title(‘Phase’)
ylabel(‘°’) In a partially unknown system, I measured a square-wave signal as input and the associated system response. Now I would like to use fft() to determine the transfer function or the Bode diagram. I have attached the measurements. I have the following code (also from this forum) but it results in this very bad bode plot. where is my mistake?
input = x3bzeit((23000:39000),2);
output = x3bzeit((23000:39000),3);
time = x3bzeit((23000:39000),1)*10^(-6);
Fs = 1/mean(diff(time)); % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
L = numel(time);
FTinp = fft(input)/L;
FTout = fft(output)/L;
TF = FTout ./ FTinp; % Transfer Function
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:numel(Fv); % Index Vector
figure
subplot(2,1,1)
plot(Fv, 20*log10(abs(TF(Iv))))
set(gca, ‘XScale’, ‘log’)
title(‘Amplitude’)
ylabel(‘dB’)
subplot(2,1,2)
plot(Fv, angle(TF(Iv))*180/pi)
title(‘Phase’)
ylabel(‘°’) bode, transfer function, fft MATLAB Answers — New Questions
Convert a part of simulink model of my project to VHDL or Verilog code for FPGA
I have completed my direct power control for my wind energy conversion system, this is going to be implemented in hardware for this i want to generated Verilog or VHDL code of Direct Power Control to produce pulses to the Back to back converter, how to do thisI have completed my direct power control for my wind energy conversion system, this is going to be implemented in hardware for this i want to generated Verilog or VHDL code of Direct Power Control to produce pulses to the Back to back converter, how to do this I have completed my direct power control for my wind energy conversion system, this is going to be implemented in hardware for this i want to generated Verilog or VHDL code of Direct Power Control to produce pulses to the Back to back converter, how to do this fpga, verilog, vhdl MATLAB Answers — New Questions
Xlim error in App designer
% Value changing function: STARTKnob_2
function STARTKnob_2ValueChanging(app, event)
arguments
app
event.Value(1,1) {mustBeNumeric}=0
end
app.StartYear = event.Value;
if app.StartYear>app.StopYear-1 %checks the increasing-xrule
app.StopYear=min([app.StartYear+1,app.STOPKnob.Limits(2)]);
app.STOPKnob.Value=app.StopYear; %rotate the stop knob
app.StartYear=app.StopYear-1;
app.STARTKnob_2.Value=app.StartYear;
end
app.plotData();
end
% Value changing function: STOPKnob
function STOPKnobValueChanging(app, event)
arguments
app
event.Value(1,1) {mustBeNumeric}=0
end
app.StopYear = event.Value;
if app.StopYear<app.StartYear+1
app.StartYear=max([app.StopYear-1 app.STARTKnob_2.Limits(1)]);
app.STARTKnob_2.Value=app.StartYear;
app.StopYear=app.StartYear+1;
app.STOPKnob.Value=app.StopYear;
end
app.plotData();% Value changing function: STARTKnob_2
function STARTKnob_2ValueChanging(app, event)
arguments
app
event.Value(1,1) {mustBeNumeric}=0
end
app.StartYear = event.Value;
if app.StartYear>app.StopYear-1 %checks the increasing-xrule
app.StopYear=min([app.StartYear+1,app.STOPKnob.Limits(2)]);
app.STOPKnob.Value=app.StopYear; %rotate the stop knob
app.StartYear=app.StopYear-1;
app.STARTKnob_2.Value=app.StartYear;
end
app.plotData();
end
% Value changing function: STOPKnob
function STOPKnobValueChanging(app, event)
arguments
app
event.Value(1,1) {mustBeNumeric}=0
end
app.StopYear = event.Value;
if app.StopYear<app.StartYear+1
app.StartYear=max([app.StopYear-1 app.STARTKnob_2.Limits(1)]);
app.STARTKnob_2.Value=app.StartYear;
app.StopYear=app.StartYear+1;
app.STOPKnob.Value=app.StopYear;
end
app.plotData(); % Value changing function: STARTKnob_2
function STARTKnob_2ValueChanging(app, event)
arguments
app
event.Value(1,1) {mustBeNumeric}=0
end
app.StartYear = event.Value;
if app.StartYear>app.StopYear-1 %checks the increasing-xrule
app.StopYear=min([app.StartYear+1,app.STOPKnob.Limits(2)]);
app.STOPKnob.Value=app.StopYear; %rotate the stop knob
app.StartYear=app.StopYear-1;
app.STARTKnob_2.Value=app.StartYear;
end
app.plotData();
end
% Value changing function: STOPKnob
function STOPKnobValueChanging(app, event)
arguments
app
event.Value(1,1) {mustBeNumeric}=0
end
app.StopYear = event.Value;
if app.StopYear<app.StartYear+1
app.StartYear=max([app.StopYear-1 app.STARTKnob_2.Limits(1)]);
app.STARTKnob_2.Value=app.StartYear;
app.StopYear=app.StartYear+1;
app.STOPKnob.Value=app.StopYear;
end
app.plotData(); xlim error in app designer MATLAB Answers — New Questions
IngressNightmare Vulnerabilities: All You Need to Know
On March 24, 2025, a series of several critical vulnerabilities (CVE-2025-1097, CVE-2025-1098, CVE-2025-24514, and CVE-2025-1974) were disclosed in the ingress-nginx
Controller for Kubernetes, collectively termed IngressNightmare. These vulnerabilities could lead to a complete cluster takeover by allowing attackers unauthorized access to all secrets stored across all namespaces in the Kubernetes cluster.
On March 24, 2025, a series of several critical vulnerabilities (CVE-2025-1097, CVE-2025-1098, CVE-2025-24514, and CVE-2025-1974) were disclosed in the ingress-nginx Controller for Kubernetes, collectively termed IngressNightmare. These vulnerabilities could lead to a complete cluster takeover by allowing attackers unauthorized access to all secrets stored across all namespaces in the Kubernetes cluster.
Read More
How can I simulate an active distribution system using the Monte Carlo method in MATLAB?
I need to simulate an article using MATLAB based on customer satisfaction using the Monte Carlo method
using by simulink or matlab code.
I know that this article doesn’t have an accurate circuit or block diagram and it should be optimized from previous sources. Assuming that a part is disconnected or connected randomly
You can see the original article here
here
anyone can help me on this ?!
best regards.I need to simulate an article using MATLAB based on customer satisfaction using the Monte Carlo method
using by simulink or matlab code.
I know that this article doesn’t have an accurate circuit or block diagram and it should be optimized from previous sources. Assuming that a part is disconnected or connected randomly
You can see the original article here
here
anyone can help me on this ?!
best regards. I need to simulate an article using MATLAB based on customer satisfaction using the Monte Carlo method
using by simulink or matlab code.
I know that this article doesn’t have an accurate circuit or block diagram and it should be optimized from previous sources. Assuming that a part is disconnected or connected randomly
You can see the original article here
here
anyone can help me on this ?!
best regards. simulink, monte carlo, active distribution networks, customer satisfaction MATLAB Answers — New Questions
add_line connection for to column cells
Hi there,
While creating column Cells connections, last cell in each column still not connected…stayed unconnected.
I wonder if someone can assist to solve this problem.
please see shared Matlab code (file.m) and picture (marked in red line)
Thanks for help
Tommy
open_system(‘Module_arc’)
mdl = ‘Module_arc’;
bat_rec_model = find_system(mdl,’FindAll’,’on’,’Name’,’Module_arc’);
%%% add Cell – basic CELL_unit:
for i=1:2 %% set two columns
colPos = 200; %% spaces between columns
for v=1:4 %% loop for 13 cells per column
nl=num2str(v + 4*(i-1));
if i==1
AddCell(v) = add_block(‘CELL_Unit/CELL 1’, [mdl,’/CELL ‘,nl]);
else
AddCell(v) = add_block(‘CELL_Unit2/CELL 1’, [mdl,’/CELL ‘,nl]);
end
posc = get(AddCell(v),’Position’);
set(AddCell(v),’Position’,posc + [100+(i-1)*colPos 120*(v-1)-45 100+(i-1)*colPos 120*(v-1)-45])
PH_AddCell{v}=get(AddCell(v),’PortHandles’);
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_AddCell{v-1}.LConn(2),PH_AddCell{v}.LConn(1),’Autorouting’,’on’);
end
end
switch i
case 2
Minus_2_Cell = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’NEG’);
PH_minus2Cell=get(Minus_2_Cell,’PortHandles’);
Neg_port= add_line(mdl,PH_minus2Cell.RConn,PH_AddCell{1}.LConn(1),’Autorouting’,’on’);
case 1
Plus_2_Cell = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’POS’);
PH_plus2Cell=get(Plus_2_Cell,’PortHandles’);
Pos_port= add_line(mdl,PH_plus2Cell.RConn,PH_AddCell{1}.LConn(1), ‘Autorouting’,’on’);
end
endHi there,
While creating column Cells connections, last cell in each column still not connected…stayed unconnected.
I wonder if someone can assist to solve this problem.
please see shared Matlab code (file.m) and picture (marked in red line)
Thanks for help
Tommy
open_system(‘Module_arc’)
mdl = ‘Module_arc’;
bat_rec_model = find_system(mdl,’FindAll’,’on’,’Name’,’Module_arc’);
%%% add Cell – basic CELL_unit:
for i=1:2 %% set two columns
colPos = 200; %% spaces between columns
for v=1:4 %% loop for 13 cells per column
nl=num2str(v + 4*(i-1));
if i==1
AddCell(v) = add_block(‘CELL_Unit/CELL 1’, [mdl,’/CELL ‘,nl]);
else
AddCell(v) = add_block(‘CELL_Unit2/CELL 1’, [mdl,’/CELL ‘,nl]);
end
posc = get(AddCell(v),’Position’);
set(AddCell(v),’Position’,posc + [100+(i-1)*colPos 120*(v-1)-45 100+(i-1)*colPos 120*(v-1)-45])
PH_AddCell{v}=get(AddCell(v),’PortHandles’);
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_AddCell{v-1}.LConn(2),PH_AddCell{v}.LConn(1),’Autorouting’,’on’);
end
end
switch i
case 2
Minus_2_Cell = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’NEG’);
PH_minus2Cell=get(Minus_2_Cell,’PortHandles’);
Neg_port= add_line(mdl,PH_minus2Cell.RConn,PH_AddCell{1}.LConn(1),’Autorouting’,’on’);
case 1
Plus_2_Cell = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’POS’);
PH_plus2Cell=get(Plus_2_Cell,’PortHandles’);
Pos_port= add_line(mdl,PH_plus2Cell.RConn,PH_AddCell{1}.LConn(1), ‘Autorouting’,’on’);
end
end Hi there,
While creating column Cells connections, last cell in each column still not connected…stayed unconnected.
I wonder if someone can assist to solve this problem.
please see shared Matlab code (file.m) and picture (marked in red line)
Thanks for help
Tommy
open_system(‘Module_arc’)
mdl = ‘Module_arc’;
bat_rec_model = find_system(mdl,’FindAll’,’on’,’Name’,’Module_arc’);
%%% add Cell – basic CELL_unit:
for i=1:2 %% set two columns
colPos = 200; %% spaces between columns
for v=1:4 %% loop for 13 cells per column
nl=num2str(v + 4*(i-1));
if i==1
AddCell(v) = add_block(‘CELL_Unit/CELL 1’, [mdl,’/CELL ‘,nl]);
else
AddCell(v) = add_block(‘CELL_Unit2/CELL 1’, [mdl,’/CELL ‘,nl]);
end
posc = get(AddCell(v),’Position’);
set(AddCell(v),’Position’,posc + [100+(i-1)*colPos 120*(v-1)-45 100+(i-1)*colPos 120*(v-1)-45])
PH_AddCell{v}=get(AddCell(v),’PortHandles’);
%%% connect minus to plus ports:
if v>1
add_line(mdl,PH_AddCell{v-1}.LConn(2),PH_AddCell{v}.LConn(1),’Autorouting’,’on’);
end
end
switch i
case 2
Minus_2_Cell = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’NEG’);
PH_minus2Cell=get(Minus_2_Cell,’PortHandles’);
Neg_port= add_line(mdl,PH_minus2Cell.RConn,PH_AddCell{1}.LConn(1),’Autorouting’,’on’);
case 1
Plus_2_Cell = find_system(mdl,’LookUnderMasks’,’All’,’FindAll’,’on’,’Name’,’POS’);
PH_plus2Cell=get(Plus_2_Cell,’PortHandles’);
Pos_port= add_line(mdl,PH_plus2Cell.RConn,PH_AddCell{1}.LConn(1), ‘Autorouting’,’on’);
end
end matlab, simulink MATLAB Answers — New Questions
Data must be a single matrix Y or a list of pairs X,Y
My aim is to plot 2d the function ph (xx,yy) in the plane (xx,yy).
x-axis is xx, y-axis is yy, and the function ph(xx,yy)
=====================================================
q=1.0;
v=(1.0-sqrt(1.0+4.0*q))/(2.0*q);
p=4*atan(1.0);
for j=0:100
a=0.0+j.*p/100;
fori=0:100
b=0.0+i.*p/100;
x=cos(a);
y=sin(b);
z=x.*x+y.*y;
if z<1.0
xx=x;
yy=y;
zz=z;
D=1.0+q.*(v.*v)*(zz.*zz);
N=1.0-v.*zz-q.*(v.*v)*(zz.*zz);
ph=D/N;
hold on
plot(xx,yy,ph)
end
end
end
=====================================My aim is to plot 2d the function ph (xx,yy) in the plane (xx,yy).
x-axis is xx, y-axis is yy, and the function ph(xx,yy)
=====================================================
q=1.0;
v=(1.0-sqrt(1.0+4.0*q))/(2.0*q);
p=4*atan(1.0);
for j=0:100
a=0.0+j.*p/100;
fori=0:100
b=0.0+i.*p/100;
x=cos(a);
y=sin(b);
z=x.*x+y.*y;
if z<1.0
xx=x;
yy=y;
zz=z;
D=1.0+q.*(v.*v)*(zz.*zz);
N=1.0-v.*zz-q.*(v.*v)*(zz.*zz);
ph=D/N;
hold on
plot(xx,yy,ph)
end
end
end
===================================== My aim is to plot 2d the function ph (xx,yy) in the plane (xx,yy).
x-axis is xx, y-axis is yy, and the function ph(xx,yy)
=====================================================
q=1.0;
v=(1.0-sqrt(1.0+4.0*q))/(2.0*q);
p=4*atan(1.0);
for j=0:100
a=0.0+j.*p/100;
fori=0:100
b=0.0+i.*p/100;
x=cos(a);
y=sin(b);
z=x.*x+y.*y;
if z<1.0
xx=x;
yy=y;
zz=z;
D=1.0+q.*(v.*v)*(zz.*zz);
N=1.0-v.*zz-q.*(v.*v)*(zz.*zz);
ph=D/N;
hold on
plot(xx,yy,ph)
end
end
end
===================================== error in plot MATLAB Answers — New Questions
Legends using bodeplot with latex interpretation
Hi, I am trying to write code for plotting frequency responses and cannot get the legend to accept latex formatting. I know there are issues with all of these signal processing tools and stuff like legends, but if I open the figure in a new window and manually adjust the legend in the property editor then it is possible. So there must be a work around. Here is one of the many iterations I have used, in this version the legend appears, but as soon as I add interpreter to the command then I get errors such as seen below:
G1 = G(1,1);
G2 = G(1,2);
G3 = G(2,1);
G4 = G(2,2);
names = {‘$G_{11}$’, ‘$G_{12}$’, ‘$G_{21}$’, ‘$G_{22}$’};
LegendValues = string(names);
bp = bodeplot(G1, G2, G3, G4);
opts = bodeoptions;
opts.Title.String = ”; % Disable title
opts.XLabel.Interpreter = ‘latex’;
opts.XLabel.FontSize = 12;
opts.YLabel.Interpreter = ‘latex’;
opts.YLabel.FontSize = 12;
opts.PhaseVisible = ‘off’; % Hide phase plot
opts.Grid = ‘on’; % Enable grid
setoptions(bp, opts);
legend(LegendValues);
Error if I add interpreter (legend(LegendValues, "Interpreter","latex");):
"Error using legend (line 176). First argument must be text."
I appreciate any input.
MarcusHi, I am trying to write code for plotting frequency responses and cannot get the legend to accept latex formatting. I know there are issues with all of these signal processing tools and stuff like legends, but if I open the figure in a new window and manually adjust the legend in the property editor then it is possible. So there must be a work around. Here is one of the many iterations I have used, in this version the legend appears, but as soon as I add interpreter to the command then I get errors such as seen below:
G1 = G(1,1);
G2 = G(1,2);
G3 = G(2,1);
G4 = G(2,2);
names = {‘$G_{11}$’, ‘$G_{12}$’, ‘$G_{21}$’, ‘$G_{22}$’};
LegendValues = string(names);
bp = bodeplot(G1, G2, G3, G4);
opts = bodeoptions;
opts.Title.String = ”; % Disable title
opts.XLabel.Interpreter = ‘latex’;
opts.XLabel.FontSize = 12;
opts.YLabel.Interpreter = ‘latex’;
opts.YLabel.FontSize = 12;
opts.PhaseVisible = ‘off’; % Hide phase plot
opts.Grid = ‘on’; % Enable grid
setoptions(bp, opts);
legend(LegendValues);
Error if I add interpreter (legend(LegendValues, "Interpreter","latex");):
"Error using legend (line 176). First argument must be text."
I appreciate any input.
Marcus Hi, I am trying to write code for plotting frequency responses and cannot get the legend to accept latex formatting. I know there are issues with all of these signal processing tools and stuff like legends, but if I open the figure in a new window and manually adjust the legend in the property editor then it is possible. So there must be a work around. Here is one of the many iterations I have used, in this version the legend appears, but as soon as I add interpreter to the command then I get errors such as seen below:
G1 = G(1,1);
G2 = G(1,2);
G3 = G(2,1);
G4 = G(2,2);
names = {‘$G_{11}$’, ‘$G_{12}$’, ‘$G_{21}$’, ‘$G_{22}$’};
LegendValues = string(names);
bp = bodeplot(G1, G2, G3, G4);
opts = bodeoptions;
opts.Title.String = ”; % Disable title
opts.XLabel.Interpreter = ‘latex’;
opts.XLabel.FontSize = 12;
opts.YLabel.Interpreter = ‘latex’;
opts.YLabel.FontSize = 12;
opts.PhaseVisible = ‘off’; % Hide phase plot
opts.Grid = ‘on’; % Enable grid
setoptions(bp, opts);
legend(LegendValues);
Error if I add interpreter (legend(LegendValues, "Interpreter","latex");):
"Error using legend (line 176). First argument must be text."
I appreciate any input.
Marcus bodeplot, legend MATLAB Answers — New Questions
How to convert polynomial trajectory block out to a 4×4 homogeneous transformation matrix
I created 7 waypoints using inverse kinematics designer app and exported the configuration into a matrix (7×6 matrix) containg xyz position and respective euler angles. From this matrix i input only the xyz position data(3×7 matrix) as waypoints to a polynomial trajectory block with time. But when i run the simulink an error is showing up, saying that polynomial trajectory output should be 4×4 homogeneous matrix inorder to connect to the inverse kinematics block input (pose). How could I resolve this issueI created 7 waypoints using inverse kinematics designer app and exported the configuration into a matrix (7×6 matrix) containg xyz position and respective euler angles. From this matrix i input only the xyz position data(3×7 matrix) as waypoints to a polynomial trajectory block with time. But when i run the simulink an error is showing up, saying that polynomial trajectory output should be 4×4 homogeneous matrix inorder to connect to the inverse kinematics block input (pose). How could I resolve this issue I created 7 waypoints using inverse kinematics designer app and exported the configuration into a matrix (7×6 matrix) containg xyz position and respective euler angles. From this matrix i input only the xyz position data(3×7 matrix) as waypoints to a polynomial trajectory block with time. But when i run the simulink an error is showing up, saying that polynomial trajectory output should be 4×4 homogeneous matrix inorder to connect to the inverse kinematics block input (pose). How could I resolve this issue polynomial trajectory, inverse kinematics, simulink MATLAB Answers — New Questions
Precision issue when comparing matlab output with c code output
I am trying to compare my c code output with matlab output. My results are matching up to 18th decimal points. When both matlab and c compiler uses ieee754 floating point format. Then why am I observing the difference. As matlab by default uses double precision, my c code is also using double data type.I am trying to compare my c code output with matlab output. My results are matching up to 18th decimal points. When both matlab and c compiler uses ieee754 floating point format. Then why am I observing the difference. As matlab by default uses double precision, my c code is also using double data type. I am trying to compare my c code output with matlab output. My results are matching up to 18th decimal points. When both matlab and c compiler uses ieee754 floating point format. Then why am I observing the difference. As matlab by default uses double precision, my c code is also using double data type. ieee754, precision, accuracy MATLAB Answers — New Questions
how can I convert linear figure’s axis to logarithmic?
Hi,
I have following Figure#1, I want to convert only y-axis to logaritmic scale. I tried several ways but each time outcome is not normal. Can you please tell me how to achive y-axis of Figure#2. Thanks for you help.
% this my figure script.
figure;
imagesc(t, fliplr(f), ST_normalized)
previously I used the follwing command, it did not work. I want to have the image of Figure#2 in y-axis.
for instance, "10" in Figure#1 shoud be "10^1" in a new scaled figure.
set(gca, ‘YScale’, ‘log’)Hi,
I have following Figure#1, I want to convert only y-axis to logaritmic scale. I tried several ways but each time outcome is not normal. Can you please tell me how to achive y-axis of Figure#2. Thanks for you help.
% this my figure script.
figure;
imagesc(t, fliplr(f), ST_normalized)
previously I used the follwing command, it did not work. I want to have the image of Figure#2 in y-axis.
for instance, "10" in Figure#1 shoud be "10^1" in a new scaled figure.
set(gca, ‘YScale’, ‘log’) Hi,
I have following Figure#1, I want to convert only y-axis to logaritmic scale. I tried several ways but each time outcome is not normal. Can you please tell me how to achive y-axis of Figure#2. Thanks for you help.
% this my figure script.
figure;
imagesc(t, fliplr(f), ST_normalized)
previously I used the follwing command, it did not work. I want to have the image of Figure#2 in y-axis.
for instance, "10" in Figure#1 shoud be "10^1" in a new scaled figure.
set(gca, ‘YScale’, ‘log’) matlab, figure, scale MATLAB Answers — New Questions
Massive slowdown for Apple Silicon in computing SVD
I recently notice that there is an extreme slowdown in my version of Matlab while computing an SVD when the size of the matrix crosses some threshold. I came up with the following example that demonstrates my issue:
N = [10000 11000 12000 13000];
for i = 1:4
A = randn(N(i),3);
tic;
[U,S,V] = svd(A,0);
toc;
end
When I run this in Matlab R2024b (macOS Apple silicon), the output is:
Elapsed time is 0.000396 seconds.
Elapsed time is 0.000275 seconds.
Elapsed time is 0.000264 seconds.
Elapsed time is 0.083150 seconds.
Of course the exact numbers vary trial to trial, but the speed for the last run (where N = 13000) is consistently orders of magnitude slower.
When I run this same code on Matlab R2024b (Intel processor) on the same computer, this slow down does not happen. I was able to replicate this issue across two different Macs (one with M1 and another with M3) and different versions of Matlab (going back to R2023b).
Any idea why this might be happening in the silicon version?
Edit: I’m running macOS 15.1.1I recently notice that there is an extreme slowdown in my version of Matlab while computing an SVD when the size of the matrix crosses some threshold. I came up with the following example that demonstrates my issue:
N = [10000 11000 12000 13000];
for i = 1:4
A = randn(N(i),3);
tic;
[U,S,V] = svd(A,0);
toc;
end
When I run this in Matlab R2024b (macOS Apple silicon), the output is:
Elapsed time is 0.000396 seconds.
Elapsed time is 0.000275 seconds.
Elapsed time is 0.000264 seconds.
Elapsed time is 0.083150 seconds.
Of course the exact numbers vary trial to trial, but the speed for the last run (where N = 13000) is consistently orders of magnitude slower.
When I run this same code on Matlab R2024b (Intel processor) on the same computer, this slow down does not happen. I was able to replicate this issue across two different Macs (one with M1 and another with M3) and different versions of Matlab (going back to R2023b).
Any idea why this might be happening in the silicon version?
Edit: I’m running macOS 15.1.1 I recently notice that there is an extreme slowdown in my version of Matlab while computing an SVD when the size of the matrix crosses some threshold. I came up with the following example that demonstrates my issue:
N = [10000 11000 12000 13000];
for i = 1:4
A = randn(N(i),3);
tic;
[U,S,V] = svd(A,0);
toc;
end
When I run this in Matlab R2024b (macOS Apple silicon), the output is:
Elapsed time is 0.000396 seconds.
Elapsed time is 0.000275 seconds.
Elapsed time is 0.000264 seconds.
Elapsed time is 0.083150 seconds.
Of course the exact numbers vary trial to trial, but the speed for the last run (where N = 13000) is consistently orders of magnitude slower.
When I run this same code on Matlab R2024b (Intel processor) on the same computer, this slow down does not happen. I was able to replicate this issue across two different Macs (one with M1 and another with M3) and different versions of Matlab (going back to R2023b).
Any idea why this might be happening in the silicon version?
Edit: I’m running macOS 15.1.1 svd, mac, memory, speed MATLAB Answers — New Questions
Error using save, too many output arguments – don’t know how to fix.
Hi y’all
I am trying to save multiple tables I’ve edited in matlab, but I get this error:
Error using save
Too many output arguments.
I’m having trouble figuring out how to fix this. The code it’s probably referring to is:
function [output] = save_on_Computer(ReferenceData, month, day)
file_name = "OL_"+month+"_"+day+".csv" ;
savefile = save(file_name) ;
output = savefile ;
end
from the full code here:
% Pull data from files
function [output] = each_day_table(month, day)
fileNames = sprintf(‘D2024%02d%02d*.csv’, month, day) ;
datastore_result = datastore(fileNames) ;
original_data = readall(datastore_result) ;
output = original_data ;
end
% Find Where Equivilant Diamiter > 150 And Remove (ICB measures b/w 2 – 150 μm)
function [output] = remove_150(original)
new = original ;
Greater150 = original.EquivDiameter > 150 ;
new(Greater150, 🙂 = [] ;
output = new ;
end
% To Save Each Newly Made File Onto Computer
function [output] = save_on_Computer(ReferenceData, month, day)
file_name = "OL_"+month+"_"+day+".csv" ;
savefile = save(file_name) ;
output = savefile ;
end
function [output] = do_everything(year, month, day)
original_data = each_day_table(month, day) ;
data_lessthan_150 = remove_150( original_data) ;
save_to_folder = save_on_Computer(data_without_zeroes, month, day) ;
output = save_on_Computer ; % change data_with_surface_area with data_with_ratio
end
OL_06_03 = do_everything (2024,06,03) ;
OL_06_04 = do_everything (2024,06,04) ;
OL_06_05 = do_everything (2024,06,05) ;
OL_06_06 = do_everything (2024,06,06) ;Hi y’all
I am trying to save multiple tables I’ve edited in matlab, but I get this error:
Error using save
Too many output arguments.
I’m having trouble figuring out how to fix this. The code it’s probably referring to is:
function [output] = save_on_Computer(ReferenceData, month, day)
file_name = "OL_"+month+"_"+day+".csv" ;
savefile = save(file_name) ;
output = savefile ;
end
from the full code here:
% Pull data from files
function [output] = each_day_table(month, day)
fileNames = sprintf(‘D2024%02d%02d*.csv’, month, day) ;
datastore_result = datastore(fileNames) ;
original_data = readall(datastore_result) ;
output = original_data ;
end
% Find Where Equivilant Diamiter > 150 And Remove (ICB measures b/w 2 – 150 μm)
function [output] = remove_150(original)
new = original ;
Greater150 = original.EquivDiameter > 150 ;
new(Greater150, 🙂 = [] ;
output = new ;
end
% To Save Each Newly Made File Onto Computer
function [output] = save_on_Computer(ReferenceData, month, day)
file_name = "OL_"+month+"_"+day+".csv" ;
savefile = save(file_name) ;
output = savefile ;
end
function [output] = do_everything(year, month, day)
original_data = each_day_table(month, day) ;
data_lessthan_150 = remove_150( original_data) ;
save_to_folder = save_on_Computer(data_without_zeroes, month, day) ;
output = save_on_Computer ; % change data_with_surface_area with data_with_ratio
end
OL_06_03 = do_everything (2024,06,03) ;
OL_06_04 = do_everything (2024,06,04) ;
OL_06_05 = do_everything (2024,06,05) ;
OL_06_06 = do_everything (2024,06,06) ; Hi y’all
I am trying to save multiple tables I’ve edited in matlab, but I get this error:
Error using save
Too many output arguments.
I’m having trouble figuring out how to fix this. The code it’s probably referring to is:
function [output] = save_on_Computer(ReferenceData, month, day)
file_name = "OL_"+month+"_"+day+".csv" ;
savefile = save(file_name) ;
output = savefile ;
end
from the full code here:
% Pull data from files
function [output] = each_day_table(month, day)
fileNames = sprintf(‘D2024%02d%02d*.csv’, month, day) ;
datastore_result = datastore(fileNames) ;
original_data = readall(datastore_result) ;
output = original_data ;
end
% Find Where Equivilant Diamiter > 150 And Remove (ICB measures b/w 2 – 150 μm)
function [output] = remove_150(original)
new = original ;
Greater150 = original.EquivDiameter > 150 ;
new(Greater150, 🙂 = [] ;
output = new ;
end
% To Save Each Newly Made File Onto Computer
function [output] = save_on_Computer(ReferenceData, month, day)
file_name = "OL_"+month+"_"+day+".csv" ;
savefile = save(file_name) ;
output = savefile ;
end
function [output] = do_everything(year, month, day)
original_data = each_day_table(month, day) ;
data_lessthan_150 = remove_150( original_data) ;
save_to_folder = save_on_Computer(data_without_zeroes, month, day) ;
output = save_on_Computer ; % change data_with_surface_area with data_with_ratio
end
OL_06_03 = do_everything (2024,06,03) ;
OL_06_04 = do_everything (2024,06,04) ;
OL_06_05 = do_everything (2024,06,05) ;
OL_06_06 = do_everything (2024,06,06) ; save, error MATLAB Answers — New Questions
how to find the accuracy from the predicted labels for test data in Matlab?
I am using classification learner app svm generated code for the classification of multiclass dataset.
Now I wanted to test with the unseen dataset for this I am using yfit.
Now I got the predicted labels for the test data. How to find the test accuracy and from the predicted laebls?
Can someone please help me in this.I am using classification learner app svm generated code for the classification of multiclass dataset.
Now I wanted to test with the unseen dataset for this I am using yfit.
Now I got the predicted labels for the test data. How to find the test accuracy and from the predicted laebls?
Can someone please help me in this. I am using classification learner app svm generated code for the classification of multiclass dataset.
Now I wanted to test with the unseen dataset for this I am using yfit.
Now I got the predicted labels for the test data. How to find the test accuracy and from the predicted laebls?
Can someone please help me in this. calculate test data accuracy MATLAB Answers — New Questions
C-Caller Block in Rapid Accelerator Mode with Busses
Is it possible to use the C-Caller in rapid accelerator mode when using buses?
When I include my structs as buses using `Simulink.importExternalCTypes`, I can’t run my simulation in rapid accelerator mode, because there is a name collision between my c code and the code generated by the rapid accelerator build process.
Renaming the structs in my code does not work, as then my c -caller blocks don’t recognize them as valid input/output dataformats.
This problem can be reproduced by using the C-Caller example "Call C Functions Using C Caller Block" (https://de.mathworks.com/help/releases/R2024b/simulink/slref/call-c-functions-using-c-caller-block.html).
When switching the example to rapid accelerator mode, the same problem occurs.Is it possible to use the C-Caller in rapid accelerator mode when using buses?
When I include my structs as buses using `Simulink.importExternalCTypes`, I can’t run my simulation in rapid accelerator mode, because there is a name collision between my c code and the code generated by the rapid accelerator build process.
Renaming the structs in my code does not work, as then my c -caller blocks don’t recognize them as valid input/output dataformats.
This problem can be reproduced by using the C-Caller example "Call C Functions Using C Caller Block" (https://de.mathworks.com/help/releases/R2024b/simulink/slref/call-c-functions-using-c-caller-block.html).
When switching the example to rapid accelerator mode, the same problem occurs. Is it possible to use the C-Caller in rapid accelerator mode when using buses?
When I include my structs as buses using `Simulink.importExternalCTypes`, I can’t run my simulation in rapid accelerator mode, because there is a name collision between my c code and the code generated by the rapid accelerator build process.
Renaming the structs in my code does not work, as then my c -caller blocks don’t recognize them as valid input/output dataformats.
This problem can be reproduced by using the C-Caller example "Call C Functions Using C Caller Block" (https://de.mathworks.com/help/releases/R2024b/simulink/slref/call-c-functions-using-c-caller-block.html).
When switching the example to rapid accelerator mode, the same problem occurs. c-code, c-caller, code-integration, rapid-accelerator, simulink, simulation MATLAB Answers — New Questions
How the Google-Wiz acquisition redefines cloud security
Google’s acquisition of Wiz, announced last week, is a pivotal moment as it marks a strategic shift in how cyber security will evolve over the next few years. It instantly turns Google into a major player in security, adding Wiz to other building blocks Google has racked up in the past couple of years, most notably Mandiant and Google Chronicle.
Google’s acquisition of Wiz, announced last week, is a pivotal moment as it marks a strategic shift in how cyber security will evolve over the next few years. It instantly turns Google into a major player in security, adding Wiz to other building blocks Google has racked up in the past couple of years, most notably Mandiant and Google Chronicle.
Read More
Microsoft at 50: The journey and future of the partner ecosystem
As we celebrate Microsoft’s 50th anniversary, our annual State of the Partner Ecosystem moment is a great opportunity to reflect on the incredible journey we’ve shared with our partners, employees and customers. Together, we’ve harnessed technology as a force for good, transforming industries and communities. From our early days of revolutionizing personal computing to leading the way in cloud innovation and now AI, our shared milestones highlight the power of collaboration and reinvention.
Fifty years ago, Microsoft started with a bold idea: the belief that technology could change the world. Thanks to the largest partner ecosystem in the industry, numbering 500,000 and growing, that vision became a reality, and I know we are just getting started. From the early days of distributing Windows PCs and Office to now delivering AI transformation strategies that solve the most complex customer challenges, our ability to stay at the forefront of innovation as technology evolves is a testament to our culture of continuous reinvention.
According to IDC, for every $1 of Microsoft revenue, services partners earn $8.45, and software partners earn $10.93. This underscores the immense opportunity available to partners of all types. As we look ahead to the future, we know that generative AI (GenAI) is forecast to grow exponentially faster than the overall IT market. Partners generating at least 25% of their Microsoft-related revenue from AI can expect higher margins and revenue growth, unlocking even more potential for transformation and success.*
Microsoft has always been a partner-led company. Our partners are core to our heritage and our future. Their innovation and collaboration have driven real transformation and customer success and will continue to shape the future of industries around the world. As we commemorate this historic moment, I want to take the opportunity to say Thank You to our partners for being on this incredible journey with us.
Here are just a few ways you can join us to celebrate this milestone:
- Watch this video from Judson Althoff, Executive Vice President and Chief Commercial Officer, Microsoft.
- Join the Microsoft AI Skills Fest for 50 days of learning and discovery starting April 8! Gain skills that will empower you and your team to build innovative AI solutions with Microsoft’s apps and services.
“For decades, Intel’s partnership with Microsoft has sparked innovation and delivered value to our customers. Together, we’ve revolutionized industries and established new benchmarks for excellence. We look forward to collaborating for the next 50 years — and beyond.”
— Jim Johnson, Senior Vice President, Client Computing Group, Intel
Preparing for the future with the Microsoft AI Cloud Partner Program (MAICPP)
Microsoft succeeds when our partners succeed. MAICPP has evolved to enable partners worldwide to deliver customer outcomes across every industry, from small businesses to the largest enterprises. Our program is designed to provide our partners with the most relevant tools and resources they need to thrive in a rapidly changing market, and it serves as the home for all partner types.
“As a proud Microsoft alum, I’ve seen firsthand how our collaboration has evolved to drive meaningful change for businesses across industries. From strategy through engineering and implementation, PwC and Microsoft drive innovation and deliver real business outcomes for clients worldwide.”
— Stephanie Mosticchio, Principal, US and Global Microsoft Alliance Leader, PwC
Through MAICPP, all partners can access updated benefits packages designed to accelerate growth and meet specific business needs. Software development companies are encouraged to explore ISV Success, a pathway offering additional benefits to expand development capabilities and shorten time to market. Whether building, publishing or growing sales, partners can leverage targeted offers to get the support they need.
“As someone who has led global partnerships at several of the world’s leading technology companies, I am impressed by how Microsoft has leaned in with their partner ecosystem and taken a leadership position in cloud computing and AI. We, at Snowflake, are excited to continue to strengthen our partnership in the years to come, and we look forward to jointly driving customer success in the age of enterprise AI. Congratulations!
— Tyler Prince, Senior Vice President of Worldwide Alliances & Channels, Snowflake
Depending on business goals, partners may pursue a Solutions Partner designation or specialization, both of which provide tailored benefits to help differentiate their business in a competitive market. Achieving a designation unlocks valuable go-to-market resources, sales support, new incentives and product benefits to help expand customer reach, sharpen skills and drive growth. For software development companies, becoming a Solutions Partner** with certified software*** further enhances market presence by validating software capabilities in high-demand areas.
“Having worked alongside every CEO of Microsoft in my career, I would like to personally congratulate Microsoft for its 50 extraordinary years of driving relentless innovation.”
“Lenovo is proud to be a major part of this amazing journey with Microsoft and we are committed to this partnership for many more decades to come.”
— Yuanqing Yang, Chairman and Chief Executive Officer, Lenovo
For partners holding an Azure designation or Azure specialization, additional incentives are available through Azure Migrate and Modernize and Azure Innovate — both underpinned by Azure Essentials. With comprehensive resources, extensive coverage across scenarios and tailored incentives in one easy-to-navigate hub, Azure partners can better support customers from migration to innovation. Learn more in What’s new for Azure partner-led offerings: ISV Success and specialization updates.
Our program offers benefits for partners aligned to their growth stage and across all customer segments. We have recently made the process of obtaining an Azure Solutions Partner designation more aligned to our partners who specialize in working with small and midsize customers. We are also expanding access to Azure Migrate and Modernize and Azure Innovate incentives for SMB pathways. Read more about the SMB path to Azure Solutions Partner designations.
Cloud Solution Provider is our partner hero motion for small and medium enterprises
In November at Microsoft Ignite, we highlighted the $661 billion total addressable market (TAM) opportunity for SME&C customers in FY25 and beyond. Cloud Solution Provider (CSP) partners are the trusted advisors who serve these customers and accelerate their AI transformation with the value-added services and solutions that create real business impact. CSP is our hero motion that enables those partners to drive this business transformation.
“Our Microsoft partnership has evolved to meet the needs of our business and our partners. Together we’ve been able to support our partners to deliver true solution and value selling, leveraging the robust resources available through Microsoft AI Cloud Partner Program and benefitting from the rich incentives. It has enabled us to drive innovation and deliver exceptional experiences for our partners through our ArrowSphere platform and broader enablement programs to ensure they’re empowered to deliver real customer outcomes. Together, we’re enabling the channel to deliver solutions that deliver real impact for customers around the world.”
— Brendan Murphy, Global Director, Public Cloud, Arrow Electronics
We strive to provide CSP partners with the skilling, capabilities and investments to make this opportunity a reality. So far in FY25, we have:
- focused our incentives to clearly align to our five strategic priorities — Copilot on every device across every role, AI design wins with every customer, securing the cyber foundation of every customer, a focus on migrations and Microsoft 365 execution
- dedicated 70% of our total incentive spend to partners that serve the Small and Medium Enterprise and Customer (SME&C) segment
- introduced a series of new promos, including a new-to-Microsoft 365 E5 offer to enable CSP partners to win new customers
Expanding our portfolio of CSP offers and capabilities is an ongoing priority. We share updates as they become available.
Capturing the marketplace opportunity
As customers increasingly centralize their solution procurement, marketplaces have become the preferred buying platform. For software companies, adopting cloud marketplaces accelerates deal closure and increases deal sizes. Serving as a global B2B commerce engine, our marketplace empowers Microsoft partners to provide solutions to customers worldwide. It offers various sales models: digital direct, through partners or with Microsoft — providing flexibility to align with how customers want to buy and how partners want to sell. Learn more in this recent blog.
Unlocking success through skilling and events
The speed of technology innovation requires continuous learning. To support this, we offer our partners a variety of skilling opportunities, such as our popular in-person Microsoft AI Partner Training Days, designed to help partners develop both technical and sales capabilities.
We are also streamlining and simplifying our skilling portals through initiatives like Microsoft Sales Titan (currently in private preview for CSP Accelerate partners and available for all partners in summer 2025), a program tailored to equip sales professionals with in-depth knowledge of Microsoft Threat Protection SKUs, empowering them to position themselves as industry leaders. Discover these and other skilling opportunities.
Looking ahead, we invite our partners to join us at Microsoft Build, taking place May 19–22, 2025. This flagship event offers an exclusive opportunity to explore the latest advancements in AI, learn how to work smarter and elevate your projects. Connect with peers, industry experts and Microsoft leadership while diving into the code and innovations that will shape the future.
“Schneider Electric and Microsoft have been driven by a shared vision of a world that is more electric and digital. We’re thrilled to celebrate Microsoft’s 50th anniversary and excited to continue pioneering innovative solutions together, harnessing the transformative power of AI, pushing the boundaries of what’s possible for our customers and shaping a sustainable future for generations to come.”
— Frédéric Godemel, Executive Vice President, Energy Management, Schneider Electric
Looking forward – the next 50 years
As we celebrate this remarkable milestone, we remain focused on and optimistic for the future. We continue to innovate, collaborate and empower our partners to thrive in the era of AI and beyond. The past 50 years have been defined by shared success, and this will continue for our future. Together, we will unlock new opportunities, drive transformation and shape the future of technology.
Throughout this journey, stories of innovation have inspired us. A few examples of how partners are celebrating our 50th anniversary are included in this blog. See the full list of partner quotes on the Microsoft 50th Anniversary celebration site.
Thank you for being an integral part of our story. We can’t wait to see what we’ll accomplish together next!
*IDC: Microsoft Partners: Driving Economic Value and AI Maturity
**“Solutions Partner” refers to a company that is a member of the Microsoft AI Cloud Partner Program and may offer software, services, and/or solutions to customers. Reference to “Solutions Partner” in any content, materials, resources, web properties, etc. and any associated designation should be not interpreted as an offer, endorsement, guarantee, proof of effectiveness or functionality, a commitment or any other type of representation or warranty on the part of Microsoft. All decisions pertaining to and related to your business needs including but not limited to strategies, solutions, partner selection, implementation, etc. rest solely with your business.
***A certification is (A) specific to the solution’s interoperability with Microsoft products and (B) based on self-attestation by the solution owner. Solutions are only certified as of the date the solution is reviewed. Solution functionality and capability are controlled by the solution owner and may be subject to change. The inclusion of a solution in marketplace and any such designations should not be interpreted as an offer, endorsement, guarantee, proof of effectiveness or functionality, a commitment or any other type of representation or warranty on the part of Microsoft. All decisions pertaining and related to your business needs including but not limited to strategies, solutions, partner selection, implementation, etc. rest solely with your business.
The post Microsoft at 50: The journey and future of the partner ecosystem appeared first on The Official Microsoft Blog.
As we celebrate Microsoft’s 50th anniversary, our annual State of the Partner Ecosystem moment is a great opportunity to reflect on the incredible journey we’ve shared with our partners, employees and customers. Together, we’ve harnessed technology as a force for good, transforming industries and communities. From our early days of revolutionizing personal computing to leading…
The post Microsoft at 50: The journey and future of the partner ecosystem appeared first on The Official Microsoft Blog.Read More
Why this error is occuring while deploying in ROS2?
Hey all, I am trying to deploy in a ROS2 device from Simulink. I keep facing this error. FYI, the device being deployed in is Intel Nuc. It is being deployed through Wi-Fi. I also deployed in another ROS2 machine without any error therefore the Simulink model has no error by design. Please don’t hesitate to ask for further information. Glad to provide to solve the issue.Hey all, I am trying to deploy in a ROS2 device from Simulink. I keep facing this error. FYI, the device being deployed in is Intel Nuc. It is being deployed through Wi-Fi. I also deployed in another ROS2 machine without any error therefore the Simulink model has no error by design. Please don’t hesitate to ask for further information. Glad to provide to solve the issue. Hey all, I am trying to deploy in a ROS2 device from Simulink. I keep facing this error. FYI, the device being deployed in is Intel Nuc. It is being deployed through Wi-Fi. I also deployed in another ROS2 machine without any error therefore the Simulink model has no error by design. Please don’t hesitate to ask for further information. Glad to provide to solve the issue. ros2, simulink MATLAB Answers — New Questions
When I import a Creo model to Simscape Multibody, some of my reference frames are not being imported. Is there something I need to do in Creo or in Simscape?
I have imported a Creo model via the multibody link to Simscape. When I open the model in Mechanics Explorer, the model itself has been imported correctly, but not all the reference frames are imported (I set reference frames at the desired locations in Creo). I want my reference point at a specific location on my model so that I can measure the position (x, y, z). How can I ensure that all reference frames are imported correctly and set a reference point at a specific location?I have imported a Creo model via the multibody link to Simscape. When I open the model in Mechanics Explorer, the model itself has been imported correctly, but not all the reference frames are imported (I set reference frames at the desired locations in Creo). I want my reference point at a specific location on my model so that I can measure the position (x, y, z). How can I ensure that all reference frames are imported correctly and set a reference point at a specific location? I have imported a Creo model via the multibody link to Simscape. When I open the model in Mechanics Explorer, the model itself has been imported correctly, but not all the reference frames are imported (I set reference frames at the desired locations in Creo). I want my reference point at a specific location on my model so that I can measure the position (x, y, z). How can I ensure that all reference frames are imported correctly and set a reference point at a specific location? multibody link MATLAB Answers — New Questions
How to perform definite integration with non-commutable symbolic coefficients?
Hi All,
I am trying to perform a definite integration in X (length axis) to calculate some beam modeshapes, following this the variables will be passed into a time integration using ode45. In the integration there are beam modeshape terms (W) which are a function of x and there are time dependent terms (qw) which are not. Crucially the qw terms are not commutable so cannot be factored out of the integrals. I need the answer to W6 to be given in terms W6=Y1*qw1+Y2*qw2… where Y1 and Y2 are numerical coefficients.
Here is my code:
clear all
clc
syms x qw1 qw2
L=0.52;
qw=[qw1; qw2];
%Bending Mode
Landa=[1.875104069 4.694091133];% 7.854757];% 10.99554];
for j=1:length(Landa)
SIGMA(j)=(cos(Landa(j))+cosh(Landa(j)))/(sin(Landa(j))+sinh(Landa(j)));
W(j)=cosh(Landa(j)*x/L)-cos(Landa(j)*x/L)-SIGMA(j)*(sinh(Landa(j)*x/L)-sin(Landa(j)*x/L));
end
% Integration in X over length of beam
W6=(vpaintegral(W*diff(diff(W,x,1)*qw*diff(diff(W,x,1)*qw*diff(W,x,2)*qw,x,1),x,1),0,L));
The value W6 is left as symbolic without the integrals being solved, this means that when I pass the W6 term into the time integration in a separate script and solve for qw terms the time integration is much slower because it is computing the spatial integration in X for each time of the 1000 time-steps.
I have tried using the ‘double’,’simplify’ and ‘collect’ commands but I have not been able to get the result in the form I want it. So what I’m asking is, is there a way to "force" matlab to do the integrations with the symbolic coefficients attahced. Any help would be much appreciated!Hi All,
I am trying to perform a definite integration in X (length axis) to calculate some beam modeshapes, following this the variables will be passed into a time integration using ode45. In the integration there are beam modeshape terms (W) which are a function of x and there are time dependent terms (qw) which are not. Crucially the qw terms are not commutable so cannot be factored out of the integrals. I need the answer to W6 to be given in terms W6=Y1*qw1+Y2*qw2… where Y1 and Y2 are numerical coefficients.
Here is my code:
clear all
clc
syms x qw1 qw2
L=0.52;
qw=[qw1; qw2];
%Bending Mode
Landa=[1.875104069 4.694091133];% 7.854757];% 10.99554];
for j=1:length(Landa)
SIGMA(j)=(cos(Landa(j))+cosh(Landa(j)))/(sin(Landa(j))+sinh(Landa(j)));
W(j)=cosh(Landa(j)*x/L)-cos(Landa(j)*x/L)-SIGMA(j)*(sinh(Landa(j)*x/L)-sin(Landa(j)*x/L));
end
% Integration in X over length of beam
W6=(vpaintegral(W*diff(diff(W,x,1)*qw*diff(diff(W,x,1)*qw*diff(W,x,2)*qw,x,1),x,1),0,L));
The value W6 is left as symbolic without the integrals being solved, this means that when I pass the W6 term into the time integration in a separate script and solve for qw terms the time integration is much slower because it is computing the spatial integration in X for each time of the 1000 time-steps.
I have tried using the ‘double’,’simplify’ and ‘collect’ commands but I have not been able to get the result in the form I want it. So what I’m asking is, is there a way to "force" matlab to do the integrations with the symbolic coefficients attahced. Any help would be much appreciated! Hi All,
I am trying to perform a definite integration in X (length axis) to calculate some beam modeshapes, following this the variables will be passed into a time integration using ode45. In the integration there are beam modeshape terms (W) which are a function of x and there are time dependent terms (qw) which are not. Crucially the qw terms are not commutable so cannot be factored out of the integrals. I need the answer to W6 to be given in terms W6=Y1*qw1+Y2*qw2… where Y1 and Y2 are numerical coefficients.
Here is my code:
clear all
clc
syms x qw1 qw2
L=0.52;
qw=[qw1; qw2];
%Bending Mode
Landa=[1.875104069 4.694091133];% 7.854757];% 10.99554];
for j=1:length(Landa)
SIGMA(j)=(cos(Landa(j))+cosh(Landa(j)))/(sin(Landa(j))+sinh(Landa(j)));
W(j)=cosh(Landa(j)*x/L)-cos(Landa(j)*x/L)-SIGMA(j)*(sinh(Landa(j)*x/L)-sin(Landa(j)*x/L));
end
% Integration in X over length of beam
W6=(vpaintegral(W*diff(diff(W,x,1)*qw*diff(diff(W,x,1)*qw*diff(W,x,2)*qw,x,1),x,1),0,L));
The value W6 is left as symbolic without the integrals being solved, this means that when I pass the W6 term into the time integration in a separate script and solve for qw terms the time integration is much slower because it is computing the spatial integration in X for each time of the 1000 time-steps.
I have tried using the ‘double’,’simplify’ and ‘collect’ commands but I have not been able to get the result in the form I want it. So what I’m asking is, is there a way to "force" matlab to do the integrations with the symbolic coefficients attahced. Any help would be much appreciated! definite integration, symbolic toolbox, simplifying MATLAB Answers — New Questions