Tag Archives: matlab
vcredist_x86.exe cannot be found
I’m receiving the following error that prevents MATLAB R2010a (x64) from starting:
=========
*Windows cannot find ‘C:Program FilesMATLABR2010abinwin32vcredist_x86.exe’. Make sure you typed the name correctly, and then try again.*
=========
I have noticed that it happens when Windows Update detects that there are updates available for Windows. I doesn’t install them, just detects that they exists.
The running instances of matlab continue running without any error but I cannot start further instances. Even if I quit from all the running Matlab instances and try to start a new instance the error persist. The only way around this I found is to restart the computer. However, I am fed up of that. WTF is going on here?
I’m using Windows 7 Pro x64I’m receiving the following error that prevents MATLAB R2010a (x64) from starting:
=========
*Windows cannot find ‘C:Program FilesMATLABR2010abinwin32vcredist_x86.exe’. Make sure you typed the name correctly, and then try again.*
=========
I have noticed that it happens when Windows Update detects that there are updates available for Windows. I doesn’t install them, just detects that they exists.
The running instances of matlab continue running without any error but I cannot start further instances. Even if I quit from all the running Matlab instances and try to start a new instance the error persist. The only way around this I found is to restart the computer. However, I am fed up of that. WTF is going on here?
I’m using Windows 7 Pro x64 I’m receiving the following error that prevents MATLAB R2010a (x64) from starting:
=========
*Windows cannot find ‘C:Program FilesMATLABR2010abinwin32vcredist_x86.exe’. Make sure you typed the name correctly, and then try again.*
=========
I have noticed that it happens when Windows Update detects that there are updates available for Windows. I doesn’t install them, just detects that they exists.
The running instances of matlab continue running without any error but I cannot start further instances. Even if I quit from all the running Matlab instances and try to start a new instance the error persist. The only way around this I found is to restart the computer. However, I am fed up of that. WTF is going on here?
I’m using Windows 7 Pro x64 MATLAB Answers — New Questions
How to use for loop for iterations.
for i=1:3
a=rand(3,1);
b=5.*(a.^2);
c=[a b]
end
At the end i get a value of c that is of the order of 3×2, that is the final value that comes after3rd iteration. So value of c gets changed in each iteration.
How I can get all value of c of the loop.
In other words i want to get c of the order 9×2 (3 iterations and three values for each iteration).for i=1:3
a=rand(3,1);
b=5.*(a.^2);
c=[a b]
end
At the end i get a value of c that is of the order of 3×2, that is the final value that comes after3rd iteration. So value of c gets changed in each iteration.
How I can get all value of c of the loop.
In other words i want to get c of the order 9×2 (3 iterations and three values for each iteration). for i=1:3
a=rand(3,1);
b=5.*(a.^2);
c=[a b]
end
At the end i get a value of c that is of the order of 3×2, that is the final value that comes after3rd iteration. So value of c gets changed in each iteration.
How I can get all value of c of the loop.
In other words i want to get c of the order 9×2 (3 iterations and three values for each iteration). for loop, iteration MATLAB Answers — New Questions
linsolve behaviour for SYM true and POSDEF false
Does linsolve use an LDL factoring if the options are SYM true and POSDEF false?Does linsolve use an LDL factoring if the options are SYM true and POSDEF false? Does linsolve use an LDL factoring if the options are SYM true and POSDEF false? linsolve behaviour MATLAB Answers — New Questions
Hello can anyone give me the codes for text to speech conversion and also speech recognition thank you
Need matlab code for text to speech conversion and speech recognitionNeed matlab code for text to speech conversion and speech recognition Need matlab code for text to speech conversion and speech recognition text to speech, speech recognition MATLAB Answers — New Questions
How can I fix the error that says “Unable to create a valid geometry. More than two triangles of the input triangulation share the same edge.”?
Appears when importing 3D models using the PDE toolboxAppears when importing 3D models using the PDE toolbox Appears when importing 3D models using the PDE toolbox model import MATLAB Answers — New Questions
Error:Invalid workspace variable specified as workspace input in ‘HW02_2024_SimulinkModel/From Workspace’. Time values must be non-decreasing.
Error:Invalid workspace variable specified as workspace input in ‘HW02_2024_SimulinkModel/From Workspace’. Time values must be non-decreasing. I am importing a array having values of vel and time the matriz i am importing is of [6001×2] double type.Error:Invalid workspace variable specified as workspace input in ‘HW02_2024_SimulinkModel/From Workspace’. Time values must be non-decreasing. I am importing a array having values of vel and time the matriz i am importing is of [6001×2] double type. Error:Invalid workspace variable specified as workspace input in ‘HW02_2024_SimulinkModel/From Workspace’. Time values must be non-decreasing. I am importing a array having values of vel and time the matriz i am importing is of [6001×2] double type. array, model, matlab, simulink MATLAB Answers — New Questions
LSTM model predicts wrong values?
Hello, Im trying machine learning with LSTM and unsupervised learning.
Here is trained LSTM network, and I checked this model works.
numHiddenUnits = 100;
Layers = [ …
sequenceInputLayer(1, Normalization="zscore")
lstmLayer(numHiddenUnits,’OutputMode’,’sequence’)
swishLayer
fullyConnectedLayer(1)
myRegressionLayer(‘mae’)
];
options = trainingOptions(‘adam’, …
‘MaxEpochs’,40,…
‘MiniBatchSize’,32,…
‘GradientThreshold’,1,…
‘InitialLearnRate’,1e-2, …
‘Verbose’,false, …
‘Plots’, ‘none’);
%XTrain is (n*t sequence data)
%YTrain is (n*t sequence data)
[net, ~] = trainNetwork(XTrain, YTrain, Layers, options);
However, if the model predicts values with inputs in other environment,
%XTrain2 is (n*t sequence data in different environment from XTrain and YTrain environment for unsupervised learning)
dist = predict(net, XTrain2);
only head of sequence of output is lower than others as shown below.
Here is input data, and it doesn’t seem that there are differents of value between head of sequence and other parts.
In comparison with true data, this head of sequence of output is wrong value, and other sequence parts are comparatively correct values.
I’m sorry for my poor English. Can anyone help me what to do? Thank you.Hello, Im trying machine learning with LSTM and unsupervised learning.
Here is trained LSTM network, and I checked this model works.
numHiddenUnits = 100;
Layers = [ …
sequenceInputLayer(1, Normalization="zscore")
lstmLayer(numHiddenUnits,’OutputMode’,’sequence’)
swishLayer
fullyConnectedLayer(1)
myRegressionLayer(‘mae’)
];
options = trainingOptions(‘adam’, …
‘MaxEpochs’,40,…
‘MiniBatchSize’,32,…
‘GradientThreshold’,1,…
‘InitialLearnRate’,1e-2, …
‘Verbose’,false, …
‘Plots’, ‘none’);
%XTrain is (n*t sequence data)
%YTrain is (n*t sequence data)
[net, ~] = trainNetwork(XTrain, YTrain, Layers, options);
However, if the model predicts values with inputs in other environment,
%XTrain2 is (n*t sequence data in different environment from XTrain and YTrain environment for unsupervised learning)
dist = predict(net, XTrain2);
only head of sequence of output is lower than others as shown below.
Here is input data, and it doesn’t seem that there are differents of value between head of sequence and other parts.
In comparison with true data, this head of sequence of output is wrong value, and other sequence parts are comparatively correct values.
I’m sorry for my poor English. Can anyone help me what to do? Thank you. Hello, Im trying machine learning with LSTM and unsupervised learning.
Here is trained LSTM network, and I checked this model works.
numHiddenUnits = 100;
Layers = [ …
sequenceInputLayer(1, Normalization="zscore")
lstmLayer(numHiddenUnits,’OutputMode’,’sequence’)
swishLayer
fullyConnectedLayer(1)
myRegressionLayer(‘mae’)
];
options = trainingOptions(‘adam’, …
‘MaxEpochs’,40,…
‘MiniBatchSize’,32,…
‘GradientThreshold’,1,…
‘InitialLearnRate’,1e-2, …
‘Verbose’,false, …
‘Plots’, ‘none’);
%XTrain is (n*t sequence data)
%YTrain is (n*t sequence data)
[net, ~] = trainNetwork(XTrain, YTrain, Layers, options);
However, if the model predicts values with inputs in other environment,
%XTrain2 is (n*t sequence data in different environment from XTrain and YTrain environment for unsupervised learning)
dist = predict(net, XTrain2);
only head of sequence of output is lower than others as shown below.
Here is input data, and it doesn’t seem that there are differents of value between head of sequence and other parts.
In comparison with true data, this head of sequence of output is wrong value, and other sequence parts are comparatively correct values.
I’m sorry for my poor English. Can anyone help me what to do? Thank you. lstm, machine learning MATLAB Answers — New Questions
Can somebody solve this question. I’ve been trying for 2 hours straight. Didn’t get it yet
Find the volume of the solid generated by revolving about the x-axis the region bounded by the curve y = sqrt(x) , the x-axis, and the line y= x-2.Find the volume of the solid generated by revolving about the x-axis the region bounded by the curve y = sqrt(x) , the x-axis, and the line y= x-2. Find the volume of the solid generated by revolving about the x-axis the region bounded by the curve y = sqrt(x) , the x-axis, and the line y= x-2. volume of solid of revolution, area between curves, axis of revolution MATLAB Answers — New Questions
How can we couple MATLAB and Aspen Exchanger Design and Rating?
Dear MATLAB users,
it would be of great interest to couple MATLAB and Aspen EDR, so that at different conditions, different heat exchangers could be designed. Does anybody have experience with that? Thank you all in advance!Dear MATLAB users,
it would be of great interest to couple MATLAB and Aspen EDR, so that at different conditions, different heat exchangers could be designed. Does anybody have experience with that? Thank you all in advance! Dear MATLAB users,
it would be of great interest to couple MATLAB and Aspen EDR, so that at different conditions, different heat exchangers could be designed. Does anybody have experience with that? Thank you all in advance! aspen edr, heat exchanger design MATLAB Answers — New Questions
I can’t get engine instance when I run my java program by window service
My software system is developed using Java. One function of the program is to send variables to the MATLAB window. When I run my Java program in the development environment or command-line window, it works well and sends variables correctly to the MATLAB window. But when I start my system with a window operating system service or scheduled task, variables cannot be sent to the MATLAB window. I carefully checked and found that when running my software program using the window service, I cannot retrieve the engine instance currently running in the MATLAB window.My software system is developed using Java. One function of the program is to send variables to the MATLAB window. When I run my Java program in the development environment or command-line window, it works well and sends variables correctly to the MATLAB window. But when I start my system with a window operating system service or scheduled task, variables cannot be sent to the MATLAB window. I carefully checked and found that when running my software program using the window service, I cannot retrieve the engine instance currently running in the MATLAB window. My software system is developed using Java. One function of the program is to send variables to the MATLAB window. When I run my Java program in the development environment or command-line window, it works well and sends variables correctly to the MATLAB window. But when I start my system with a window operating system service or scheduled task, variables cannot be sent to the MATLAB window. I carefully checked and found that when running my software program using the window service, I cannot retrieve the engine instance currently running in the MATLAB window. engine, window service MATLAB Answers — New Questions
How to get a and b using fit(x,y,power1)
I have XY data and fit it with y=ax^b. I use f = fit(x,y,power1) but don’t know how to get "a" and "b" to continue working with them. f(1) gives a, [a,b] = fit(x,y,power1) doesn’t help also.I have XY data and fit it with y=ax^b. I use f = fit(x,y,power1) but don’t know how to get "a" and "b" to continue working with them. f(1) gives a, [a,b] = fit(x,y,power1) doesn’t help also. I have XY data and fit it with y=ax^b. I use f = fit(x,y,power1) but don’t know how to get "a" and "b" to continue working with them. f(1) gives a, [a,b] = fit(x,y,power1) doesn’t help also. curve fitting toolbox MATLAB Answers — New Questions
When I run Matlab on Ubuntu 20.04.1 and load Matlab project, Matlab crashes
WHen I launch Matlab with terminal command, it shows some failure. I don’t know if they are relevant to the issue?
MATLAB is selecting SOFTWARE OPENGL rendering.
MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: iris
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load swrast driverWHen I launch Matlab with terminal command, it shows some failure. I don’t know if they are relevant to the issue?
MATLAB is selecting SOFTWARE OPENGL rendering.
MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: iris
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load swrast driver WHen I launch Matlab with terminal command, it shows some failure. I don’t know if they are relevant to the issue?
MATLAB is selecting SOFTWARE OPENGL rendering.
MESA-LOADER: failed to open iris: /usr/lib/dri/iris_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: iris
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/x86_64-linux-gnu/dri:$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load swrast driver #matlab, #ubuntu MATLAB Answers — New Questions
Dot indexing is not supported for variables of this type.
I get this error while running the code.
Dot indexing is not supported for variables of this type.
Error in Fun_Objective (line 23)
Conv = Aspen.Tree.FindNode("DataResults SummaryRun-StatusOutputPER_ERROR").Value; %Convergence
I am getting an error suddenly after certain interations ( sometimes 1/5/20 iterations) that dot indexing not supported in the statement above. When I go and check the aspen file it just shows required input complete, but does not run. At the start I have reinit the code and I do run the engine, but it still shows required input complete, and the simulation does not run. Does anyone face a similar problem like this?I get this error while running the code.
Dot indexing is not supported for variables of this type.
Error in Fun_Objective (line 23)
Conv = Aspen.Tree.FindNode("DataResults SummaryRun-StatusOutputPER_ERROR").Value; %Convergence
I am getting an error suddenly after certain interations ( sometimes 1/5/20 iterations) that dot indexing not supported in the statement above. When I go and check the aspen file it just shows required input complete, but does not run. At the start I have reinit the code and I do run the engine, but it still shows required input complete, and the simulation does not run. Does anyone face a similar problem like this? I get this error while running the code.
Dot indexing is not supported for variables of this type.
Error in Fun_Objective (line 23)
Conv = Aspen.Tree.FindNode("DataResults SummaryRun-StatusOutputPER_ERROR").Value; %Convergence
I am getting an error suddenly after certain interations ( sometimes 1/5/20 iterations) that dot indexing not supported in the statement above. When I go and check the aspen file it just shows required input complete, but does not run. At the start I have reinit the code and I do run the engine, but it still shows required input complete, and the simulation does not run. Does anyone face a similar problem like this? matlab, aspen, tac, ga MATLAB Answers — New Questions
need data about tach signal?
greetings !!
I want to know about tach signal(like signal from tachometer) in MATLAB and its generation in matlab like attached image(Might be aperiodic).. And i want to add some Gaussian noise to that signal to find frequency b/w peeks.
I tried using "pulse train" but not getting as i like..greetings !!
I want to know about tach signal(like signal from tachometer) in MATLAB and its generation in matlab like attached image(Might be aperiodic).. And i want to add some Gaussian noise to that signal to find frequency b/w peeks.
I tried using "pulse train" but not getting as i like.. greetings !!
I want to know about tach signal(like signal from tachometer) in MATLAB and its generation in matlab like attached image(Might be aperiodic).. And i want to add some Gaussian noise to that signal to find frequency b/w peeks.
I tried using "pulse train" but not getting as i like.. signal generation, pulse generation, tach signal MATLAB Answers — New Questions
Full screen figure with xticklabels multiline problem
Hi,
Short decription of what I need:
full screean figure of some bars
xticklabels multiline
What is wrong?
the text of xtickslabels is not fully displaying (down part is cut, not depends on the xtickangle)
no space between the text of xticklabels and the axis
figure(‘units’,’normalized’,’outerposition’,[0 0 1 1]);
set(gcf,’Visible’, ‘off’);
bar(1,CO2_o(1),’FaceColor’,’#572280′);
hold on
bar(2,CO2_o(2),’FaceColor’,’#953FBA’)
hold on
bar(3,CO2_o(3),’FaceColor’,’#A279CB’);
hold on
bar(4,CO2_o(4),’FaceColor’,’#D7B3FA’)
hold on
bar(5,CO2_o(5),’FaceColor’,’#DA5900′)
hold on
bar(6,CO2_o(6),’FaceColor’,’#FF7C01′);
hold on
bar(7,CO2_o(7),’FaceColor’,’#FFAB02′)
hold on
bar(8,CO2_o(9),’FaceColor’,’#EDD263′)
hold on
bar(9,CO2_o(9),’FaceColor’,’#AB0909′)
hold on
bar(10,CO2_o(10),’FaceColor’,’#C04655′);
hold on
bar(11,CO2_o(11),’FaceColor’,’#F17A89′)
hold on
bar(12,CO2_o(12),’FaceColor’,’#F6AFAF’);
hold on
bar(13,CO2_o(13),’FaceColor’,’#2865CA’);
hold on
bar(14,CO2_o(14),’FaceColor’,’#B1CCF9′)
hold off
title(‘EMISJA CO_{2} – JAZDA OSZCZĘDNA’,’fontSize’,18)
ylabel([‘$[frac{kg}{1000 hspace{1mm}paskm}]$’], ‘Interpreter’, ‘latex’,’fontweight’,’bold’,’fontSize’,14)
h=[];
ax=gca;
ax.XTickLabel = ”;
myLabels={‘Alstom EMU250 ED250’, ‘Alstom EMU250 ED250’,…
‘Alstom EMU250 ED250’, ‘Alstom EMU250 ED250’,…
‘Pesa Elf’, ‘Pesa Elf’,…
‘Pesa Elf’, ‘Pesa Elf’,…
‘ADtranz 113E EU11’, ‘ADtranz 113E EU11’,…
‘ADtranz 113E EU11’, ‘ADtranz 113E EU11’,…
‘Pafawag 104E EP09’, ‘Pafawag 104E EP09’;
‘Koniecpol-Opole’, ‘ Koniecpol-Opole’, ‘Opole-Koniecpol’ ,’Opole-Koniecpol’,…
‘Koniecpol-Opole’, ‘ Koniecpol-Opole’, ‘Opole-Koniecpol’ ,’Opole-Koniecpol’,…
‘Koniecpol-Opole’, ‘ Koniecpol-Opole’, ‘Opole-Koniecpol’ ,’Opole-Koniecpol’,…
‘Koniecpol-Opole’, ‘Opole-Koniecpol’;
”,’REKU’,”,’REKU’,…
”,’REKU’,”,’REKU’,…
”,’REKU’,”,’REKU’,…
”,”};
for i = 1:length(myLabels)
h(i)= text(sprintf(‘%sn%sn%s’, myLabels{:,i}), …
‘horizontalalignment’, ‘right’, ‘verticalalignment’, ‘middle’);
set(h,’Rotation’,60,’fontsize’,10);
endHi,
Short decription of what I need:
full screean figure of some bars
xticklabels multiline
What is wrong?
the text of xtickslabels is not fully displaying (down part is cut, not depends on the xtickangle)
no space between the text of xticklabels and the axis
figure(‘units’,’normalized’,’outerposition’,[0 0 1 1]);
set(gcf,’Visible’, ‘off’);
bar(1,CO2_o(1),’FaceColor’,’#572280′);
hold on
bar(2,CO2_o(2),’FaceColor’,’#953FBA’)
hold on
bar(3,CO2_o(3),’FaceColor’,’#A279CB’);
hold on
bar(4,CO2_o(4),’FaceColor’,’#D7B3FA’)
hold on
bar(5,CO2_o(5),’FaceColor’,’#DA5900′)
hold on
bar(6,CO2_o(6),’FaceColor’,’#FF7C01′);
hold on
bar(7,CO2_o(7),’FaceColor’,’#FFAB02′)
hold on
bar(8,CO2_o(9),’FaceColor’,’#EDD263′)
hold on
bar(9,CO2_o(9),’FaceColor’,’#AB0909′)
hold on
bar(10,CO2_o(10),’FaceColor’,’#C04655′);
hold on
bar(11,CO2_o(11),’FaceColor’,’#F17A89′)
hold on
bar(12,CO2_o(12),’FaceColor’,’#F6AFAF’);
hold on
bar(13,CO2_o(13),’FaceColor’,’#2865CA’);
hold on
bar(14,CO2_o(14),’FaceColor’,’#B1CCF9′)
hold off
title(‘EMISJA CO_{2} – JAZDA OSZCZĘDNA’,’fontSize’,18)
ylabel([‘$[frac{kg}{1000 hspace{1mm}paskm}]$’], ‘Interpreter’, ‘latex’,’fontweight’,’bold’,’fontSize’,14)
h=[];
ax=gca;
ax.XTickLabel = ”;
myLabels={‘Alstom EMU250 ED250’, ‘Alstom EMU250 ED250’,…
‘Alstom EMU250 ED250’, ‘Alstom EMU250 ED250’,…
‘Pesa Elf’, ‘Pesa Elf’,…
‘Pesa Elf’, ‘Pesa Elf’,…
‘ADtranz 113E EU11’, ‘ADtranz 113E EU11’,…
‘ADtranz 113E EU11’, ‘ADtranz 113E EU11’,…
‘Pafawag 104E EP09’, ‘Pafawag 104E EP09’;
‘Koniecpol-Opole’, ‘ Koniecpol-Opole’, ‘Opole-Koniecpol’ ,’Opole-Koniecpol’,…
‘Koniecpol-Opole’, ‘ Koniecpol-Opole’, ‘Opole-Koniecpol’ ,’Opole-Koniecpol’,…
‘Koniecpol-Opole’, ‘ Koniecpol-Opole’, ‘Opole-Koniecpol’ ,’Opole-Koniecpol’,…
‘Koniecpol-Opole’, ‘Opole-Koniecpol’;
”,’REKU’,”,’REKU’,…
”,’REKU’,”,’REKU’,…
”,’REKU’,”,’REKU’,…
”,”};
for i = 1:length(myLabels)
h(i)= text(sprintf(‘%sn%sn%s’, myLabels{:,i}), …
‘horizontalalignment’, ‘right’, ‘verticalalignment’, ‘middle’);
set(h,’Rotation’,60,’fontsize’,10);
end Hi,
Short decription of what I need:
full screean figure of some bars
xticklabels multiline
What is wrong?
the text of xtickslabels is not fully displaying (down part is cut, not depends on the xtickangle)
no space between the text of xticklabels and the axis
figure(‘units’,’normalized’,’outerposition’,[0 0 1 1]);
set(gcf,’Visible’, ‘off’);
bar(1,CO2_o(1),’FaceColor’,’#572280′);
hold on
bar(2,CO2_o(2),’FaceColor’,’#953FBA’)
hold on
bar(3,CO2_o(3),’FaceColor’,’#A279CB’);
hold on
bar(4,CO2_o(4),’FaceColor’,’#D7B3FA’)
hold on
bar(5,CO2_o(5),’FaceColor’,’#DA5900′)
hold on
bar(6,CO2_o(6),’FaceColor’,’#FF7C01′);
hold on
bar(7,CO2_o(7),’FaceColor’,’#FFAB02′)
hold on
bar(8,CO2_o(9),’FaceColor’,’#EDD263′)
hold on
bar(9,CO2_o(9),’FaceColor’,’#AB0909′)
hold on
bar(10,CO2_o(10),’FaceColor’,’#C04655′);
hold on
bar(11,CO2_o(11),’FaceColor’,’#F17A89′)
hold on
bar(12,CO2_o(12),’FaceColor’,’#F6AFAF’);
hold on
bar(13,CO2_o(13),’FaceColor’,’#2865CA’);
hold on
bar(14,CO2_o(14),’FaceColor’,’#B1CCF9′)
hold off
title(‘EMISJA CO_{2} – JAZDA OSZCZĘDNA’,’fontSize’,18)
ylabel([‘$[frac{kg}{1000 hspace{1mm}paskm}]$’], ‘Interpreter’, ‘latex’,’fontweight’,’bold’,’fontSize’,14)
h=[];
ax=gca;
ax.XTickLabel = ”;
myLabels={‘Alstom EMU250 ED250’, ‘Alstom EMU250 ED250’,…
‘Alstom EMU250 ED250’, ‘Alstom EMU250 ED250’,…
‘Pesa Elf’, ‘Pesa Elf’,…
‘Pesa Elf’, ‘Pesa Elf’,…
‘ADtranz 113E EU11’, ‘ADtranz 113E EU11’,…
‘ADtranz 113E EU11’, ‘ADtranz 113E EU11’,…
‘Pafawag 104E EP09’, ‘Pafawag 104E EP09’;
‘Koniecpol-Opole’, ‘ Koniecpol-Opole’, ‘Opole-Koniecpol’ ,’Opole-Koniecpol’,…
‘Koniecpol-Opole’, ‘ Koniecpol-Opole’, ‘Opole-Koniecpol’ ,’Opole-Koniecpol’,…
‘Koniecpol-Opole’, ‘ Koniecpol-Opole’, ‘Opole-Koniecpol’ ,’Opole-Koniecpol’,…
‘Koniecpol-Opole’, ‘Opole-Koniecpol’;
”,’REKU’,”,’REKU’,…
”,’REKU’,”,’REKU’,…
”,’REKU’,”,’REKU’,…
”,”};
for i = 1:length(myLabels)
h(i)= text(sprintf(‘%sn%sn%s’, myLabels{:,i}), …
‘horizontalalignment’, ‘right’, ‘verticalalignment’, ‘middle’);
set(h,’Rotation’,60,’fontsize’,10);
end xticklabels, multiline, chart, bar, fullscreen, screensize MATLAB Answers — New Questions
how to draw a peak line
Hi, i’ve data and i want to draw a line that corresponds to the peaks (where there is a zero the previous value >0 must be pasted) (See black line painted)
Is there a function or graph type that does this to me?Hi, i’ve data and i want to draw a line that corresponds to the peaks (where there is a zero the previous value >0 must be pasted) (See black line painted)
Is there a function or graph type that does this to me? Hi, i’ve data and i want to draw a line that corresponds to the peaks (where there is a zero the previous value >0 must be pasted) (See black line painted)
Is there a function or graph type that does this to me? how to draw a peak line MATLAB Answers — New Questions
I continue to get this error and can’t figure out how to fix it, Unable to perform assignment because the size of the left side is 1-by-4 and the size of the right side is 1-b
% Given temperature-depth data
z = [0, -2.3, -4.6, -6.9, -9.2, -11.5, -13.8, -16.1]; % Depth in meters
T = [22.8, 22.7, 22.5, 20.6, 13.9, 11.7, 11.2, 11.1]; % Temperature in Celsius
% Step 1: Plot the data points
figure;
plot(T, z, ‘r*’); % Plotting temperature vs depth with red stars
xlabel(‘Temperature (°C)’);
ylabel(‘Depth (m)’);
title(‘Temperature vs Depth’);
set(gca, ‘YDir’,’reverse’); % Inverting the y-axis
grid on;
% Step 2: Sort the data since the depth must be in increasing order
[z_sorted, sortIndex] = sort(z);
T_sorted = T(sortIndex);
% Step 3: Create a cubic spline interpolation
cs = spline(z_sorted, T_sorted);
% Step 4: Evaluate the spline and its derivatives on a finer grid
z_fine = linspace(min(z_sorted), max(z_sorted), 500);
T_spline = ppval(cs, z_fine);
% Step 5: Find the first and second derivatives of the spline
[breaks,coefs,l,k,d] = unmkpp(cs); % Extracts the pieces of the cubic spline
dcoefs = coefs; % Derivative coefficients
% Each row of dcoefs will be the coefficients of the polynomial of a piece
for j = 1:l
dcoefs(j,:) = polyder(dcoefs(j,:));
end
% Make a pp-form of derivative
csd1 = mkpp(breaks,dcoefs(:,1:k-1));
% First derivative evaluation
T_spline_deriv = ppval(csd1, z_fine);
% Find the second derivative
for j = 1:l
dcoefs(j,:) = polyder(dcoefs(j,:));
end
% Make a pp-form of second derivative
csd2 = mkpp(breaks,dcoefs(:,1:k-2));
% Second derivative evaluation
T_spline_second_deriv = ppval(csd2, z_fine);
% Step 6: Locate the thermocline by finding the depth where the second derivative
% changes sign, and the first derivative is a maximum
inflection_points = find(diff(sign(T_spline_second_deriv)) ~= 0) + 1;
[~, max_gradient_index] = max(abs(T_spline_deriv(inflection_points)));
thermocline_depth = z_fine(inflection_points(max_gradient_index));
thermocline_temperature = T_spline(inflection_points(max_gradient_index));
% Display the thermocline depth and temperature
fprintf(‘The thermocline is located at a depth of %.2f m with a temperature of %.2f°C.n’, …
thermocline_depth, thermocline_temperature);% Given temperature-depth data
z = [0, -2.3, -4.6, -6.9, -9.2, -11.5, -13.8, -16.1]; % Depth in meters
T = [22.8, 22.7, 22.5, 20.6, 13.9, 11.7, 11.2, 11.1]; % Temperature in Celsius
% Step 1: Plot the data points
figure;
plot(T, z, ‘r*’); % Plotting temperature vs depth with red stars
xlabel(‘Temperature (°C)’);
ylabel(‘Depth (m)’);
title(‘Temperature vs Depth’);
set(gca, ‘YDir’,’reverse’); % Inverting the y-axis
grid on;
% Step 2: Sort the data since the depth must be in increasing order
[z_sorted, sortIndex] = sort(z);
T_sorted = T(sortIndex);
% Step 3: Create a cubic spline interpolation
cs = spline(z_sorted, T_sorted);
% Step 4: Evaluate the spline and its derivatives on a finer grid
z_fine = linspace(min(z_sorted), max(z_sorted), 500);
T_spline = ppval(cs, z_fine);
% Step 5: Find the first and second derivatives of the spline
[breaks,coefs,l,k,d] = unmkpp(cs); % Extracts the pieces of the cubic spline
dcoefs = coefs; % Derivative coefficients
% Each row of dcoefs will be the coefficients of the polynomial of a piece
for j = 1:l
dcoefs(j,:) = polyder(dcoefs(j,:));
end
% Make a pp-form of derivative
csd1 = mkpp(breaks,dcoefs(:,1:k-1));
% First derivative evaluation
T_spline_deriv = ppval(csd1, z_fine);
% Find the second derivative
for j = 1:l
dcoefs(j,:) = polyder(dcoefs(j,:));
end
% Make a pp-form of second derivative
csd2 = mkpp(breaks,dcoefs(:,1:k-2));
% Second derivative evaluation
T_spline_second_deriv = ppval(csd2, z_fine);
% Step 6: Locate the thermocline by finding the depth where the second derivative
% changes sign, and the first derivative is a maximum
inflection_points = find(diff(sign(T_spline_second_deriv)) ~= 0) + 1;
[~, max_gradient_index] = max(abs(T_spline_deriv(inflection_points)));
thermocline_depth = z_fine(inflection_points(max_gradient_index));
thermocline_temperature = T_spline(inflection_points(max_gradient_index));
% Display the thermocline depth and temperature
fprintf(‘The thermocline is located at a depth of %.2f m with a temperature of %.2f°C.n’, …
thermocline_depth, thermocline_temperature); % Given temperature-depth data
z = [0, -2.3, -4.6, -6.9, -9.2, -11.5, -13.8, -16.1]; % Depth in meters
T = [22.8, 22.7, 22.5, 20.6, 13.9, 11.7, 11.2, 11.1]; % Temperature in Celsius
% Step 1: Plot the data points
figure;
plot(T, z, ‘r*’); % Plotting temperature vs depth with red stars
xlabel(‘Temperature (°C)’);
ylabel(‘Depth (m)’);
title(‘Temperature vs Depth’);
set(gca, ‘YDir’,’reverse’); % Inverting the y-axis
grid on;
% Step 2: Sort the data since the depth must be in increasing order
[z_sorted, sortIndex] = sort(z);
T_sorted = T(sortIndex);
% Step 3: Create a cubic spline interpolation
cs = spline(z_sorted, T_sorted);
% Step 4: Evaluate the spline and its derivatives on a finer grid
z_fine = linspace(min(z_sorted), max(z_sorted), 500);
T_spline = ppval(cs, z_fine);
% Step 5: Find the first and second derivatives of the spline
[breaks,coefs,l,k,d] = unmkpp(cs); % Extracts the pieces of the cubic spline
dcoefs = coefs; % Derivative coefficients
% Each row of dcoefs will be the coefficients of the polynomial of a piece
for j = 1:l
dcoefs(j,:) = polyder(dcoefs(j,:));
end
% Make a pp-form of derivative
csd1 = mkpp(breaks,dcoefs(:,1:k-1));
% First derivative evaluation
T_spline_deriv = ppval(csd1, z_fine);
% Find the second derivative
for j = 1:l
dcoefs(j,:) = polyder(dcoefs(j,:));
end
% Make a pp-form of second derivative
csd2 = mkpp(breaks,dcoefs(:,1:k-2));
% Second derivative evaluation
T_spline_second_deriv = ppval(csd2, z_fine);
% Step 6: Locate the thermocline by finding the depth where the second derivative
% changes sign, and the first derivative is a maximum
inflection_points = find(diff(sign(T_spline_second_deriv)) ~= 0) + 1;
[~, max_gradient_index] = max(abs(T_spline_deriv(inflection_points)));
thermocline_depth = z_fine(inflection_points(max_gradient_index));
thermocline_temperature = T_spline(inflection_points(max_gradient_index));
% Display the thermocline depth and temperature
fprintf(‘The thermocline is located at a depth of %.2f m with a temperature of %.2f°C.n’, …
thermocline_depth, thermocline_temperature); matrices MATLAB Answers — New Questions
how do i get a proper time plot for this qudratic equation?
the script seems to be not behaving properly,as it is supposed to be ?
% Define the range for x
x = linspace(-5, 5, 10); % 10 points between -5 and 5
dx1 = 2*x.^2 – 8; % Compute the derivative (velocity field)
% Create a figure
figure;
hold on;
% Plot the real line (x-axis)
plot(x, zeros(size(x)), ‘k’); % The x-axis (real line)
% Plot the vector field as arrows
for i = 1:length(x)
if dx1(i) > 0
% Arrow pointing to the right (positive dx)
quiver(x(i), 0, 0.5, 0, ‘r’, ‘MaxHeadSize’, 0.5);
elseif dx1(i) < 0
% Arrow pointing to the left (negative dx)
quiver(x(i), 0, -0.5, 0, ‘b’, ‘MaxHeadSize’, 0.5);
end
end
% Plot equilibria points
plot([-2, 2], [0, 0], ‘bo’, ‘MarkerFaceColor’, ‘b’, ‘MarkerSize’, 8); % Equilibria at x = -2 and x = 2
% Labels and title
xlabel(‘x’);
ylabel(‘x-dot’);
title(‘1D Vector Field for x-dot = 2x^2 – 8’);
ylim([-1 1]); % Set y-axis limits to keep focus on x-axis
xlim([-4 4]); % Set x-axis limits
grid on; % Add grid
% Add text annotations for equilibrium points
text(-2, 0.2, ‘Stable Equilibrium: x = -2’, ‘HorizontalAlignment’, ‘center’);
text(2, 0.2, ‘Unstable Equilibrium: x = 2’, ‘HorizontalAlignment’, ‘center’);
hold off;
t = [-5 5];
ode_function = @(t,x) 2*x.^2-8;
x0 = [-2 2];
[time, x] = ode45(ode_function, t, x0);
figure;
plot(time, x, ‘LineWidth’,0.5);
title(‘Solution of dx/dt = 2x^2 – 8 vs Time’);
xlabel(‘Time t’);
ylabel(‘x(t)’);
xlim([-t(2) t(2)]); % Adjust x-axis limits for clarity
ylim([-3 3]); % Set y-axis limits to see behavior around -2 and 2
grid on;
the first part works perfectly fine, but the 2nd part where i have to plot wrt time, is where i am having trouble? its supposed to be going from x-2 being stable , and 2 being unstable, the plot should depict that.
but I am unable to get that done properlythe script seems to be not behaving properly,as it is supposed to be ?
% Define the range for x
x = linspace(-5, 5, 10); % 10 points between -5 and 5
dx1 = 2*x.^2 – 8; % Compute the derivative (velocity field)
% Create a figure
figure;
hold on;
% Plot the real line (x-axis)
plot(x, zeros(size(x)), ‘k’); % The x-axis (real line)
% Plot the vector field as arrows
for i = 1:length(x)
if dx1(i) > 0
% Arrow pointing to the right (positive dx)
quiver(x(i), 0, 0.5, 0, ‘r’, ‘MaxHeadSize’, 0.5);
elseif dx1(i) < 0
% Arrow pointing to the left (negative dx)
quiver(x(i), 0, -0.5, 0, ‘b’, ‘MaxHeadSize’, 0.5);
end
end
% Plot equilibria points
plot([-2, 2], [0, 0], ‘bo’, ‘MarkerFaceColor’, ‘b’, ‘MarkerSize’, 8); % Equilibria at x = -2 and x = 2
% Labels and title
xlabel(‘x’);
ylabel(‘x-dot’);
title(‘1D Vector Field for x-dot = 2x^2 – 8’);
ylim([-1 1]); % Set y-axis limits to keep focus on x-axis
xlim([-4 4]); % Set x-axis limits
grid on; % Add grid
% Add text annotations for equilibrium points
text(-2, 0.2, ‘Stable Equilibrium: x = -2’, ‘HorizontalAlignment’, ‘center’);
text(2, 0.2, ‘Unstable Equilibrium: x = 2’, ‘HorizontalAlignment’, ‘center’);
hold off;
t = [-5 5];
ode_function = @(t,x) 2*x.^2-8;
x0 = [-2 2];
[time, x] = ode45(ode_function, t, x0);
figure;
plot(time, x, ‘LineWidth’,0.5);
title(‘Solution of dx/dt = 2x^2 – 8 vs Time’);
xlabel(‘Time t’);
ylabel(‘x(t)’);
xlim([-t(2) t(2)]); % Adjust x-axis limits for clarity
ylim([-3 3]); % Set y-axis limits to see behavior around -2 and 2
grid on;
the first part works perfectly fine, but the 2nd part where i have to plot wrt time, is where i am having trouble? its supposed to be going from x-2 being stable , and 2 being unstable, the plot should depict that.
but I am unable to get that done properly the script seems to be not behaving properly,as it is supposed to be ?
% Define the range for x
x = linspace(-5, 5, 10); % 10 points between -5 and 5
dx1 = 2*x.^2 – 8; % Compute the derivative (velocity field)
% Create a figure
figure;
hold on;
% Plot the real line (x-axis)
plot(x, zeros(size(x)), ‘k’); % The x-axis (real line)
% Plot the vector field as arrows
for i = 1:length(x)
if dx1(i) > 0
% Arrow pointing to the right (positive dx)
quiver(x(i), 0, 0.5, 0, ‘r’, ‘MaxHeadSize’, 0.5);
elseif dx1(i) < 0
% Arrow pointing to the left (negative dx)
quiver(x(i), 0, -0.5, 0, ‘b’, ‘MaxHeadSize’, 0.5);
end
end
% Plot equilibria points
plot([-2, 2], [0, 0], ‘bo’, ‘MarkerFaceColor’, ‘b’, ‘MarkerSize’, 8); % Equilibria at x = -2 and x = 2
% Labels and title
xlabel(‘x’);
ylabel(‘x-dot’);
title(‘1D Vector Field for x-dot = 2x^2 – 8’);
ylim([-1 1]); % Set y-axis limits to keep focus on x-axis
xlim([-4 4]); % Set x-axis limits
grid on; % Add grid
% Add text annotations for equilibrium points
text(-2, 0.2, ‘Stable Equilibrium: x = -2’, ‘HorizontalAlignment’, ‘center’);
text(2, 0.2, ‘Unstable Equilibrium: x = 2’, ‘HorizontalAlignment’, ‘center’);
hold off;
t = [-5 5];
ode_function = @(t,x) 2*x.^2-8;
x0 = [-2 2];
[time, x] = ode45(ode_function, t, x0);
figure;
plot(time, x, ‘LineWidth’,0.5);
title(‘Solution of dx/dt = 2x^2 – 8 vs Time’);
xlabel(‘Time t’);
ylabel(‘x(t)’);
xlim([-t(2) t(2)]); % Adjust x-axis limits for clarity
ylim([-3 3]); % Set y-axis limits to see behavior around -2 and 2
grid on;
the first part works perfectly fine, but the 2nd part where i have to plot wrt time, is where i am having trouble? its supposed to be going from x-2 being stable , and 2 being unstable, the plot should depict that.
but I am unable to get that done properly code generation, ode45, equation MATLAB Answers — New Questions
MATLAB Vehicle Network Toolbox cannot send CAN messages on physical channels with Vector’s hardware VN1610.
When using the vehicle network toolbox(Matlab 2024a update 6) with the vector’s hardware VN1610, if choosing to use the real physical channel instead of the virtual channel, I’m not able to turn off the canChannel.SilentMode even if the canChannel.InitializationAccess is 1, which caused the channel only able to receive messages but cannot send out any messages. I tried to turn the SilentMode off with commands below:
>> txCh_I
txCh_I =
Channel with properties:
Device Information
DeviceVendor: ‘Vector’
Device: ‘VN1610 1’
DeviceChannelIndex: 2
DeviceSerialNumber: 530636
ProtocolMode: ‘CAN’
Status Information
Running: 0
MessagesAvailable: 0
MessagesReceived: 0
MessagesTransmitted: 0
InitializationAccess: 1
InitialTimestamp: [0×0 datetime]
FilterHistory: ‘Standard ID Filter: Allow All | Extended ID Filter: Allow All’
Channel Information
BusStatus: ‘N/A’
SilentMode: 1
TransceiverName: ‘On board CAN 1051cap(Highspeed)’
TransceiverState: 0
ReceiveErrorCount: 0
TransmitErrorCount: 0
BusSpeed: 250000
SJW: 1
TSEG1: 10
TSEG2: 5
NumOfSamples: 1
Other Information
Database: []
UserData: []
>> txCh_I.SilentMode = false
txCh_I =
Channel with properties:
Device Information
DeviceVendor: ‘Vector’
Device: ‘VN1610 1’
DeviceChannelIndex: 2
DeviceSerialNumber: 530636
ProtocolMode: ‘CAN’
Status Information
Running: 0
MessagesAvailable: 0
MessagesReceived: 0
MessagesTransmitted: 0
InitializationAccess: 1
InitialTimestamp: [0×0 datetime]
FilterHistory: ‘Standard ID Filter: Allow All | Extended ID Filter: Allow All’
Channel Information
BusStatus: ‘N/A’
SilentMode: 1
TransceiverName: ‘On board CAN 1051cap(Highspeed)’
TransceiverState: 0
ReceiveErrorCount: 0
TransmitErrorCount: 0
BusSpeed: 250000
SJW: 1
TSEG1: 10
TSEG2: 5
NumOfSamples: 1
Other Information
Database: []
UserData: []
It’s wierd that the channel has opened successfully but SilentMode is set to 1 defaultly, and the initial access is true but cannot change the SilentMode without giving any error or indication. When I dig the issue further, I found that this issue only happens on the hardware VN1610 with the latest Vector driver(version 24.20.10).
After rolling-back the driver to a previous version, the issue just disappeared:
Vehicle Network Toolbox has detected a supported Vector device. To connect to this device:
1. Download and install the latest device driver from the Vector website.
2. Verify device readiness with canChannelList.
>> txCh_I
txCh_I =
Channel with properties:
Device Information
DeviceVendor: ‘Vector’
Device: ‘VN1610 1’
DeviceChannelIndex: 1
DeviceSerialNumber: 530636
ProtocolMode: ‘CAN’
Status Information
Running: 0
MessagesAvailable: 150
MessagesReceived: 0
MessagesTransmitted: 0
InitializationAccess: 1
InitialTimestamp: 28-Sep-2024 06:28:43
FilterHistory: ‘Standard ID Filter: Allow All | Extended ID Filter: Allow All’
Channel Information
BusStatus: ‘N/A’
SilentMode: 0
TransceiverName: ‘On board CAN 1051cap(Highspeed)’
TransceiverState: 0
ReceiveErrorCount: 0
TransmitErrorCount: 0
BusSpeed: 500000
SJW: 1
TSEG1: 4
TSEG2: 3
NumOfSamples: 1
Other Information
Database: []
UserData: []
Please take a look and help check this. Thanks!When using the vehicle network toolbox(Matlab 2024a update 6) with the vector’s hardware VN1610, if choosing to use the real physical channel instead of the virtual channel, I’m not able to turn off the canChannel.SilentMode even if the canChannel.InitializationAccess is 1, which caused the channel only able to receive messages but cannot send out any messages. I tried to turn the SilentMode off with commands below:
>> txCh_I
txCh_I =
Channel with properties:
Device Information
DeviceVendor: ‘Vector’
Device: ‘VN1610 1’
DeviceChannelIndex: 2
DeviceSerialNumber: 530636
ProtocolMode: ‘CAN’
Status Information
Running: 0
MessagesAvailable: 0
MessagesReceived: 0
MessagesTransmitted: 0
InitializationAccess: 1
InitialTimestamp: [0×0 datetime]
FilterHistory: ‘Standard ID Filter: Allow All | Extended ID Filter: Allow All’
Channel Information
BusStatus: ‘N/A’
SilentMode: 1
TransceiverName: ‘On board CAN 1051cap(Highspeed)’
TransceiverState: 0
ReceiveErrorCount: 0
TransmitErrorCount: 0
BusSpeed: 250000
SJW: 1
TSEG1: 10
TSEG2: 5
NumOfSamples: 1
Other Information
Database: []
UserData: []
>> txCh_I.SilentMode = false
txCh_I =
Channel with properties:
Device Information
DeviceVendor: ‘Vector’
Device: ‘VN1610 1’
DeviceChannelIndex: 2
DeviceSerialNumber: 530636
ProtocolMode: ‘CAN’
Status Information
Running: 0
MessagesAvailable: 0
MessagesReceived: 0
MessagesTransmitted: 0
InitializationAccess: 1
InitialTimestamp: [0×0 datetime]
FilterHistory: ‘Standard ID Filter: Allow All | Extended ID Filter: Allow All’
Channel Information
BusStatus: ‘N/A’
SilentMode: 1
TransceiverName: ‘On board CAN 1051cap(Highspeed)’
TransceiverState: 0
ReceiveErrorCount: 0
TransmitErrorCount: 0
BusSpeed: 250000
SJW: 1
TSEG1: 10
TSEG2: 5
NumOfSamples: 1
Other Information
Database: []
UserData: []
It’s wierd that the channel has opened successfully but SilentMode is set to 1 defaultly, and the initial access is true but cannot change the SilentMode without giving any error or indication. When I dig the issue further, I found that this issue only happens on the hardware VN1610 with the latest Vector driver(version 24.20.10).
After rolling-back the driver to a previous version, the issue just disappeared:
Vehicle Network Toolbox has detected a supported Vector device. To connect to this device:
1. Download and install the latest device driver from the Vector website.
2. Verify device readiness with canChannelList.
>> txCh_I
txCh_I =
Channel with properties:
Device Information
DeviceVendor: ‘Vector’
Device: ‘VN1610 1’
DeviceChannelIndex: 1
DeviceSerialNumber: 530636
ProtocolMode: ‘CAN’
Status Information
Running: 0
MessagesAvailable: 150
MessagesReceived: 0
MessagesTransmitted: 0
InitializationAccess: 1
InitialTimestamp: 28-Sep-2024 06:28:43
FilterHistory: ‘Standard ID Filter: Allow All | Extended ID Filter: Allow All’
Channel Information
BusStatus: ‘N/A’
SilentMode: 0
TransceiverName: ‘On board CAN 1051cap(Highspeed)’
TransceiverState: 0
ReceiveErrorCount: 0
TransmitErrorCount: 0
BusSpeed: 500000
SJW: 1
TSEG1: 4
TSEG2: 3
NumOfSamples: 1
Other Information
Database: []
UserData: []
Please take a look and help check this. Thanks! When using the vehicle network toolbox(Matlab 2024a update 6) with the vector’s hardware VN1610, if choosing to use the real physical channel instead of the virtual channel, I’m not able to turn off the canChannel.SilentMode even if the canChannel.InitializationAccess is 1, which caused the channel only able to receive messages but cannot send out any messages. I tried to turn the SilentMode off with commands below:
>> txCh_I
txCh_I =
Channel with properties:
Device Information
DeviceVendor: ‘Vector’
Device: ‘VN1610 1’
DeviceChannelIndex: 2
DeviceSerialNumber: 530636
ProtocolMode: ‘CAN’
Status Information
Running: 0
MessagesAvailable: 0
MessagesReceived: 0
MessagesTransmitted: 0
InitializationAccess: 1
InitialTimestamp: [0×0 datetime]
FilterHistory: ‘Standard ID Filter: Allow All | Extended ID Filter: Allow All’
Channel Information
BusStatus: ‘N/A’
SilentMode: 1
TransceiverName: ‘On board CAN 1051cap(Highspeed)’
TransceiverState: 0
ReceiveErrorCount: 0
TransmitErrorCount: 0
BusSpeed: 250000
SJW: 1
TSEG1: 10
TSEG2: 5
NumOfSamples: 1
Other Information
Database: []
UserData: []
>> txCh_I.SilentMode = false
txCh_I =
Channel with properties:
Device Information
DeviceVendor: ‘Vector’
Device: ‘VN1610 1’
DeviceChannelIndex: 2
DeviceSerialNumber: 530636
ProtocolMode: ‘CAN’
Status Information
Running: 0
MessagesAvailable: 0
MessagesReceived: 0
MessagesTransmitted: 0
InitializationAccess: 1
InitialTimestamp: [0×0 datetime]
FilterHistory: ‘Standard ID Filter: Allow All | Extended ID Filter: Allow All’
Channel Information
BusStatus: ‘N/A’
SilentMode: 1
TransceiverName: ‘On board CAN 1051cap(Highspeed)’
TransceiverState: 0
ReceiveErrorCount: 0
TransmitErrorCount: 0
BusSpeed: 250000
SJW: 1
TSEG1: 10
TSEG2: 5
NumOfSamples: 1
Other Information
Database: []
UserData: []
It’s wierd that the channel has opened successfully but SilentMode is set to 1 defaultly, and the initial access is true but cannot change the SilentMode without giving any error or indication. When I dig the issue further, I found that this issue only happens on the hardware VN1610 with the latest Vector driver(version 24.20.10).
After rolling-back the driver to a previous version, the issue just disappeared:
Vehicle Network Toolbox has detected a supported Vector device. To connect to this device:
1. Download and install the latest device driver from the Vector website.
2. Verify device readiness with canChannelList.
>> txCh_I
txCh_I =
Channel with properties:
Device Information
DeviceVendor: ‘Vector’
Device: ‘VN1610 1’
DeviceChannelIndex: 1
DeviceSerialNumber: 530636
ProtocolMode: ‘CAN’
Status Information
Running: 0
MessagesAvailable: 150
MessagesReceived: 0
MessagesTransmitted: 0
InitializationAccess: 1
InitialTimestamp: 28-Sep-2024 06:28:43
FilterHistory: ‘Standard ID Filter: Allow All | Extended ID Filter: Allow All’
Channel Information
BusStatus: ‘N/A’
SilentMode: 0
TransceiverName: ‘On board CAN 1051cap(Highspeed)’
TransceiverState: 0
ReceiveErrorCount: 0
TransmitErrorCount: 0
BusSpeed: 500000
SJW: 1
TSEG1: 4
TSEG2: 3
NumOfSamples: 1
Other Information
Database: []
UserData: []
Please take a look and help check this. Thanks! vehicle network toolbox, vector hardware, vn1610, can channel MATLAB Answers — New Questions
Choose role of NaN when summing two matrices
Dear all
Some time ago, I posted this question: Choosing the role of NaN elements in the sum environment of matrices. That worked great when doing the mean value, but now imagine that I just want to sum the two matrices, given by:
aa=[1 2; 3 NaN];
bb=[NaN 1; 2 NaN];
so that I obtain:
cc=[1 3; 5 NaN];
If I do something like:
cc=sum(cat(3,aa,bb),3,’omitnan’)
that gives:
cc=[1 3; 5 0];
Which way would be the best in this case?Dear all
Some time ago, I posted this question: Choosing the role of NaN elements in the sum environment of matrices. That worked great when doing the mean value, but now imagine that I just want to sum the two matrices, given by:
aa=[1 2; 3 NaN];
bb=[NaN 1; 2 NaN];
so that I obtain:
cc=[1 3; 5 NaN];
If I do something like:
cc=sum(cat(3,aa,bb),3,’omitnan’)
that gives:
cc=[1 3; 5 0];
Which way would be the best in this case? Dear all
Some time ago, I posted this question: Choosing the role of NaN elements in the sum environment of matrices. That worked great when doing the mean value, but now imagine that I just want to sum the two matrices, given by:
aa=[1 2; 3 NaN];
bb=[NaN 1; 2 NaN];
so that I obtain:
cc=[1 3; 5 NaN];
If I do something like:
cc=sum(cat(3,aa,bb),3,’omitnan’)
that gives:
cc=[1 3; 5 0];
Which way would be the best in this case? summing matrices, role of nan MATLAB Answers — New Questions