Author: PuTI
Evaluate Noise and vibration of an EV motor (PMSM)
I want to find out the Noise and vibration of an EV motor PMSM by given few input data and getting results. So what is the process in the matlab/simulink to get the resultsI want to find out the Noise and vibration of an EV motor PMSM by given few input data and getting results. So what is the process in the matlab/simulink to get the results I want to find out the Noise and vibration of an EV motor PMSM by given few input data and getting results. So what is the process in the matlab/simulink to get the results nvh of an ev motor MATLAB Answers — New Questions
Why the figure is not apearing after using plot(x) command?
Hi,
after new instalation of MATLAB 2025b my program does not use function plot properly.
After command "plot(x)" MATLAB opens new window "Figures" as usual but there is no figure.
After this line program continues execution.
I could not find the explanation jet.
Thanks!Hi,
after new instalation of MATLAB 2025b my program does not use function plot properly.
After command "plot(x)" MATLAB opens new window "Figures" as usual but there is no figure.
After this line program continues execution.
I could not find the explanation jet.
Thanks! Hi,
after new instalation of MATLAB 2025b my program does not use function plot properly.
After command "plot(x)" MATLAB opens new window "Figures" as usual but there is no figure.
After this line program continues execution.
I could not find the explanation jet.
Thanks! plot, figures MATLAB Answers — New Questions
Stateflow transition does not work when using output bus field
Hello together,
I am facing a strange behaviour of my Simulink model. That model is comprised of a Simscape subsystem and a Stateflow subsystem. The latter is used to controll the operation mode of the Simscape model.
For a clear data transfer I implemented several data buses as Stateflow inputs and outputs. For that, I created the necessary Simulink Bus Objects and it works fine so far. But when I want to use one field of the Getoperationdata bus to describe the transition condition, the transition is not exceeded despite the condition is true (as shown in the figure below). The state Empty_Pump_Chamber remains active but should switch to Empty_Complete.
The Getoperationdata bus is implemented as an output bus. When defining a transition condition with a variable from another input bus, the model succeeds. Very strange. Even when I define a local variable, set this variable equal to Getoperationaldata.emptyComplete2 and use this new variable to state the transition condition, the model succeeds. Very strange! What is wrong?
Kind Regards!Hello together,
I am facing a strange behaviour of my Simulink model. That model is comprised of a Simscape subsystem and a Stateflow subsystem. The latter is used to controll the operation mode of the Simscape model.
For a clear data transfer I implemented several data buses as Stateflow inputs and outputs. For that, I created the necessary Simulink Bus Objects and it works fine so far. But when I want to use one field of the Getoperationdata bus to describe the transition condition, the transition is not exceeded despite the condition is true (as shown in the figure below). The state Empty_Pump_Chamber remains active but should switch to Empty_Complete.
The Getoperationdata bus is implemented as an output bus. When defining a transition condition with a variable from another input bus, the model succeeds. Very strange. Even when I define a local variable, set this variable equal to Getoperationaldata.emptyComplete2 and use this new variable to state the transition condition, the model succeeds. Very strange! What is wrong?
Kind Regards! Hello together,
I am facing a strange behaviour of my Simulink model. That model is comprised of a Simscape subsystem and a Stateflow subsystem. The latter is used to controll the operation mode of the Simscape model.
For a clear data transfer I implemented several data buses as Stateflow inputs and outputs. For that, I created the necessary Simulink Bus Objects and it works fine so far. But when I want to use one field of the Getoperationdata bus to describe the transition condition, the transition is not exceeded despite the condition is true (as shown in the figure below). The state Empty_Pump_Chamber remains active but should switch to Empty_Complete.
The Getoperationdata bus is implemented as an output bus. When defining a transition condition with a variable from another input bus, the model succeeds. Very strange. Even when I define a local variable, set this variable equal to Getoperationaldata.emptyComplete2 and use this new variable to state the transition condition, the model succeeds. Very strange! What is wrong?
Kind Regards! simulink bus object, transition MATLAB Answers — New Questions
Only version 2026a appears available for download as a trial. I want version 2025b
Only version 2026a appears available for download as a trial.
I want version 2025b, but it does not appear as an option at https://www.mathworks.com/downloads/web_downloads/13799194.Only version 2026a appears available for download as a trial.
I want version 2025b, but it does not appear as an option at https://www.mathworks.com/downloads/web_downloads/13799194. Only version 2026a appears available for download as a trial.
I want version 2025b, but it does not appear as an option at https://www.mathworks.com/downloads/web_downloads/13799194. r2025a MATLAB Answers — New Questions
I can’t able to see the orange, gray, red or green checks. Instead I can see only the code metrics.
I’m facing the issue i.e., I’m running the polyspace code prover throught the commend prompt. I used all the configuration in the option.txt file. Through that option.txt file i’m start compling by using this cmd ("C:Program FilesPOLYSPACER2023apolyspacebinpolyspace-code-prover" ^ -options-file Options.txt ^ -scheduler CHE6-SV00106 ^ -results-dir "C:UsersaallimutDocumentsSWEET500cb1146_vcore_main_devResult"). Compliation is done sucessfully and the code is pushed to the server. After successful complition of run I Checked the result, It’s only showing the code metrix, not showing any checks in the dashboard.I’m facing the issue i.e., I’m running the polyspace code prover throught the commend prompt. I used all the configuration in the option.txt file. Through that option.txt file i’m start compling by using this cmd ("C:Program FilesPOLYSPACER2023apolyspacebinpolyspace-code-prover" ^ -options-file Options.txt ^ -scheduler CHE6-SV00106 ^ -results-dir "C:UsersaallimutDocumentsSWEET500cb1146_vcore_main_devResult"). Compliation is done sucessfully and the code is pushed to the server. After successful complition of run I Checked the result, It’s only showing the code metrix, not showing any checks in the dashboard. I’m facing the issue i.e., I’m running the polyspace code prover throught the commend prompt. I used all the configuration in the option.txt file. Through that option.txt file i’m start compling by using this cmd ("C:Program FilesPOLYSPACER2023apolyspacebinpolyspace-code-prover" ^ -options-file Options.txt ^ -scheduler CHE6-SV00106 ^ -results-dir "C:UsersaallimutDocumentsSWEET500cb1146_vcore_main_devResult"). Compliation is done sucessfully and the code is pushed to the server. After successful complition of run I Checked the result, It’s only showing the code metrix, not showing any checks in the dashboard. no checks found MATLAB Answers — New Questions
Identifying bright spots in RGB image
I have hundreds of RGB images (one of the image is attached). For reference these are interference images and the RGB color values correspond to certain film thickness between a semi reflective glass surface and a steel surface. I apply electric potential across the surface and observed electric discharges which show as bright spots on the image (highlighted in red circle in attached image).
I want to write a script in MATLAB (2023a) that goes through the images, identify these bright spots stores there location in the XY cordinate system. The end goal is to show spatial distribution of the electric discharges.I have hundreds of RGB images (one of the image is attached). For reference these are interference images and the RGB color values correspond to certain film thickness between a semi reflective glass surface and a steel surface. I apply electric potential across the surface and observed electric discharges which show as bright spots on the image (highlighted in red circle in attached image).
I want to write a script in MATLAB (2023a) that goes through the images, identify these bright spots stores there location in the XY cordinate system. The end goal is to show spatial distribution of the electric discharges. I have hundreds of RGB images (one of the image is attached). For reference these are interference images and the RGB color values correspond to certain film thickness between a semi reflective glass surface and a steel surface. I apply electric potential across the surface and observed electric discharges which show as bright spots on the image (highlighted in red circle in attached image).
I want to write a script in MATLAB (2023a) that goes through the images, identify these bright spots stores there location in the XY cordinate system. The end goal is to show spatial distribution of the electric discharges. image analysis, image processing MATLAB Answers — New Questions
App Designer keeps adding multiple Instances of EditFields with the same name on startup
Hello Everyone!
I am having a strange problem with the app designer right now:
Every time I start the app designer and load the .mlapp-File of the Project I’m currently working on, there are multiple instances of the same EditField created. It began with only one copy of an EditField I manually added on the GUI. I didn’t think much about it and simply deleted the second instance. But it seems like this problem has grown exponentially with every start of app designer. Now, when I open up my Project 500 (!!) EditFields with the same name are created! ‘Simply’ deleting all of them is obviously not anymore an acceptable workaround – especially since ‘ctrl+a’ doesn’t work in the Component Browser and you have to selected them all manually…
I have no idea why the app designer creates these multiple instances on the startup – after I deleted all multiple instances, they also didn’t appear in the non-editable Function ‘createComponents(app)’ anymore.
Does anyone of you have an idea on that? Where in my code could be a bug causing this phenomenon? Or could this be an appdesigner-internal bug? The project itself is already quite big with ~260 components even without those multiple and unwanted EditFields…
I’m desperately looking for your help! Thanks a lot in advance.Hello Everyone!
I am having a strange problem with the app designer right now:
Every time I start the app designer and load the .mlapp-File of the Project I’m currently working on, there are multiple instances of the same EditField created. It began with only one copy of an EditField I manually added on the GUI. I didn’t think much about it and simply deleted the second instance. But it seems like this problem has grown exponentially with every start of app designer. Now, when I open up my Project 500 (!!) EditFields with the same name are created! ‘Simply’ deleting all of them is obviously not anymore an acceptable workaround – especially since ‘ctrl+a’ doesn’t work in the Component Browser and you have to selected them all manually…
I have no idea why the app designer creates these multiple instances on the startup – after I deleted all multiple instances, they also didn’t appear in the non-editable Function ‘createComponents(app)’ anymore.
Does anyone of you have an idea on that? Where in my code could be a bug causing this phenomenon? Or could this be an appdesigner-internal bug? The project itself is already quite big with ~260 components even without those multiple and unwanted EditFields…
I’m desperately looking for your help! Thanks a lot in advance. Hello Everyone!
I am having a strange problem with the app designer right now:
Every time I start the app designer and load the .mlapp-File of the Project I’m currently working on, there are multiple instances of the same EditField created. It began with only one copy of an EditField I manually added on the GUI. I didn’t think much about it and simply deleted the second instance. But it seems like this problem has grown exponentially with every start of app designer. Now, when I open up my Project 500 (!!) EditFields with the same name are created! ‘Simply’ deleting all of them is obviously not anymore an acceptable workaround – especially since ‘ctrl+a’ doesn’t work in the Component Browser and you have to selected them all manually…
I have no idea why the app designer creates these multiple instances on the startup – after I deleted all multiple instances, they also didn’t appear in the non-editable Function ‘createComponents(app)’ anymore.
Does anyone of you have an idea on that? Where in my code could be a bug causing this phenomenon? Or could this be an appdesigner-internal bug? The project itself is already quite big with ~260 components even without those multiple and unwanted EditFields…
I’m desperately looking for your help! Thanks a lot in advance. appdesigner, gui MATLAB Answers — New Questions
Can different sample times be used for fair torque ripple comparison?
Hello,
I am comparing two control strategies: one with fixed switching frequency and another with variable switching frequency.
Is it acceptable to use different powergui or sample times for each method so that both operate at a similar switching frequency range before comparing torque ripple?
Or should the same sample time always be used for both methods, even if their switching frequencies become very different?
Thank you.Hello,
I am comparing two control strategies: one with fixed switching frequency and another with variable switching frequency.
Is it acceptable to use different powergui or sample times for each method so that both operate at a similar switching frequency range before comparing torque ripple?
Or should the same sample time always be used for both methods, even if their switching frequencies become very different?
Thank you. Hello,
I am comparing two control strategies: one with fixed switching frequency and another with variable switching frequency.
Is it acceptable to use different powergui or sample times for each method so that both operate at a similar switching frequency range before comparing torque ripple?
Or should the same sample time always be used for both methods, even if their switching frequencies become very different?
Thank you. powergui, simulink, sample time, switching frequency MATLAB Answers — New Questions
Axis not held using hold command in plot3
I need to plot 2 3d points: x1, y1, z1 and x2, y2, z2 on the same axis. When using plot3 I only get the second marker while using plot3 for each point. When using one command for both points I get only one marker.I need to plot 2 3d points: x1, y1, z1 and x2, y2, z2 on the same axis. When using plot3 I only get the second marker while using plot3 for each point. When using one command for both points I get only one marker. I need to plot 2 3d points: x1, y1, z1 and x2, y2, z2 on the same axis. When using plot3 I only get the second marker while using plot3 for each point. When using one command for both points I get only one marker. hold, plot3 MATLAB Answers — New Questions
textscatter example, and behavior, is mysterious
The code for the textscatter example at
textscatter – 2-D scatter plot of text – MATLAB
looks like it should produce text at those random points. Instead the figure there shows some text in unusual places, some points that dont belong to any specific label, and in general, the whole thing is mysterious.The code for the textscatter example at
textscatter – 2-D scatter plot of text – MATLAB
looks like it should produce text at those random points. Instead the figure there shows some text in unusual places, some points that dont belong to any specific label, and in general, the whole thing is mysterious. The code for the textscatter example at
textscatter – 2-D scatter plot of text – MATLAB
looks like it should produce text at those random points. Instead the figure there shows some text in unusual places, some points that dont belong to any specific label, and in general, the whole thing is mysterious. textscatter MATLAB Answers — New Questions
Signal logging for evaluation episode during RL training
I am training a DDPG agent using a simulink environment. I want to log the last (final) value of a specific signal for every evaluation episode, e.g., if there are 10 evaluation episodes then I will have 10 values, possibly in the form of an array. The agent is unaware of this signal. How can I do this?I am training a DDPG agent using a simulink environment. I want to log the last (final) value of a specific signal for every evaluation episode, e.g., if there are 10 evaluation episodes then I will have 10 values, possibly in the form of an array. The agent is unaware of this signal. How can I do this? I am training a DDPG agent using a simulink environment. I want to log the last (final) value of a specific signal for every evaluation episode, e.g., if there are 10 evaluation episodes then I will have 10 values, possibly in the form of an array. The agent is unaware of this signal. How can I do this? simulink, reinforcement learning MATLAB Answers — New Questions
Can you get matlab to add a really small number to a big number and retain precision
I am trying to calculate small numbers from equations like the one below.
p = -1e17 + sqrt(1e34 + 1e18)
I have tried using ‘vpa(-1e17 + sqrt(1e34 + 1e18), 30) but the output always comes out as p = 0.0. But p is not exactly zero and this propagates errors in subsequent calculations that involve p. Is there another way to retain sig figs to avoid rounding errors?I am trying to calculate small numbers from equations like the one below.
p = -1e17 + sqrt(1e34 + 1e18)
I have tried using ‘vpa(-1e17 + sqrt(1e34 + 1e18), 30) but the output always comes out as p = 0.0. But p is not exactly zero and this propagates errors in subsequent calculations that involve p. Is there another way to retain sig figs to avoid rounding errors? I am trying to calculate small numbers from equations like the one below.
p = -1e17 + sqrt(1e34 + 1e18)
I have tried using ‘vpa(-1e17 + sqrt(1e34 + 1e18), 30) but the output always comes out as p = 0.0. But p is not exactly zero and this propagates errors in subsequent calculations that involve p. Is there another way to retain sig figs to avoid rounding errors? precision, digits MATLAB Answers — New Questions
Why in 2025a figure Export Setup have been removed?
Good morning to everyone,
I have just bought a new laptop, downloaded 2025a, opened a figure I created with 2024b and BOOM I realized (with great regret!) that the "Figure Export Setup" have been removed…
In my academic and professional experience it was an essential feature to produce figures and plots in line with the specific request (journal article, technical report, presentation etc..) and coherent throughout the work for whant concerns font size, figure dimensions and features.
I know that now there’s the "uiexportdlg" https://www.mathworks.com/help/releases/R2025a/matlab/ref/uiexportdlg.html but, in my humble opinion, there is no comparison at all. Is there a way to be able to save profiles for the export of figures as was done in the old “File” > “Export Setup” mode? And, above all, does anyone know the reason why this feature was removed? I simply can’t get the point about it.
I’m not the reactionary kind of software users, but I’m seriously thinking about switching back to 2024b.Good morning to everyone,
I have just bought a new laptop, downloaded 2025a, opened a figure I created with 2024b and BOOM I realized (with great regret!) that the "Figure Export Setup" have been removed…
In my academic and professional experience it was an essential feature to produce figures and plots in line with the specific request (journal article, technical report, presentation etc..) and coherent throughout the work for whant concerns font size, figure dimensions and features.
I know that now there’s the "uiexportdlg" https://www.mathworks.com/help/releases/R2025a/matlab/ref/uiexportdlg.html but, in my humble opinion, there is no comparison at all. Is there a way to be able to save profiles for the export of figures as was done in the old “File” > “Export Setup” mode? And, above all, does anyone know the reason why this feature was removed? I simply can’t get the point about it.
I’m not the reactionary kind of software users, but I’m seriously thinking about switching back to 2024b. Good morning to everyone,
I have just bought a new laptop, downloaded 2025a, opened a figure I created with 2024b and BOOM I realized (with great regret!) that the "Figure Export Setup" have been removed…
In my academic and professional experience it was an essential feature to produce figures and plots in line with the specific request (journal article, technical report, presentation etc..) and coherent throughout the work for whant concerns font size, figure dimensions and features.
I know that now there’s the "uiexportdlg" https://www.mathworks.com/help/releases/R2025a/matlab/ref/uiexportdlg.html but, in my humble opinion, there is no comparison at all. Is there a way to be able to save profiles for the export of figures as was done in the old “File” > “Export Setup” mode? And, above all, does anyone know the reason why this feature was removed? I simply can’t get the point about it.
I’m not the reactionary kind of software users, but I’m seriously thinking about switching back to 2024b. figure export setup MATLAB Answers — New Questions
computation of symbolic terms and error analysis
tic
syms x y m %alpha beta b lambda eta phi
phi=sqrt(0.5)
b=10
eta=1
alpha=2;
beta=1;
T=zeros(1,2,’sym’);
G=zeros(1,2,’sym’);
A=zeros(1,’sym’);
B=zeros(1,’sym’);
C=zeros(1,’sym’);
D=zeros(1,’sym’);
E=zeros(1,’sym’);
F=zeros(1,’sym’);
G_val=zeros(1,’sym’);
series(x)=sym(zeros(1,1));
series1(x)=sym(zeros(1,1));
% Transform Initial condition
T(1)=m;
T(2)=0;
% Initial transform value of exp function
for i=1:4
G(i)=y;
if i==1
E(1)=exp((eta*T(1))/(eta+T(1)));
else
A(1)=0;
for j=1:i-1
E(i)=A(1)+(j/(i-1))*G(j)*E(i-j);
end
B(1)=0;
for j=1:i
B(1)=B(1)+T(j)*G(i-j+1);
end
eq1=G(i)-T(i)+(1/eta)*B(1);
G_val=simplify(solve(eq1,y));
G(i)=simplify(G_val);
E_val=subs(E(i),y,G_val);
E(i)=E_val
end
C(1)=0
for r=1:i
C(1)=C(1)+T(r)*E(i-r+1);
end
T(i + alpha*beta) = (phi^2*C(1)-b*phi^2*E(i))*(gamma(1+(sym(i-1)/beta))/gamma(1+alpha+(sym(i-1)/beta)));
%T(i+2)=simplify((1/(i*(i+1)))*(phi^2*C(1)-b*phi^2*E(i)));
end
for k=1:3
series(x)=simplify(series(x)+T(k)*(power(x,((k-1)*beta))));
end
series
e1=subs(series,x,1);
format long
accuracy=input(‘enter the accuracy’)
f=e1(x)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c);
series1(x)=subs(series,m,c)
residualError=sym(zeros(1,1));
residual=sym(zeros(1,1));
residualError(x) = abs(diff(series1,x,2)+ B*phi^2*(1-(series1)/B)*exp((eta*series1)/(eta+series1)))
residual_error=double(subs(residualError,x,0.2))
var =double(residual_error);
x=0:0.1:1
error=zeros(1)
row=0;
for i=1:length(x)
row=row+1;
error(row)=(residualErrorx(i))
max_error=max(error)
end
fprintf(‘The residual error is %fn’, max_error);
%—————————————————————–
the error appear as Error using mupadengine/evalin2double
Unable to convert expression containing symbolic variables into double array. Apply ‘subs’ function first to substitute values for variables.
Error in mupadengine/feval2double
Error in sym/double (line 756)
X = feval2double(symengine, "symobj::doubleDirect", S);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Related documentation
now i substutite the value of m using sysntax series1(x)=subs(series,m,c) but when i later on call series 1 in line residualError(x) = abs(diff(series1,x,2)+ B*phi^2*(1-(series1)/B)*exp((eta*series1)/(eta+series1))) the final expression is having m and y . That is symbolic and craet an errortic
syms x y m %alpha beta b lambda eta phi
phi=sqrt(0.5)
b=10
eta=1
alpha=2;
beta=1;
T=zeros(1,2,’sym’);
G=zeros(1,2,’sym’);
A=zeros(1,’sym’);
B=zeros(1,’sym’);
C=zeros(1,’sym’);
D=zeros(1,’sym’);
E=zeros(1,’sym’);
F=zeros(1,’sym’);
G_val=zeros(1,’sym’);
series(x)=sym(zeros(1,1));
series1(x)=sym(zeros(1,1));
% Transform Initial condition
T(1)=m;
T(2)=0;
% Initial transform value of exp function
for i=1:4
G(i)=y;
if i==1
E(1)=exp((eta*T(1))/(eta+T(1)));
else
A(1)=0;
for j=1:i-1
E(i)=A(1)+(j/(i-1))*G(j)*E(i-j);
end
B(1)=0;
for j=1:i
B(1)=B(1)+T(j)*G(i-j+1);
end
eq1=G(i)-T(i)+(1/eta)*B(1);
G_val=simplify(solve(eq1,y));
G(i)=simplify(G_val);
E_val=subs(E(i),y,G_val);
E(i)=E_val
end
C(1)=0
for r=1:i
C(1)=C(1)+T(r)*E(i-r+1);
end
T(i + alpha*beta) = (phi^2*C(1)-b*phi^2*E(i))*(gamma(1+(sym(i-1)/beta))/gamma(1+alpha+(sym(i-1)/beta)));
%T(i+2)=simplify((1/(i*(i+1)))*(phi^2*C(1)-b*phi^2*E(i)));
end
for k=1:3
series(x)=simplify(series(x)+T(k)*(power(x,((k-1)*beta))));
end
series
e1=subs(series,x,1);
format long
accuracy=input(‘enter the accuracy’)
f=e1(x)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c);
series1(x)=subs(series,m,c)
residualError=sym(zeros(1,1));
residual=sym(zeros(1,1));
residualError(x) = abs(diff(series1,x,2)+ B*phi^2*(1-(series1)/B)*exp((eta*series1)/(eta+series1)))
residual_error=double(subs(residualError,x,0.2))
var =double(residual_error);
x=0:0.1:1
error=zeros(1)
row=0;
for i=1:length(x)
row=row+1;
error(row)=(residualErrorx(i))
max_error=max(error)
end
fprintf(‘The residual error is %fn’, max_error);
%—————————————————————–
the error appear as Error using mupadengine/evalin2double
Unable to convert expression containing symbolic variables into double array. Apply ‘subs’ function first to substitute values for variables.
Error in mupadengine/feval2double
Error in sym/double (line 756)
X = feval2double(symengine, "symobj::doubleDirect", S);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Related documentation
now i substutite the value of m using sysntax series1(x)=subs(series,m,c) but when i later on call series 1 in line residualError(x) = abs(diff(series1,x,2)+ B*phi^2*(1-(series1)/B)*exp((eta*series1)/(eta+series1))) the final expression is having m and y . That is symbolic and craet an error tic
syms x y m %alpha beta b lambda eta phi
phi=sqrt(0.5)
b=10
eta=1
alpha=2;
beta=1;
T=zeros(1,2,’sym’);
G=zeros(1,2,’sym’);
A=zeros(1,’sym’);
B=zeros(1,’sym’);
C=zeros(1,’sym’);
D=zeros(1,’sym’);
E=zeros(1,’sym’);
F=zeros(1,’sym’);
G_val=zeros(1,’sym’);
series(x)=sym(zeros(1,1));
series1(x)=sym(zeros(1,1));
% Transform Initial condition
T(1)=m;
T(2)=0;
% Initial transform value of exp function
for i=1:4
G(i)=y;
if i==1
E(1)=exp((eta*T(1))/(eta+T(1)));
else
A(1)=0;
for j=1:i-1
E(i)=A(1)+(j/(i-1))*G(j)*E(i-j);
end
B(1)=0;
for j=1:i
B(1)=B(1)+T(j)*G(i-j+1);
end
eq1=G(i)-T(i)+(1/eta)*B(1);
G_val=simplify(solve(eq1,y));
G(i)=simplify(G_val);
E_val=subs(E(i),y,G_val);
E(i)=E_val
end
C(1)=0
for r=1:i
C(1)=C(1)+T(r)*E(i-r+1);
end
T(i + alpha*beta) = (phi^2*C(1)-b*phi^2*E(i))*(gamma(1+(sym(i-1)/beta))/gamma(1+alpha+(sym(i-1)/beta)));
%T(i+2)=simplify((1/(i*(i+1)))*(phi^2*C(1)-b*phi^2*E(i)));
end
for k=1:3
series(x)=simplify(series(x)+T(k)*(power(x,((k-1)*beta))));
end
series
e1=subs(series,x,1);
format long
accuracy=input(‘enter the accuracy’)
f=e1(x)
g=inline(f)
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
while fa*fb>0
a=input(‘enter the ist approximation=’)
b=input(‘enter the 2nd approximation=’)
fa=feval(g,a)
fb=feval(g,b)
end
for i=1:50
c=(a+b)/2;
fc=feval(g,c);
disp([i a fa b fb c fc abs(b-a)])
if fc==accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif abs(b-a)<=accuracy
fprintf(‘the root of the equation is %f’,c)
break;
elseif fa*fc<=0
b=c;
fb=fc;
else
a=c;
fa=fc;
end
end
fprintf(‘the value of c=%f’, c);
series1(x)=subs(series,m,c)
residualError=sym(zeros(1,1));
residual=sym(zeros(1,1));
residualError(x) = abs(diff(series1,x,2)+ B*phi^2*(1-(series1)/B)*exp((eta*series1)/(eta+series1)))
residual_error=double(subs(residualError,x,0.2))
var =double(residual_error);
x=0:0.1:1
error=zeros(1)
row=0;
for i=1:length(x)
row=row+1;
error(row)=(residualErrorx(i))
max_error=max(error)
end
fprintf(‘The residual error is %fn’, max_error);
%—————————————————————–
the error appear as Error using mupadengine/evalin2double
Unable to convert expression containing symbolic variables into double array. Apply ‘subs’ function first to substitute values for variables.
Error in mupadengine/feval2double
Error in sym/double (line 756)
X = feval2double(symengine, "symobj::doubleDirect", S);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Related documentation
now i substutite the value of m using sysntax series1(x)=subs(series,m,c) but when i later on call series 1 in line residualError(x) = abs(diff(series1,x,2)+ B*phi^2*(1-(series1)/B)*exp((eta*series1)/(eta+series1))) the final expression is having m and y . That is symbolic and craet an error symbolic compuational MATLAB Answers — New Questions
How to build a BESS model phasor system
The examples above in MATLAB all produce BESS sets in discrete mode. I want to build a BESS set in phasor mode but don’t know how to do it because the battery block only allows running in discrete mode. I am very confused. Please help me.The examples above in MATLAB all produce BESS sets in discrete mode. I want to build a BESS set in phasor mode but don’t know how to do it because the battery block only allows running in discrete mode. I am very confused. Please help me. The examples above in MATLAB all produce BESS sets in discrete mode. I want to build a BESS set in phasor mode but don’t know how to do it because the battery block only allows running in discrete mode. I am very confused. Please help me. battery_system_management, bess phasor, battery phasor MATLAB Answers — New Questions
Phase unwrapping in 2D
I need to perform phase unwrapping in 2D using MATLAB, but the unwrap function seems to work only in 1D.
I want to have a routine similar to this one, available in a Python library:
http://scikit-image.org/docs/dev/auto_examples/filters/plot_phase_unwrap.html
Any suggestions?I need to perform phase unwrapping in 2D using MATLAB, but the unwrap function seems to work only in 1D.
I want to have a routine similar to this one, available in a Python library:
http://scikit-image.org/docs/dev/auto_examples/filters/plot_phase_unwrap.html
Any suggestions? I need to perform phase unwrapping in 2D using MATLAB, but the unwrap function seems to work only in 1D.
I want to have a routine similar to this one, available in a Python library:
http://scikit-image.org/docs/dev/auto_examples/filters/plot_phase_unwrap.html
Any suggestions? matlab, image analysis, signal processing MATLAB Answers — New Questions
Why does backslash behave differently when transposition is used in-line?
Hello, in the process of creating a problem for my students in a numerical methods class I found out that the backslash operation produces different results if you solve A^{T}x=b as "x=(A’)b" when compared to first defining "AT=A’" and then solving as "x=ATb". An example is given below. Order of operations suggests that in the first case, A should be transposed and then the backslash operation performed, which is forced in the second case. One would expect the results to then be the same. Why is there a difference at all?
n = 15;
m = 2*n+1;
t = fliplr(cos(pi/(n)*(0:n))).’;
A = [t.^(0:m);
t.^([0,0:m-1])*diag(max(0,0:m))];
b = (1./((0:m)’+1).*((1).^((0:m)’+1)-(-1).^(((0:m)’+1))));
x = (A’)b;
AT = A’;
x2 = ATb;
difference = norm(x-x2)Hello, in the process of creating a problem for my students in a numerical methods class I found out that the backslash operation produces different results if you solve A^{T}x=b as "x=(A’)b" when compared to first defining "AT=A’" and then solving as "x=ATb". An example is given below. Order of operations suggests that in the first case, A should be transposed and then the backslash operation performed, which is forced in the second case. One would expect the results to then be the same. Why is there a difference at all?
n = 15;
m = 2*n+1;
t = fliplr(cos(pi/(n)*(0:n))).’;
A = [t.^(0:m);
t.^([0,0:m-1])*diag(max(0,0:m))];
b = (1./((0:m)’+1).*((1).^((0:m)’+1)-(-1).^(((0:m)’+1))));
x = (A’)b;
AT = A’;
x2 = ATb;
difference = norm(x-x2) Hello, in the process of creating a problem for my students in a numerical methods class I found out that the backslash operation produces different results if you solve A^{T}x=b as "x=(A’)b" when compared to first defining "AT=A’" and then solving as "x=ATb". An example is given below. Order of operations suggests that in the first case, A should be transposed and then the backslash operation performed, which is forced in the second case. One would expect the results to then be the same. Why is there a difference at all?
n = 15;
m = 2*n+1;
t = fliplr(cos(pi/(n)*(0:n))).’;
A = [t.^(0:m);
t.^([0,0:m-1])*diag(max(0,0:m))];
b = (1./((0:m)’+1).*((1).^((0:m)’+1)-(-1).^(((0:m)’+1))));
x = (A’)b;
AT = A’;
x2 = ATb;
difference = norm(x-x2) backslash, transpose MATLAB Answers — New Questions
How do I create a protected model with hidden variables with a mask that provides additional variables?
How do I create a protected model with hidden variables with a mask that provides additional variables? I want to hide the variables I provide to Simulink that would otherwise appear in the base (MATLAB) workspace.How do I create a protected model with hidden variables with a mask that provides additional variables? I want to hide the variables I provide to Simulink that would otherwise appear in the base (MATLAB) workspace. How do I create a protected model with hidden variables with a mask that provides additional variables? I want to hide the variables I provide to Simulink that would otherwise appear in the base (MATLAB) workspace. parameters, mask, modelreference, protected MATLAB Answers — New Questions
Input and output process data at different rate. How to match them.
My input sends data at 100ms and output receives at 1s. how do i create a system that collects 10 intevals of data and send it to output after 1 second. I dont want to use rate transition block. I want to use basic blocks. Can someone help me with answer?My input sends data at 100ms and output receives at 1s. how do i create a system that collects 10 intevals of data and send it to output after 1 second. I dont want to use rate transition block. I want to use basic blocks. Can someone help me with answer? My input sends data at 100ms and output receives at 1s. how do i create a system that collects 10 intevals of data and send it to output after 1 second. I dont want to use rate transition block. I want to use basic blocks. Can someone help me with answer? rate transition without using rate transition bloc MATLAB Answers — New Questions
Issue running HIL converting “Design a Guidance System in MATLAB and Simulink” guidance stateflow into HDL using HDL Coder
After set all the data into int16, by using HDL coder advisor i got this error message:
"Error:Error: HDL code generation from Stateflow failed: Entry event for state ‘Target_Search’ implied in ‘aero_guidance_model/Guidance/subsystem/Guidance Processor’. This is not allowed for an HDL target.
HDL code generation failed for ‘Guidance/subsystem/Guidance Processor’ (#59). Consult the Diagnostic Viewer for additional information."
Is it possible to convert the stateflow inside guidance subsystem into HDL for running hardware in the loop? Needing advice to call a stop or continue if its possible.
Example can be obtained https://www.mathworks.com/help/simulink/slref/designing-a-guidance-system-in-matlab-and-simulink.htmlAfter set all the data into int16, by using HDL coder advisor i got this error message:
"Error:Error: HDL code generation from Stateflow failed: Entry event for state ‘Target_Search’ implied in ‘aero_guidance_model/Guidance/subsystem/Guidance Processor’. This is not allowed for an HDL target.
HDL code generation failed for ‘Guidance/subsystem/Guidance Processor’ (#59). Consult the Diagnostic Viewer for additional information."
Is it possible to convert the stateflow inside guidance subsystem into HDL for running hardware in the loop? Needing advice to call a stop or continue if its possible.
Example can be obtained https://www.mathworks.com/help/simulink/slref/designing-a-guidance-system-in-matlab-and-simulink.html After set all the data into int16, by using HDL coder advisor i got this error message:
"Error:Error: HDL code generation from Stateflow failed: Entry event for state ‘Target_Search’ implied in ‘aero_guidance_model/Guidance/subsystem/Guidance Processor’. This is not allowed for an HDL target.
HDL code generation failed for ‘Guidance/subsystem/Guidance Processor’ (#59). Consult the Diagnostic Viewer for additional information."
Is it possible to convert the stateflow inside guidance subsystem into HDL for running hardware in the loop? Needing advice to call a stop or continue if its possible.
Example can be obtained https://www.mathworks.com/help/simulink/slref/designing-a-guidance-system-in-matlab-and-simulink.html hdl coder, hardware-in-the-loop MATLAB Answers — New Questions









