Category: Matlab
Category Archives: Matlab
ANSYS Fluent and Simulink co-simulation in real time.
Hello,
I want to test a temperature and air flow pattern in a room in ANSYS Fluent but the same time i want a co-simulation with Simulink so that i can modify parameters in Simulink and observe the variation in Fluent. How to do that….??
thanxHello,
I want to test a temperature and air flow pattern in a room in ANSYS Fluent but the same time i want a co-simulation with Simulink so that i can modify parameters in Simulink and observe the variation in Fluent. How to do that….??
thanx Hello,
I want to test a temperature and air flow pattern in a room in ANSYS Fluent but the same time i want a co-simulation with Simulink so that i can modify parameters in Simulink and observe the variation in Fluent. How to do that….??
thanx ansys fluent and simulink co-simulation in real ti MATLAB Answers — New Questions
how to make the numbers on the matrix with alternative sign?
I want to create a matrix that the main diagonal of K are alternatively 2 and -2’s, the sub- and sup-diagonal of K alternatively
1 and -1’s, and everywhere else 0. The size of K is 2n by 2n.
Here is what I got so far.
x=ones(1,5);
y=ones(1,4);
x2=2*x;
y2=y*-1;
z=diag(x2,0)
[rows, columns] = size(z)
z(1:2*rows+2:end) = -z(1:2*rows+2:end)
b=diag(y2,+1)
d=diag(y2,-1)
g=z+b+dI want to create a matrix that the main diagonal of K are alternatively 2 and -2’s, the sub- and sup-diagonal of K alternatively
1 and -1’s, and everywhere else 0. The size of K is 2n by 2n.
Here is what I got so far.
x=ones(1,5);
y=ones(1,4);
x2=2*x;
y2=y*-1;
z=diag(x2,0)
[rows, columns] = size(z)
z(1:2*rows+2:end) = -z(1:2*rows+2:end)
b=diag(y2,+1)
d=diag(y2,-1)
g=z+b+d I want to create a matrix that the main diagonal of K are alternatively 2 and -2’s, the sub- and sup-diagonal of K alternatively
1 and -1’s, and everywhere else 0. The size of K is 2n by 2n.
Here is what I got so far.
x=ones(1,5);
y=ones(1,4);
x2=2*x;
y2=y*-1;
z=diag(x2,0)
[rows, columns] = size(z)
z(1:2*rows+2:end) = -z(1:2*rows+2:end)
b=diag(y2,+1)
d=diag(y2,-1)
g=z+b+d matrix manipulation MATLAB Answers — New Questions
what toolbox functions can i use for shape and object recognition
Hi, i have a question about an assignment i have to do. In a assigment i need to do 3 things:
I take a picture of a IC integrated circuit on a black piece of paper. Then i imread it into my program.
1 – Count the amount of pins on a IC (integrated circuit) – DONE with thresholding a bw image + dilation + labeling and regionprops. That is can sort of do.
2 – The program needs to recognize if its NOT a picture of a IC (integrated circuit).
I know is asked but i dont know what toolbox function would me suited.
I guess some toolbox function do shape / object recognition? but i cant determin what is best.
3 – The program need to check if all the pins are connected to the body of the ic.
IC’s always have a even number of pins so that shall be a if else construction.
I especially need help with 2.
code can be providedHi, i have a question about an assignment i have to do. In a assigment i need to do 3 things:
I take a picture of a IC integrated circuit on a black piece of paper. Then i imread it into my program.
1 – Count the amount of pins on a IC (integrated circuit) – DONE with thresholding a bw image + dilation + labeling and regionprops. That is can sort of do.
2 – The program needs to recognize if its NOT a picture of a IC (integrated circuit).
I know is asked but i dont know what toolbox function would me suited.
I guess some toolbox function do shape / object recognition? but i cant determin what is best.
3 – The program need to check if all the pins are connected to the body of the ic.
IC’s always have a even number of pins so that shall be a if else construction.
I especially need help with 2.
code can be provided Hi, i have a question about an assignment i have to do. In a assigment i need to do 3 things:
I take a picture of a IC integrated circuit on a black piece of paper. Then i imread it into my program.
1 – Count the amount of pins on a IC (integrated circuit) – DONE with thresholding a bw image + dilation + labeling and regionprops. That is can sort of do.
2 – The program needs to recognize if its NOT a picture of a IC (integrated circuit).
I know is asked but i dont know what toolbox function would me suited.
I guess some toolbox function do shape / object recognition? but i cant determin what is best.
3 – The program need to check if all the pins are connected to the body of the ic.
IC’s always have a even number of pins so that shall be a if else construction.
I especially need help with 2.
code can be provided image processing, shape recognition, object recognition, integrated cicuit MATLAB Answers — New Questions
Dealing with .NET arrays and MarshalByRefObjects
I’m using an API from an Audio Precision to detect the available channels from an ASIO device. The API outputs a .NET array of type IChannelInfo[] that I can’t seem to get information from. If I create the array as chanInfo and try to access the first object either with chanInfo(1) or chanInfo.GetValue(1) or any other number of Methods, it just returns a "MarshalByRefObject" with no properties that I can’t figure out how to actually use. I would expect it to either just return a string like "Analog 2 (1)" or to return another .NET object that includes the name, channel number, etc.I’m using an API from an Audio Precision to detect the available channels from an ASIO device. The API outputs a .NET array of type IChannelInfo[] that I can’t seem to get information from. If I create the array as chanInfo and try to access the first object either with chanInfo(1) or chanInfo.GetValue(1) or any other number of Methods, it just returns a "MarshalByRefObject" with no properties that I can’t figure out how to actually use. I would expect it to either just return a string like "Analog 2 (1)" or to return another .NET object that includes the name, channel number, etc. I’m using an API from an Audio Precision to detect the available channels from an ASIO device. The API outputs a .NET array of type IChannelInfo[] that I can’t seem to get information from. If I create the array as chanInfo and try to access the first object either with chanInfo(1) or chanInfo.GetValue(1) or any other number of Methods, it just returns a "MarshalByRefObject" with no properties that I can’t figure out how to actually use. I would expect it to either just return a string like "Analog 2 (1)" or to return another .NET object that includes the name, channel number, etc. .net, system MATLAB Answers — New Questions
Simscape Multibody Link in Online Matlab platform
Hello, I’m using the online MATLAB interface with a school license, and I’d like to utilize Simscape Multibody Link to upload a Solidworks file and simulate the model. How can I achieve this on the online platform? I tried installing the latest Linux (glnxa64) version, but it didn’t work. Thank you in advance for your assistance!Hello, I’m using the online MATLAB interface with a school license, and I’d like to utilize Simscape Multibody Link to upload a Solidworks file and simulate the model. How can I achieve this on the online platform? I tried installing the latest Linux (glnxa64) version, but it didn’t work. Thank you in advance for your assistance! Hello, I’m using the online MATLAB interface with a school license, and I’d like to utilize Simscape Multibody Link to upload a Solidworks file and simulate the model. How can I achieve this on the online platform? I tried installing the latest Linux (glnxa64) version, but it didn’t work. Thank you in advance for your assistance! simscape MATLAB Answers — New Questions
How to give one x and y axis label when using tiled layout(‘flow’)?
I am using tiled layout(‘flow’) to plot a series of 20 plots on one figure. I want to have just one x and one y label for the entire figure, but when I try using the following code I get a figure that plots every subplot over each other.
figure()
t=tiledlayout(‘flow’);
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile(t)
plot(lag(:,ii),autoCorr(:,ii))
end
title(t,’title’)
xlabel(t,’xlabel’)
ylabel(t,’ylabel’)
When I use this code the plot works fine but I’m not sure how to add the x and y axis labels.
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
figure()
tiledlayout(‘flow’)
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile
plot(lag(:,ii),autoCorr(:,ii))
% xlim([100,fmax])
endI am using tiled layout(‘flow’) to plot a series of 20 plots on one figure. I want to have just one x and one y label for the entire figure, but when I try using the following code I get a figure that plots every subplot over each other.
figure()
t=tiledlayout(‘flow’);
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile(t)
plot(lag(:,ii),autoCorr(:,ii))
end
title(t,’title’)
xlabel(t,’xlabel’)
ylabel(t,’ylabel’)
When I use this code the plot works fine but I’m not sure how to add the x and y axis labels.
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
figure()
tiledlayout(‘flow’)
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile
plot(lag(:,ii),autoCorr(:,ii))
% xlim([100,fmax])
end I am using tiled layout(‘flow’) to plot a series of 20 plots on one figure. I want to have just one x and one y label for the entire figure, but when I try using the following code I get a figure that plots every subplot over each other.
figure()
t=tiledlayout(‘flow’);
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile(t)
plot(lag(:,ii),autoCorr(:,ii))
end
title(t,’title’)
xlabel(t,’xlabel’)
ylabel(t,’ylabel’)
When I use this code the plot works fine but I’m not sure how to add the x and y axis labels.
autoCorr = zeros(ceil(length(dataSource)),N);
lag = zeros(ceil(length(dataSource)),N);
figure()
tiledlayout(‘flow’)
for ii=1:N
[autoCorr(:,ii),lag(:,ii)] = autocorrelation(dataSource(:,ii));
nexttile
plot(lag(:,ii),autoCorr(:,ii))
% xlim([100,fmax])
end tiled layout, tiledlayout, tiles, plot, subplot MATLAB Answers — New Questions
Dynamic Correction Factor Adjustment in Matlab to Match Slope (Power) in Log-Log Plot
Hello everyone,
I am working on a data analysis task where I need to dynamically adjust a correction factor for a dataset to match a specific slope in a log-log plot. The dataset consists of two main columns: Time (s) and Corrected Data (Factor 0.98578). My objective is to apply a rolling correction factor to the Corrected Data (Factor 0.98578) such that its slope in a log-log plot matches the slope of a reference dataset (which I have as Corrected Data (Factor 0.98578)).
Dynamic Adjustment: The correction factor should start with a 0.98578 and decrease dynamically over time to ensure the slope of the corrected Corrected Data (Factor 0.98578) aligns with the target slope (not necessarly).
I am seeking advice or suggestions on how to implement this in Matlab. Any guidance on formulas, functions, or scripting approaches that could effectively handle this task would be greatly appreciated.
Thank you in advance for your help!Hello everyone,
I am working on a data analysis task where I need to dynamically adjust a correction factor for a dataset to match a specific slope in a log-log plot. The dataset consists of two main columns: Time (s) and Corrected Data (Factor 0.98578). My objective is to apply a rolling correction factor to the Corrected Data (Factor 0.98578) such that its slope in a log-log plot matches the slope of a reference dataset (which I have as Corrected Data (Factor 0.98578)).
Dynamic Adjustment: The correction factor should start with a 0.98578 and decrease dynamically over time to ensure the slope of the corrected Corrected Data (Factor 0.98578) aligns with the target slope (not necessarly).
I am seeking advice or suggestions on how to implement this in Matlab. Any guidance on formulas, functions, or scripting approaches that could effectively handle this task would be greatly appreciated.
Thank you in advance for your help! Hello everyone,
I am working on a data analysis task where I need to dynamically adjust a correction factor for a dataset to match a specific slope in a log-log plot. The dataset consists of two main columns: Time (s) and Corrected Data (Factor 0.98578). My objective is to apply a rolling correction factor to the Corrected Data (Factor 0.98578) such that its slope in a log-log plot matches the slope of a reference dataset (which I have as Corrected Data (Factor 0.98578)).
Dynamic Adjustment: The correction factor should start with a 0.98578 and decrease dynamically over time to ensure the slope of the corrected Corrected Data (Factor 0.98578) aligns with the target slope (not necessarly).
I am seeking advice or suggestions on how to implement this in Matlab. Any guidance on formulas, functions, or scripting approaches that could effectively handle this task would be greatly appreciated.
Thank you in advance for your help! data, importing excel data, slope, data analysis, curve fitting MATLAB Answers — New Questions
Sequence oder Featureinput layer ?
Hello dear Community,
i am currently trying to use a Feed-Forward Neural Network for a regression problem.
The input data i want to feed in are "rotational speed", "torque" and "time".
The target data is the temperature of an electrical drive.
And then i will have different operating points dependend on speed:
2000 rpm, 4000 rpm ….
The torque and time however stays the same for each point.
Right now, i am using a sequenceInputLayer and arranged the Data in 4 cells, where each cell contains 3 columns of data. One cell represents one OP.
The results are not good, and my gut tells me, that i might have a misunderstanding the way i treat the input data.
I am using MATLAB r24a and am training the network with the "trainnet"-function.
If you have any Suggestions to do this in a different way, go ahead.
Thank you very much in advance.Hello dear Community,
i am currently trying to use a Feed-Forward Neural Network for a regression problem.
The input data i want to feed in are "rotational speed", "torque" and "time".
The target data is the temperature of an electrical drive.
And then i will have different operating points dependend on speed:
2000 rpm, 4000 rpm ….
The torque and time however stays the same for each point.
Right now, i am using a sequenceInputLayer and arranged the Data in 4 cells, where each cell contains 3 columns of data. One cell represents one OP.
The results are not good, and my gut tells me, that i might have a misunderstanding the way i treat the input data.
I am using MATLAB r24a and am training the network with the "trainnet"-function.
If you have any Suggestions to do this in a different way, go ahead.
Thank you very much in advance. Hello dear Community,
i am currently trying to use a Feed-Forward Neural Network for a regression problem.
The input data i want to feed in are "rotational speed", "torque" and "time".
The target data is the temperature of an electrical drive.
And then i will have different operating points dependend on speed:
2000 rpm, 4000 rpm ….
The torque and time however stays the same for each point.
Right now, i am using a sequenceInputLayer and arranged the Data in 4 cells, where each cell contains 3 columns of data. One cell represents one OP.
The results are not good, and my gut tells me, that i might have a misunderstanding the way i treat the input data.
I am using MATLAB r24a and am training the network with the "trainnet"-function.
If you have any Suggestions to do this in a different way, go ahead.
Thank you very much in advance. deep learning, neural network, regression, data MATLAB Answers — New Questions
is it possible to Stepper Motor Drive simulate at 10 milisecond fixed time step
is it possible to Stepper Motor Drive simulate at 10 milisecond fixed time stepis it possible to Stepper Motor Drive simulate at 10 milisecond fixed time step is it possible to Stepper Motor Drive simulate at 10 milisecond fixed time step transferred MATLAB Answers — New Questions
Why does the Mathworks provided model for See-in-the-Dark Data Set not give as good results as the original Tensorflow equivalent?
Please refer to the Matlab example (https://www.mathworks.com/help/images/learning-to-see-in-the-dark.html), This page itself acknowledges that "The colors of the network prediction are less saturated and vibrant than in the ground truth". I have compared it against the original TF model as provided by the original authors (https://github.com/cchen156/Learning-to-See-in-the-Dark) which DOES provide a very good reconstruction of the ground truth with vibrant colors. I have tried retraining the model in Matlab and got similarly poor results as the Matlab-provided pretrained model. Could someone please throw light on what could be causing this? I am afraid without a solution, Matlab example is not useful at all compared to the Tensorflow solution.Please refer to the Matlab example (https://www.mathworks.com/help/images/learning-to-see-in-the-dark.html), This page itself acknowledges that "The colors of the network prediction are less saturated and vibrant than in the ground truth". I have compared it against the original TF model as provided by the original authors (https://github.com/cchen156/Learning-to-See-in-the-Dark) which DOES provide a very good reconstruction of the ground truth with vibrant colors. I have tried retraining the model in Matlab and got similarly poor results as the Matlab-provided pretrained model. Could someone please throw light on what could be causing this? I am afraid without a solution, Matlab example is not useful at all compared to the Tensorflow solution. Please refer to the Matlab example (https://www.mathworks.com/help/images/learning-to-see-in-the-dark.html), This page itself acknowledges that "The colors of the network prediction are less saturated and vibrant than in the ground truth". I have compared it against the original TF model as provided by the original authors (https://github.com/cchen156/Learning-to-See-in-the-Dark) which DOES provide a very good reconstruction of the ground truth with vibrant colors. I have tried retraining the model in Matlab and got similarly poor results as the Matlab-provided pretrained model. Could someone please throw light on what could be causing this? I am afraid without a solution, Matlab example is not useful at all compared to the Tensorflow solution. see in the light dataset, image regression, low light enhancement MATLAB Answers — New Questions
How to increase the speed of calculating a simple second-order equation in Simulink?
Hello! Problem with calculation speed in Simulink.
I came across a video on YouTube comparing Simulink and another program. The Simulink solver spends an unreasonable amount of time solving the example I’ve attached below. For values of the constant greater than 1e7, the integration step decreases too much. Please tell me, is it possible to somehow increase the speed of calculations?
I tried different solvers, but all attempts failed, the problem took too long to solve.
VideoHello! Problem with calculation speed in Simulink.
I came across a video on YouTube comparing Simulink and another program. The Simulink solver spends an unreasonable amount of time solving the example I’ve attached below. For values of the constant greater than 1e7, the integration step decreases too much. Please tell me, is it possible to somehow increase the speed of calculations?
I tried different solvers, but all attempts failed, the problem took too long to solve.
Video Hello! Problem with calculation speed in Simulink.
I came across a video on YouTube comparing Simulink and another program. The Simulink solver spends an unreasonable amount of time solving the example I’ve attached below. For values of the constant greater than 1e7, the integration step decreases too much. Please tell me, is it possible to somehow increase the speed of calculations?
I tried different solvers, but all attempts failed, the problem took too long to solve.
Video simulink, ode45, ode, speed, differential equations, algorithm MATLAB Answers — New Questions
Why do I get Coverage error .
Why this error, Not able to highlight because model changed error during Coverage analysis
With every model I used.Why this error, Not able to highlight because model changed error during Coverage analysis
With every model I used. Why this error, Not able to highlight because model changed error during Coverage analysis
With every model I used. coverage, modeling properties, simulink MATLAB Answers — New Questions
How to create time derivative in PDE toolbox
I am working using PDE toolbox and I need one f coefficient to be a derivative of state.u wrt time – how can I do that?I am working using PDE toolbox and I need one f coefficient to be a derivative of state.u wrt time – how can I do that? I am working using PDE toolbox and I need one f coefficient to be a derivative of state.u wrt time – how can I do that? pde toolbox pde MATLAB Answers — New Questions
How to fix the jiggly issue
I am post-processing Abaqus data on Matlab. Overall the data looks good, however, in some areas it seems to be jiggly.
I’ve looked up for the causes, but couldn’t.
Help me please.I am post-processing Abaqus data on Matlab. Overall the data looks good, however, in some areas it seems to be jiggly.
I’ve looked up for the causes, but couldn’t.
Help me please. I am post-processing Abaqus data on Matlab. Overall the data looks good, however, in some areas it seems to be jiggly.
I’ve looked up for the causes, but couldn’t.
Help me please. postprocessing MATLAB Answers — New Questions
Hierarchical clustering with similarity matrix
Hi there,
I have a similarity matrix that I would like to use as the input of the function linkage. However, this takes as an input only the a dissimilarity/distance matrix. Do you know any way by which I can manage to run a hierarchical clustering in Matlab using my similarity matrix?
Cheers!Hi there,
I have a similarity matrix that I would like to use as the input of the function linkage. However, this takes as an input only the a dissimilarity/distance matrix. Do you know any way by which I can manage to run a hierarchical clustering in Matlab using my similarity matrix?
Cheers! Hi there,
I have a similarity matrix that I would like to use as the input of the function linkage. However, this takes as an input only the a dissimilarity/distance matrix. Do you know any way by which I can manage to run a hierarchical clustering in Matlab using my similarity matrix?
Cheers! hierarchical clustering, linkage, linkage function, similarity, similarity matrix, clustering MATLAB Answers — New Questions
PID block and manual PID
Hi:
I’m having a hard time understanding the difference between the PID block and the "manual" PID. For better understanding see the enclosed image. The gains are the same for both systems (same transfer function) but for some reason the result is not the same. What could be wrong?
<</matlabcentral/answers/uploaded_files/6343/Question.png>>Hi:
I’m having a hard time understanding the difference between the PID block and the "manual" PID. For better understanding see the enclosed image. The gains are the same for both systems (same transfer function) but for some reason the result is not the same. What could be wrong?
<</matlabcentral/answers/uploaded_files/6343/Question.png>> Hi:
I’m having a hard time understanding the difference between the PID block and the "manual" PID. For better understanding see the enclosed image. The gains are the same for both systems (same transfer function) but for some reason the result is not the same. What could be wrong?
<</matlabcentral/answers/uploaded_files/6343/Question.png>> simulink, pid MATLAB Answers — New Questions
Cannot run matlab R2023a orE2023b installer on centos 7.9
Package installer does not work (it hangs indefinitely), when trying to run bin/glnxa64/MATLABWindow I get (note this also happens with version 2023a):
user@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1088}$ ./MATLABWindow
[0914/181150.225297:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.225395:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.235757:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.235800:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.236932:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.237303:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.355055:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355064:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355129:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.355132:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.421408:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.421448:INFO:client_app.cpp(484)] Not appending enable-binary-transport
./MATLABWindow: symbol lookup error: /u/local/downloads/matlab/R2023b_temp/bin/glnxa64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
usr@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1089}$ [0100/000000.561825:WARNING:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.Package installer does not work (it hangs indefinitely), when trying to run bin/glnxa64/MATLABWindow I get (note this also happens with version 2023a):
user@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1088}$ ./MATLABWindow
[0914/181150.225297:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.225395:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.235757:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.235800:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.236932:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.237303:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.355055:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355064:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355129:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.355132:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.421408:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.421448:INFO:client_app.cpp(484)] Not appending enable-binary-transport
./MATLABWindow: symbol lookup error: /u/local/downloads/matlab/R2023b_temp/bin/glnxa64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
usr@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1089}$ [0100/000000.561825:WARNING:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process. Package installer does not work (it hangs indefinitely), when trying to run bin/glnxa64/MATLABWindow I get (note this also happens with version 2023a):
user@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1088}$ ./MATLABWindow
[0914/181150.225297:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.225395:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.235757:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.235800:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.236932:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.237303:INFO:client_app.cpp(484)] Not appending enable-binary-transport
[0914/181150.355055:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355064:INFO:client_app.cpp(421)] Dealing with user ID
[0914/181150.355129:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.355132:INFO:client_app.cpp(428)] Process is not running as root
[0914/181150.421408:INFO:client_app.cpp(478)] In ClientApp::OnBeforeChildProcessLaunch
[0914/181150.421448:INFO:client_app.cpp(484)] Not appending enable-binary-transport
./MATLABWindow: symbol lookup error: /u/local/downloads/matlab/R2023b_temp/bin/glnxa64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
usr@lm:/u/local/downloads/matlab/R2023b_temp/bin/glnxa64 {1089}$ [0100/000000.561825:WARNING:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process. installation, r2023a, r2023b MATLAB Answers — New Questions
How to optimize a bi-exponential signal fitting?
Hi everybody!
I’m trying to solve a fitting curve problem concerning a double-exponential fit.
I have this data set (Data.txt) that behaves like a bi-exponential function following a resting condition. Therefore, since x<0 the signal is almost steady whereas, for x>0 the signal presents a first exponential phase (lasting about 20 sec) followed by a second exponential phase.
The problem is that the resulting fitting does not model the signal behavior in the correct way. Specifically, the first exp phase is too short and/or too low even though correct StartingPoint and Upper and Lower limits are set.
Lastly, I’ve written two algorithms with and without "Exclude" options. The second one presents a strange pattern at the onset of the second exp function.
I’ll appreciate any suggestions.
This is the code.
[x, y] = readvars(‘prova.txt’);
tRest = abs(min(x)); % Resting phase duration (sec)
cdp = 20; % estimated duration (sec) of CardioDynamicPhase (cdp)
cdpEpoch = 5; % epoch duration (sec) to compute mean value of amplitude of cdp
plot(x,y);
% Fitting StartingPoint
yRest = mean( y(1:tRest-1) ); % y value at resting condition before exp onset
A1start = mean( y(1:tRest+cdp-cdpEpoch):y(tRest+cdp) )-yRest; % mean y value of the last 5sec of the cardiodynamic phase
TD1start = 0; % starting value (sec) of the first exponential phase onset
tau1Start = 8; % starting value (sec) of the first exponential phase time constant
A2start = max(y)-A1start-yRest; % starting value of the second exponential phase amplitude
TD2start = 30; % starting value (sec) of the second exponential phase onset
tau2Start = 30; % starting value (sec) of the second exponential phase time constant
% Fitting from exponential onset
g = fittype( @(A1, TD1, tau1, A2, TD2, tau2, yRest, x) yRest+A1.*(1-exp(-(x-TD1)/tau1))+A2.*(1-exp(-(x-TD2)/tau2)), ‘problem’, ‘yRest’);
f1 = fit( x(tRest:size(x,1)), y(tRest:size(x,1)), g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ A1start-100, 0, 5, A2start-200, 10, 10], ‘upper’, [ A1start+200, 20, 40, max(y), 60, 40], ‘MaxIter’, 10000);
pg =coeffvalues(f1);
A1 = pg(1);
TD1 = pg(2);
tau1 = pg(3);
A2 = pg(4);
TD2 = pg(5);
tau2 = pg(6);
yFit( 1:(tRest+floor(TD1)) ) = yRest;
yFit( tRest+floor(TD1)+1 : tRest+floor(TD2) ) = yRest + A1.*(1-exp(-( x(tRest+floor(TD1)+1 : tRest+floor(TD2))-TD1 )/tau1));
yFit( tRest+floor(TD2)+1 : size(y,1)) = yFit(tRest+floor(TD2))+ A2.*(1-exp(-( x(tRest+floor(TD2)+1 : size(y,1))-TD2 )/tau2));
% fitting using Exclude option
f2 = fit( x, y, g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ 390, 0, 5, A2start-200, 10, 10], ‘upper’, [ 400, 20, 40, max(y), 60, 40], ‘Exclude’, x<0); %Same fitting algortihm that exclude negative x values
pg2=coeffvalues(f2);
A1e = pg2(1);
TD1e = pg2(2);
tau1e = pg2(3);
A2e = pg2(4);
TD2e = pg2(5);
tau2e = pg2(6);
yFite( 1:(tRest+floor(TD1e)) ) = yRest;
yFite( tRest+floor(TD1e)+1 : tRest+floor(TD2e) ) = yRest + A1e.*(1-exp(-( x(tRest+floor(TD1e)+1 : tRest+floor(TD2e))-TD1e )/tau1e));
yFite( tRest+floor(TD2e)+1 : size(y,1)) = yFit(tRest+floor(TD2e))+ A2e.*(1-exp(-( x(tRest+floor(TD2e)+1 : size(y,1))-TD2e )/tau2e));
% Plot the fitting curves
hold on
plot (x, yFit, ‘r’);
plot (x, yFite, ‘k’);Hi everybody!
I’m trying to solve a fitting curve problem concerning a double-exponential fit.
I have this data set (Data.txt) that behaves like a bi-exponential function following a resting condition. Therefore, since x<0 the signal is almost steady whereas, for x>0 the signal presents a first exponential phase (lasting about 20 sec) followed by a second exponential phase.
The problem is that the resulting fitting does not model the signal behavior in the correct way. Specifically, the first exp phase is too short and/or too low even though correct StartingPoint and Upper and Lower limits are set.
Lastly, I’ve written two algorithms with and without "Exclude" options. The second one presents a strange pattern at the onset of the second exp function.
I’ll appreciate any suggestions.
This is the code.
[x, y] = readvars(‘prova.txt’);
tRest = abs(min(x)); % Resting phase duration (sec)
cdp = 20; % estimated duration (sec) of CardioDynamicPhase (cdp)
cdpEpoch = 5; % epoch duration (sec) to compute mean value of amplitude of cdp
plot(x,y);
% Fitting StartingPoint
yRest = mean( y(1:tRest-1) ); % y value at resting condition before exp onset
A1start = mean( y(1:tRest+cdp-cdpEpoch):y(tRest+cdp) )-yRest; % mean y value of the last 5sec of the cardiodynamic phase
TD1start = 0; % starting value (sec) of the first exponential phase onset
tau1Start = 8; % starting value (sec) of the first exponential phase time constant
A2start = max(y)-A1start-yRest; % starting value of the second exponential phase amplitude
TD2start = 30; % starting value (sec) of the second exponential phase onset
tau2Start = 30; % starting value (sec) of the second exponential phase time constant
% Fitting from exponential onset
g = fittype( @(A1, TD1, tau1, A2, TD2, tau2, yRest, x) yRest+A1.*(1-exp(-(x-TD1)/tau1))+A2.*(1-exp(-(x-TD2)/tau2)), ‘problem’, ‘yRest’);
f1 = fit( x(tRest:size(x,1)), y(tRest:size(x,1)), g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ A1start-100, 0, 5, A2start-200, 10, 10], ‘upper’, [ A1start+200, 20, 40, max(y), 60, 40], ‘MaxIter’, 10000);
pg =coeffvalues(f1);
A1 = pg(1);
TD1 = pg(2);
tau1 = pg(3);
A2 = pg(4);
TD2 = pg(5);
tau2 = pg(6);
yFit( 1:(tRest+floor(TD1)) ) = yRest;
yFit( tRest+floor(TD1)+1 : tRest+floor(TD2) ) = yRest + A1.*(1-exp(-( x(tRest+floor(TD1)+1 : tRest+floor(TD2))-TD1 )/tau1));
yFit( tRest+floor(TD2)+1 : size(y,1)) = yFit(tRest+floor(TD2))+ A2.*(1-exp(-( x(tRest+floor(TD2)+1 : size(y,1))-TD2 )/tau2));
% fitting using Exclude option
f2 = fit( x, y, g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ 390, 0, 5, A2start-200, 10, 10], ‘upper’, [ 400, 20, 40, max(y), 60, 40], ‘Exclude’, x<0); %Same fitting algortihm that exclude negative x values
pg2=coeffvalues(f2);
A1e = pg2(1);
TD1e = pg2(2);
tau1e = pg2(3);
A2e = pg2(4);
TD2e = pg2(5);
tau2e = pg2(6);
yFite( 1:(tRest+floor(TD1e)) ) = yRest;
yFite( tRest+floor(TD1e)+1 : tRest+floor(TD2e) ) = yRest + A1e.*(1-exp(-( x(tRest+floor(TD1e)+1 : tRest+floor(TD2e))-TD1e )/tau1e));
yFite( tRest+floor(TD2e)+1 : size(y,1)) = yFit(tRest+floor(TD2e))+ A2e.*(1-exp(-( x(tRest+floor(TD2e)+1 : size(y,1))-TD2e )/tau2e));
% Plot the fitting curves
hold on
plot (x, yFit, ‘r’);
plot (x, yFite, ‘k’); Hi everybody!
I’m trying to solve a fitting curve problem concerning a double-exponential fit.
I have this data set (Data.txt) that behaves like a bi-exponential function following a resting condition. Therefore, since x<0 the signal is almost steady whereas, for x>0 the signal presents a first exponential phase (lasting about 20 sec) followed by a second exponential phase.
The problem is that the resulting fitting does not model the signal behavior in the correct way. Specifically, the first exp phase is too short and/or too low even though correct StartingPoint and Upper and Lower limits are set.
Lastly, I’ve written two algorithms with and without "Exclude" options. The second one presents a strange pattern at the onset of the second exp function.
I’ll appreciate any suggestions.
This is the code.
[x, y] = readvars(‘prova.txt’);
tRest = abs(min(x)); % Resting phase duration (sec)
cdp = 20; % estimated duration (sec) of CardioDynamicPhase (cdp)
cdpEpoch = 5; % epoch duration (sec) to compute mean value of amplitude of cdp
plot(x,y);
% Fitting StartingPoint
yRest = mean( y(1:tRest-1) ); % y value at resting condition before exp onset
A1start = mean( y(1:tRest+cdp-cdpEpoch):y(tRest+cdp) )-yRest; % mean y value of the last 5sec of the cardiodynamic phase
TD1start = 0; % starting value (sec) of the first exponential phase onset
tau1Start = 8; % starting value (sec) of the first exponential phase time constant
A2start = max(y)-A1start-yRest; % starting value of the second exponential phase amplitude
TD2start = 30; % starting value (sec) of the second exponential phase onset
tau2Start = 30; % starting value (sec) of the second exponential phase time constant
% Fitting from exponential onset
g = fittype( @(A1, TD1, tau1, A2, TD2, tau2, yRest, x) yRest+A1.*(1-exp(-(x-TD1)/tau1))+A2.*(1-exp(-(x-TD2)/tau2)), ‘problem’, ‘yRest’);
f1 = fit( x(tRest:size(x,1)), y(tRest:size(x,1)), g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ A1start-100, 0, 5, A2start-200, 10, 10], ‘upper’, [ A1start+200, 20, 40, max(y), 60, 40], ‘MaxIter’, 10000);
pg =coeffvalues(f1);
A1 = pg(1);
TD1 = pg(2);
tau1 = pg(3);
A2 = pg(4);
TD2 = pg(5);
tau2 = pg(6);
yFit( 1:(tRest+floor(TD1)) ) = yRest;
yFit( tRest+floor(TD1)+1 : tRest+floor(TD2) ) = yRest + A1.*(1-exp(-( x(tRest+floor(TD1)+1 : tRest+floor(TD2))-TD1 )/tau1));
yFit( tRest+floor(TD2)+1 : size(y,1)) = yFit(tRest+floor(TD2))+ A2.*(1-exp(-( x(tRest+floor(TD2)+1 : size(y,1))-TD2 )/tau2));
% fitting using Exclude option
f2 = fit( x, y, g, ‘problem’, yRest, ‘StartPoint’, [A1start, TD1start, tau1Start, A2start, TD2start, tau2Start], ‘lower’ , [ 390, 0, 5, A2start-200, 10, 10], ‘upper’, [ 400, 20, 40, max(y), 60, 40], ‘Exclude’, x<0); %Same fitting algortihm that exclude negative x values
pg2=coeffvalues(f2);
A1e = pg2(1);
TD1e = pg2(2);
tau1e = pg2(3);
A2e = pg2(4);
TD2e = pg2(5);
tau2e = pg2(6);
yFite( 1:(tRest+floor(TD1e)) ) = yRest;
yFite( tRest+floor(TD1e)+1 : tRest+floor(TD2e) ) = yRest + A1e.*(1-exp(-( x(tRest+floor(TD1e)+1 : tRest+floor(TD2e))-TD1e )/tau1e));
yFite( tRest+floor(TD2e)+1 : size(y,1)) = yFit(tRest+floor(TD2e))+ A2e.*(1-exp(-( x(tRest+floor(TD2e)+1 : size(y,1))-TD2e )/tau2e));
% Plot the fitting curves
hold on
plot (x, yFit, ‘r’);
plot (x, yFite, ‘k’); signal fitting MATLAB Answers — New Questions
changes for MSK to GMSK in MATLAB example
Hi, In this example, what all changes we need to make for recovering a GMSK signal. openExample(‘comm/MSKSignalRecoveryInSimulinkExample’)
Im getting a high BER value. despite changing the GMSK modulator and demodulator, and GMSK tsignal timing recovery block.Hi, In this example, what all changes we need to make for recovering a GMSK signal. openExample(‘comm/MSKSignalRecoveryInSimulinkExample’)
Im getting a high BER value. despite changing the GMSK modulator and demodulator, and GMSK tsignal timing recovery block. Hi, In this example, what all changes we need to make for recovering a GMSK signal. openExample(‘comm/MSKSignalRecoveryInSimulinkExample’)
Im getting a high BER value. despite changing the GMSK modulator and demodulator, and GMSK tsignal timing recovery block. gmsk, msk, signal recovery, ber MATLAB Answers — New Questions
Error in port widths or dimensions.
Error in port widths or dimensions. Output port 1 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/From2’ is a one dimensional vector with 2 elements.
AND
Error in port widths or dimensions. Invalid dimension has been specified for input port 2 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/Mux’.
I am using MATLAB 2010a. problem occurred in the switching circuit of invert.
Anticipating your answers…
<</matlabcentral/answers/uploaded_files/38534/1.png>>
<</matlabcentral/answers/uploaded_files/38535/2.png>>Error in port widths or dimensions. Output port 1 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/From2’ is a one dimensional vector with 2 elements.
AND
Error in port widths or dimensions. Invalid dimension has been specified for input port 2 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/Mux’.
I am using MATLAB 2010a. problem occurred in the switching circuit of invert.
Anticipating your answers…
<</matlabcentral/answers/uploaded_files/38534/1.png>>
<</matlabcentral/answers/uploaded_files/38535/2.png>> Error in port widths or dimensions. Output port 1 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/From2’ is a one dimensional vector with 2 elements.
AND
Error in port widths or dimensions. Invalid dimension has been specified for input port 2 of ‘last/Subsystem/powergui/EquivalentModel1/Gates/Mux’.
I am using MATLAB 2010a. problem occurred in the switching circuit of invert.
Anticipating your answers…
<</matlabcentral/answers/uploaded_files/38534/1.png>>
<</matlabcentral/answers/uploaded_files/38535/2.png>> MATLAB Answers — New Questions