Tag Archives: matlab
Output of system function in Linux
Dear all,
I would like to execute the following system command
[~, res] = system([‘TERM=xterm git -c color.ui=false show –pretty="%cd"’])
to get some information about git. However, the result looks like this
‘�[?1h�=
Wed Mar 8 12:19:18 2017 +0200�[m
�[m
�[K�[?1l�>’
I would like to get rid of these escape characters starting with square brackets. I already disabled the colouring of the output, because I suspected this to be responsible, but that didn’t seem to be the problem. Does it make sense to select a different type of terminal? Or is this maybe some kind of conversion problem?
Thanks!Dear all,
I would like to execute the following system command
[~, res] = system([‘TERM=xterm git -c color.ui=false show –pretty="%cd"’])
to get some information about git. However, the result looks like this
‘�[?1h�=
Wed Mar 8 12:19:18 2017 +0200�[m
�[m
�[K�[?1l�>’
I would like to get rid of these escape characters starting with square brackets. I already disabled the colouring of the output, because I suspected this to be responsible, but that didn’t seem to be the problem. Does it make sense to select a different type of terminal? Or is this maybe some kind of conversion problem?
Thanks! Dear all,
I would like to execute the following system command
[~, res] = system([‘TERM=xterm git -c color.ui=false show –pretty="%cd"’])
to get some information about git. However, the result looks like this
‘�[?1h�=
Wed Mar 8 12:19:18 2017 +0200�[m
�[m
�[K�[?1l�>’
I would like to get rid of these escape characters starting with square brackets. I already disabled the colouring of the output, because I suspected this to be responsible, but that didn’t seem to be the problem. Does it make sense to select a different type of terminal? Or is this maybe some kind of conversion problem?
Thanks! system, linux, git MATLAB Answers — New Questions
Why is the FPGA image for UHD different?
Hello,
I am using Matlab 2024A – update 4 with Communications Toolbox for UHD (B210 hardware). I noticed that the FPGA image download for the B210-UHD is different. What is the difference between the UHD image from Ettus and the Mathworks FPGA image?
Here is the line from my Matlab session.
linux; GNU C++ version 10.3.0; Boost_107800; UHD_4.2.0.0-vendor
UHD_4.2.0.0-vendor seems unique to Mathworks, is this correct?Hello,
I am using Matlab 2024A – update 4 with Communications Toolbox for UHD (B210 hardware). I noticed that the FPGA image download for the B210-UHD is different. What is the difference between the UHD image from Ettus and the Mathworks FPGA image?
Here is the line from my Matlab session.
linux; GNU C++ version 10.3.0; Boost_107800; UHD_4.2.0.0-vendor
UHD_4.2.0.0-vendor seems unique to Mathworks, is this correct? Hello,
I am using Matlab 2024A – update 4 with Communications Toolbox for UHD (B210 hardware). I noticed that the FPGA image download for the B210-UHD is different. What is the difference between the UHD image from Ettus and the Mathworks FPGA image?
Here is the line from my Matlab session.
linux; GNU C++ version 10.3.0; Boost_107800; UHD_4.2.0.0-vendor
UHD_4.2.0.0-vendor seems unique to Mathworks, is this correct? uhd, fpga MATLAB Answers — New Questions
Solving a system of ODEs whose coefficients are piecewise functions
I try to plot the solution of a system of ODE, on [-10,10], for the initial data [0.001 0.001], using the function:
function dwdt=systode(t,w)
if 0< t<1
f = t*(3-2*t);
if -1<t< 0
f=t*(3+2*t);
else
f = 1/t;
end;
if 0< t <1
h=4*t^4-12*t^3+9*t^2-4*t+3;
if -1< t < 0
h=4*t^4+12*t^3+9*t^2+4*t+3;
else
h=0;
end;
beta=0.5+exp(-abs(t));
dwdt=zeros(2,1);
dwdt(1)=-f*w(1)+w(2);
dwdt(2)=-beta*w(1)-f*w(2)+h*w(1)-f*w(1)^2;
end
The coefficients f(t) and g(t) are piecewise functions as follows.
With the commands
tspan = [-10 10];
z0=[0.001 0.001];
[t,z] = ode45(@(t,z) systode(t,z), tspan, z0);
figure
plot(t,z(:,1),’r’);
I get the message
tspan = [-10 10];
↑
Error: Invalid use of operator.
Where could be the mistake? I am also not sure that I defined correctly the functions f, h, .I try to plot the solution of a system of ODE, on [-10,10], for the initial data [0.001 0.001], using the function:
function dwdt=systode(t,w)
if 0< t<1
f = t*(3-2*t);
if -1<t< 0
f=t*(3+2*t);
else
f = 1/t;
end;
if 0< t <1
h=4*t^4-12*t^3+9*t^2-4*t+3;
if -1< t < 0
h=4*t^4+12*t^3+9*t^2+4*t+3;
else
h=0;
end;
beta=0.5+exp(-abs(t));
dwdt=zeros(2,1);
dwdt(1)=-f*w(1)+w(2);
dwdt(2)=-beta*w(1)-f*w(2)+h*w(1)-f*w(1)^2;
end
The coefficients f(t) and g(t) are piecewise functions as follows.
With the commands
tspan = [-10 10];
z0=[0.001 0.001];
[t,z] = ode45(@(t,z) systode(t,z), tspan, z0);
figure
plot(t,z(:,1),’r’);
I get the message
tspan = [-10 10];
↑
Error: Invalid use of operator.
Where could be the mistake? I am also not sure that I defined correctly the functions f, h, . I try to plot the solution of a system of ODE, on [-10,10], for the initial data [0.001 0.001], using the function:
function dwdt=systode(t,w)
if 0< t<1
f = t*(3-2*t);
if -1<t< 0
f=t*(3+2*t);
else
f = 1/t;
end;
if 0< t <1
h=4*t^4-12*t^3+9*t^2-4*t+3;
if -1< t < 0
h=4*t^4+12*t^3+9*t^2+4*t+3;
else
h=0;
end;
beta=0.5+exp(-abs(t));
dwdt=zeros(2,1);
dwdt(1)=-f*w(1)+w(2);
dwdt(2)=-beta*w(1)-f*w(2)+h*w(1)-f*w(1)^2;
end
The coefficients f(t) and g(t) are piecewise functions as follows.
With the commands
tspan = [-10 10];
z0=[0.001 0.001];
[t,z] = ode45(@(t,z) systode(t,z), tspan, z0);
figure
plot(t,z(:,1),’r’);
I get the message
tspan = [-10 10];
↑
Error: Invalid use of operator.
Where could be the mistake? I am also not sure that I defined correctly the functions f, h, . ode45 MATLAB Answers — New Questions