Category: Matlab
Category Archives: Matlab
How do I cross-compile for Linux on ARM using MATLAB Coder?
I have some MATLAB code that I would like to compile into a ".so" shared library with MATLAB Coder. MATLAB is running on my x86 Windows computer, but I would like the executable to run on an ARM board running Linux. How do generate and compile the code so it will run on the ARM board?I have some MATLAB code that I would like to compile into a ".so" shared library with MATLAB Coder. MATLAB is running on my x86 Windows computer, but I would like the executable to run on an ARM board running Linux. How do generate and compile the code so it will run on the ARM board? I have some MATLAB code that I would like to compile into a ".so" shared library with MATLAB Coder. MATLAB is running on my x86 Windows computer, but I would like the executable to run on an ARM board running Linux. How do generate and compile the code so it will run on the ARM board? matlab-coder, cross-compile, arm, linux, cmake MATLAB Answers — New Questions
What are the frequencies when N in fft(x,N) is odd?
I know when N is even, fft(x,N) corresponds to frequencies 0,df,…,N/2*df,-(N/2-2)*df,…,-df.
What about if N is odd?I know when N is even, fft(x,N) corresponds to frequencies 0,df,…,N/2*df,-(N/2-2)*df,…,-df.
What about if N is odd? I know when N is even, fft(x,N) corresponds to frequencies 0,df,…,N/2*df,-(N/2-2)*df,…,-df.
What about if N is odd? fft, frequency, spectrum MATLAB Answers — New Questions
Plot legend goes behing plot axes when using tiledlayout
I am generating several plots with legends on one figure using tiledlayout(). While the plot looks correct, the legends disappear behind the axes when I try to move them. The issue appears to be the same as described in this question, although I did not have any success with the fix:
Why does legend goes to the back of the axes box in multiplots if you click it or move it with the mouse?
The minimimum code that produces the issue is below. I get the same results when I omit the object handles.
t = tiledlayout(2, 1);
ax1 = nexttile(t);
pt1 = plot(ax1, 0:10, 0:10);
lg1 = legend(ax1, ‘Plot 1’);
ax2 = nexttile(t);
pt2 = plot(ax2, 0:10, 0:10);
lg2 = legend(ax2, ‘Plot 2’);I am generating several plots with legends on one figure using tiledlayout(). While the plot looks correct, the legends disappear behind the axes when I try to move them. The issue appears to be the same as described in this question, although I did not have any success with the fix:
Why does legend goes to the back of the axes box in multiplots if you click it or move it with the mouse?
The minimimum code that produces the issue is below. I get the same results when I omit the object handles.
t = tiledlayout(2, 1);
ax1 = nexttile(t);
pt1 = plot(ax1, 0:10, 0:10);
lg1 = legend(ax1, ‘Plot 1’);
ax2 = nexttile(t);
pt2 = plot(ax2, 0:10, 0:10);
lg2 = legend(ax2, ‘Plot 2’); I am generating several plots with legends on one figure using tiledlayout(). While the plot looks correct, the legends disappear behind the axes when I try to move them. The issue appears to be the same as described in this question, although I did not have any success with the fix:
Why does legend goes to the back of the axes box in multiplots if you click it or move it with the mouse?
The minimimum code that produces the issue is below. I get the same results when I omit the object handles.
t = tiledlayout(2, 1);
ax1 = nexttile(t);
pt1 = plot(ax1, 0:10, 0:10);
lg1 = legend(ax1, ‘Plot 1’);
ax2 = nexttile(t);
pt2 = plot(ax2, 0:10, 0:10);
lg2 = legend(ax2, ‘Plot 2’); plot, legend, tiledlayout, nexttile MATLAB Answers — New Questions
How do I extract Trajectory Data using NGSIM dataset?
It is required to extract trajectory data along with the frame number, vehicle ID, lane number, time, and position for the target vehicles in US-101 category of the Next Generation Simulation (NGSIM) dataset; however, after successfully reading the file with "data = readtable(‘pre-processing.csv’)", one proceeded to use "Features=[categorical(pre-processing.csv,trajectory)]", but was flagging an error, kindly help.It is required to extract trajectory data along with the frame number, vehicle ID, lane number, time, and position for the target vehicles in US-101 category of the Next Generation Simulation (NGSIM) dataset; however, after successfully reading the file with "data = readtable(‘pre-processing.csv’)", one proceeded to use "Features=[categorical(pre-processing.csv,trajectory)]", but was flagging an error, kindly help. It is required to extract trajectory data along with the frame number, vehicle ID, lane number, time, and position for the target vehicles in US-101 category of the Next Generation Simulation (NGSIM) dataset; however, after successfully reading the file with "data = readtable(‘pre-processing.csv’)", one proceeded to use "Features=[categorical(pre-processing.csv,trajectory)]", but was flagging an error, kindly help. matlab, ngsim, data, excel MATLAB Answers — New Questions
Portfolio optimization — estimateCustomObjectivePortfolio equivalent in R2021b?
Hello, Matlab community. I am working on a portfolio optimization exercise, and I’m looking for a way to incorporate a user-defined objective function in the usual Portfolio object workflow. The "estimateCustomObjectivePortfolio" function seems to be exactly what I need, but unfortunately it was introduced in R2022b. I am using a corporate R2021b Matlab license, so my IT department may not let me just upgrade to get the new functionality (I’m checking on that as well).
Assuming I have to live with R2021b for now, I’ll give you an example of what I’m trying to accomplish. Consider a fixed-income-only universe of asset classes, and durations for each:
– IG corporate duration = 7 years
– high yield corporate duration = 3 years
– treasury duration = 10 years
– etc.
In the portfolio optimization, I’d like to be able to have a stated duration target for the resulting portfolio. But, the duration of any hypothetical portfolio depends on the portfolio weights the optimizer is considering in any given iteration, and I don’t see a way (in my version of Matlab) to state that duration target as a constraint or objective.
Thanks in advance for any thoughts you may have.Hello, Matlab community. I am working on a portfolio optimization exercise, and I’m looking for a way to incorporate a user-defined objective function in the usual Portfolio object workflow. The "estimateCustomObjectivePortfolio" function seems to be exactly what I need, but unfortunately it was introduced in R2022b. I am using a corporate R2021b Matlab license, so my IT department may not let me just upgrade to get the new functionality (I’m checking on that as well).
Assuming I have to live with R2021b for now, I’ll give you an example of what I’m trying to accomplish. Consider a fixed-income-only universe of asset classes, and durations for each:
– IG corporate duration = 7 years
– high yield corporate duration = 3 years
– treasury duration = 10 years
– etc.
In the portfolio optimization, I’d like to be able to have a stated duration target for the resulting portfolio. But, the duration of any hypothetical portfolio depends on the portfolio weights the optimizer is considering in any given iteration, and I don’t see a way (in my version of Matlab) to state that duration target as a constraint or objective.
Thanks in advance for any thoughts you may have. Hello, Matlab community. I am working on a portfolio optimization exercise, and I’m looking for a way to incorporate a user-defined objective function in the usual Portfolio object workflow. The "estimateCustomObjectivePortfolio" function seems to be exactly what I need, but unfortunately it was introduced in R2022b. I am using a corporate R2021b Matlab license, so my IT department may not let me just upgrade to get the new functionality (I’m checking on that as well).
Assuming I have to live with R2021b for now, I’ll give you an example of what I’m trying to accomplish. Consider a fixed-income-only universe of asset classes, and durations for each:
– IG corporate duration = 7 years
– high yield corporate duration = 3 years
– treasury duration = 10 years
– etc.
In the portfolio optimization, I’d like to be able to have a stated duration target for the resulting portfolio. But, the duration of any hypothetical portfolio depends on the portfolio weights the optimizer is considering in any given iteration, and I don’t see a way (in my version of Matlab) to state that duration target as a constraint or objective.
Thanks in advance for any thoughts you may have. portfolio optimization, custom constraint MATLAB Answers — New Questions
Data normalization using robust scaling
Hello all, I am trying to implement "Robust Scaling" but I am confused. Should I use "all" parameter for "median" and "iqr" functions?
Thanks for the help.
DataSet = readtable(‘Datasets/Test.csv’);
DataSet = table2array(DataSet); % 7195 * 22
RScaling = (DataSet – median(DataSet))./iqr(DataSet)Hello all, I am trying to implement "Robust Scaling" but I am confused. Should I use "all" parameter for "median" and "iqr" functions?
Thanks for the help.
DataSet = readtable(‘Datasets/Test.csv’);
DataSet = table2array(DataSet); % 7195 * 22
RScaling = (DataSet – median(DataSet))./iqr(DataSet) Hello all, I am trying to implement "Robust Scaling" but I am confused. Should I use "all" parameter for "median" and "iqr" functions?
Thanks for the help.
DataSet = readtable(‘Datasets/Test.csv’);
DataSet = table2array(DataSet); % 7195 * 22
RScaling = (DataSet – median(DataSet))./iqr(DataSet) normalization MATLAB Answers — New Questions
MATLAB config file that loads variables at runtime
I would like to have a configuration file that acts similarly to a .config file that you would find in a C# program. Meaning I would like the variables in the config file to load into the application at runtime. I’m using the Application Compiler app to build the executable. I have tried having a text file with my config variables that is read at the beginning of the program, but it seems that these are only read when the application is compiled. I would like to compile/build the app only once, and have it read in the variables each time it runs. Is there a way for this to work within MATLAB?I would like to have a configuration file that acts similarly to a .config file that you would find in a C# program. Meaning I would like the variables in the config file to load into the application at runtime. I’m using the Application Compiler app to build the executable. I have tried having a text file with my config variables that is read at the beginning of the program, but it seems that these are only read when the application is compiled. I would like to compile/build the app only once, and have it read in the variables each time it runs. Is there a way for this to work within MATLAB? I would like to have a configuration file that acts similarly to a .config file that you would find in a C# program. Meaning I would like the variables in the config file to load into the application at runtime. I’m using the Application Compiler app to build the executable. I have tried having a text file with my config variables that is read at the beginning of the program, but it seems that these are only read when the application is compiled. I would like to compile/build the app only once, and have it read in the variables each time it runs. Is there a way for this to work within MATLAB? configuration, data import MATLAB Answers — New Questions
IR sensor and I2C display with Arduin uno
Hi,
I’m building my project with Arduino Uno and Matlab Simulink. In my project, I want the display to show the output on a 16×2 LCD and start counting milliseconds after the IR sensor detects the object. Also, I want the display to stop and keep the last second show up once the IR sensor detects the object again.Hi,
I’m building my project with Arduino Uno and Matlab Simulink. In my project, I want the display to show the output on a 16×2 LCD and start counting milliseconds after the IR sensor detects the object. Also, I want the display to stop and keep the last second show up once the IR sensor detects the object again. Hi,
I’m building my project with Arduino Uno and Matlab Simulink. In my project, I want the display to show the output on a 16×2 LCD and start counting milliseconds after the IR sensor detects the object. Also, I want the display to stop and keep the last second show up once the IR sensor detects the object again. simulink, project MATLAB Answers — New Questions
EPS Figure Not Saving As Vectorized Plot For Illustrator
I am trying to generate figures in matlab and save them as eps files to further edit them in adobe illustrator. When I open the eps plot in adobe illustrator it is not vectorized and is essentially just an image. Here is what it looks like in illustrator:I am trying to generate figures in matlab and save them as eps files to further edit them in adobe illustrator. When I open the eps plot in adobe illustrator it is not vectorized and is essentially just an image. Here is what it looks like in illustrator: I am trying to generate figures in matlab and save them as eps files to further edit them in adobe illustrator. When I open the eps plot in adobe illustrator it is not vectorized and is essentially just an image. Here is what it looks like in illustrator: eps, illustrator MATLAB Answers — New Questions
Command Window No Output
Upon typing anything into the command window, the answer is only outputted into the workspace, and not into the command window as the typically expected "ans = ___" line:
Even typing gibberish generates no output or any error handling. It just prompts the next line:
Running a program with internal error handling will work, but it seems things such as type errors or other MATLAB-handled errors are ignored, and there are no ways to generate outputs, unless I force it with disp(). But I obviously don’t want to keep doing that nor is that a viable solution going forward.
A coworker was trying to help me with this and we discovered that running "evalc" in the command window generates the same problem on his MATLAB as my current issue. I don’t remember ever running "evalc" unless I ran a script at some point that had that included. There seems to be no known solution out there for how to reverse the effect of this "evalc" and/or turn it off.Upon typing anything into the command window, the answer is only outputted into the workspace, and not into the command window as the typically expected "ans = ___" line:
Even typing gibberish generates no output or any error handling. It just prompts the next line:
Running a program with internal error handling will work, but it seems things such as type errors or other MATLAB-handled errors are ignored, and there are no ways to generate outputs, unless I force it with disp(). But I obviously don’t want to keep doing that nor is that a viable solution going forward.
A coworker was trying to help me with this and we discovered that running "evalc" in the command window generates the same problem on his MATLAB as my current issue. I don’t remember ever running "evalc" unless I ran a script at some point that had that included. There seems to be no known solution out there for how to reverse the effect of this "evalc" and/or turn it off. Upon typing anything into the command window, the answer is only outputted into the workspace, and not into the command window as the typically expected "ans = ___" line:
Even typing gibberish generates no output or any error handling. It just prompts the next line:
Running a program with internal error handling will work, but it seems things such as type errors or other MATLAB-handled errors are ignored, and there are no ways to generate outputs, unless I force it with disp(). But I obviously don’t want to keep doing that nor is that a viable solution going forward.
A coworker was trying to help me with this and we discovered that running "evalc" in the command window generates the same problem on his MATLAB as my current issue. I don’t remember ever running "evalc" unless I ran a script at some point that had that included. There seems to be no known solution out there for how to reverse the effect of this "evalc" and/or turn it off. command window, output, evalc MATLAB Answers — New Questions
how to find code of power sharing between fuel cell and battery written in FCEV reference examples
Please guide me how I am able to find code of power sharing between fuel cell and battery written in controller of FCEV refernces example in MATLAB 2022Please guide me how I am able to find code of power sharing between fuel cell and battery written in controller of FCEV refernces example in MATLAB 2022 Please guide me how I am able to find code of power sharing between fuel cell and battery written in controller of FCEV refernces example in MATLAB 2022 code generation MATLAB Answers — New Questions
Symbolic expression simplification and shortening
I have an extremely long symbolic expression after simplification which I am unable to simplify further. I want to know how to reduce the expression further, or to find repeating sub expressions inside the expression which can be replaced by another variable?
For an example, my expression looks somewhat like this:
U =
108*A^2*e^7*e1^3*e2^7*h2^4 + 153*A^2*e^7*e1^5*e2^7*h2^2 + 108*A^2*e^7*e1^7*e2^3*h3^4 + 153*A^2*e^7*e1^7*e2^5*h3^2 +…
24*B^2*e^3*e1^7*e2^7*h1^4 + 95*B^2*e^5*e1^7*e2^7*h1^2 + 24*B^2*e^7*e1^3*e2^7*h2^4 + 95*B^2*e^7*e1^5*e2^7*h2^2 + …
24*B^2*e^7*e1^7*e2^3*h3^4 + 95*B^2*e^7*e1^7*e2^5*h3^2 + 9*A^2*e^2*e1^7*h1^5*h3^7 + 9*A^2*e^2*e2^7*h1^5*h2^7 +…
9*A^2*e1^2*e2^7*h1^7*h2^5 + 9*A^2*e^7*e1^2*h2^5*h3^7 + 9*A^2*e^7*e2^2*h2^7*h3^5 + 9*A^2*e1^7*e2^2*h1^7*h3^5 -…
41*B^2*e^2*e1^7*h1^5*h3^7 – 41*B^2*e^2*e2^7*h1^5*h2^7 – 12*B^2*e^4*e1^7*h1^3*h3^7 – 12*B^2*e^4*e2^7*h1^3*h2^7 -….
41*B^2*e1^2*e2^7*h1^7*h2^5 – 12*B^2*e1^4*e2^7*h1^7*h2^3 – 41*B^2*e^7*e1^2*h2^5*h3^7 – 12*B^2*e^7*e1^4*h2^3*h3^7 – …
41*B^2*e^7*e2^2*h2^7*h3^5 – 12*B^2*e^7*e2^4*h2^7*h3^3 – 41*B^2*e1^7*e2^2*h1^7*h3^5 – 12*B^2*e1^7*e2^4*h1^7*h3^3 -…
504*A^2*e^3*h1^4*h2^7*h3^7 + 9*A^2*e^5*h1^2*h2^7*h3^7 – 504*A^2*e1^3*h1^7*h2^4*h3^7 + 9*A^2*e1^5*h1^7*h2^2*h3^7 -…
504*A^2*e2^3*h1^7*h2^7*h3^4 + 9*A^2*e2^5*h1^7*h2^7*h3^2 + 2860*B^2*e^3*h1^4*h2^7*h3^7 – 377*B^2*e^5*h1^2*h2^7*h3^7 +…
2860*B^2*e1^3*h1^7*h2^4*h3^7 – 377*B^2*e1^5*h1^7*h2^2*h3^7 + 2860*B^2*e2^3*h1^7*h2^7*h3^4 – 377*B^2*e2^5*h1^7*h2^7*h3^2 +…
162*A*B*e^7*e1^7*e2^7 – 6*A*B*e^7*h2^7*h3^7 – 6*A*B*e1^7*h1^7*h3^7 – 6*A*B*e2^7*h1^7*h2^7 + 1944*A^2*e*h1^6*h2^7*h3^7 + …
1944*A^2*e1*h1^7*h2^6*h3^7 + 1944*A^2*e2*h1^7*h2^7*h3^6 – 5400*B^2*e*h1^6*h2^7*h3^7 – 5400*B^2*e1*h1^7*h2^6*h3^7 -…
245*B^2*e^6*e1^7*e2^4*h1*h3^3 + 147*B^2*e^7*e1*e2^3*h2^6*h3^4 + 48*B^2*e^7*e1*e2^5*h2^6*h3^2 – 60*B^2*e^7*e1^2*e2^6*h2^5*h3 + …
147*B^2*e^7*e1^3*e2*h2^4*h3^6 – 245*B^2*e^7*e1^4*e2^6*h2^3*h3 + 48*B^2*e^7*e1^5*e2*h2^2*h3^6 – 60*B^2*e^7*e1^6*e2^2*h2*h3^5 -…
where e , e1, e2, h1, h2, h3, A, B are the symbolic variables.I have an extremely long symbolic expression after simplification which I am unable to simplify further. I want to know how to reduce the expression further, or to find repeating sub expressions inside the expression which can be replaced by another variable?
For an example, my expression looks somewhat like this:
U =
108*A^2*e^7*e1^3*e2^7*h2^4 + 153*A^2*e^7*e1^5*e2^7*h2^2 + 108*A^2*e^7*e1^7*e2^3*h3^4 + 153*A^2*e^7*e1^7*e2^5*h3^2 +…
24*B^2*e^3*e1^7*e2^7*h1^4 + 95*B^2*e^5*e1^7*e2^7*h1^2 + 24*B^2*e^7*e1^3*e2^7*h2^4 + 95*B^2*e^7*e1^5*e2^7*h2^2 + …
24*B^2*e^7*e1^7*e2^3*h3^4 + 95*B^2*e^7*e1^7*e2^5*h3^2 + 9*A^2*e^2*e1^7*h1^5*h3^7 + 9*A^2*e^2*e2^7*h1^5*h2^7 +…
9*A^2*e1^2*e2^7*h1^7*h2^5 + 9*A^2*e^7*e1^2*h2^5*h3^7 + 9*A^2*e^7*e2^2*h2^7*h3^5 + 9*A^2*e1^7*e2^2*h1^7*h3^5 -…
41*B^2*e^2*e1^7*h1^5*h3^7 – 41*B^2*e^2*e2^7*h1^5*h2^7 – 12*B^2*e^4*e1^7*h1^3*h3^7 – 12*B^2*e^4*e2^7*h1^3*h2^7 -….
41*B^2*e1^2*e2^7*h1^7*h2^5 – 12*B^2*e1^4*e2^7*h1^7*h2^3 – 41*B^2*e^7*e1^2*h2^5*h3^7 – 12*B^2*e^7*e1^4*h2^3*h3^7 – …
41*B^2*e^7*e2^2*h2^7*h3^5 – 12*B^2*e^7*e2^4*h2^7*h3^3 – 41*B^2*e1^7*e2^2*h1^7*h3^5 – 12*B^2*e1^7*e2^4*h1^7*h3^3 -…
504*A^2*e^3*h1^4*h2^7*h3^7 + 9*A^2*e^5*h1^2*h2^7*h3^7 – 504*A^2*e1^3*h1^7*h2^4*h3^7 + 9*A^2*e1^5*h1^7*h2^2*h3^7 -…
504*A^2*e2^3*h1^7*h2^7*h3^4 + 9*A^2*e2^5*h1^7*h2^7*h3^2 + 2860*B^2*e^3*h1^4*h2^7*h3^7 – 377*B^2*e^5*h1^2*h2^7*h3^7 +…
2860*B^2*e1^3*h1^7*h2^4*h3^7 – 377*B^2*e1^5*h1^7*h2^2*h3^7 + 2860*B^2*e2^3*h1^7*h2^7*h3^4 – 377*B^2*e2^5*h1^7*h2^7*h3^2 +…
162*A*B*e^7*e1^7*e2^7 – 6*A*B*e^7*h2^7*h3^7 – 6*A*B*e1^7*h1^7*h3^7 – 6*A*B*e2^7*h1^7*h2^7 + 1944*A^2*e*h1^6*h2^7*h3^7 + …
1944*A^2*e1*h1^7*h2^6*h3^7 + 1944*A^2*e2*h1^7*h2^7*h3^6 – 5400*B^2*e*h1^6*h2^7*h3^7 – 5400*B^2*e1*h1^7*h2^6*h3^7 -…
245*B^2*e^6*e1^7*e2^4*h1*h3^3 + 147*B^2*e^7*e1*e2^3*h2^6*h3^4 + 48*B^2*e^7*e1*e2^5*h2^6*h3^2 – 60*B^2*e^7*e1^2*e2^6*h2^5*h3 + …
147*B^2*e^7*e1^3*e2*h2^4*h3^6 – 245*B^2*e^7*e1^4*e2^6*h2^3*h3 + 48*B^2*e^7*e1^5*e2*h2^2*h3^6 – 60*B^2*e^7*e1^6*e2^2*h2*h3^5 -…
where e , e1, e2, h1, h2, h3, A, B are the symbolic variables. I have an extremely long symbolic expression after simplification which I am unable to simplify further. I want to know how to reduce the expression further, or to find repeating sub expressions inside the expression which can be replaced by another variable?
For an example, my expression looks somewhat like this:
U =
108*A^2*e^7*e1^3*e2^7*h2^4 + 153*A^2*e^7*e1^5*e2^7*h2^2 + 108*A^2*e^7*e1^7*e2^3*h3^4 + 153*A^2*e^7*e1^7*e2^5*h3^2 +…
24*B^2*e^3*e1^7*e2^7*h1^4 + 95*B^2*e^5*e1^7*e2^7*h1^2 + 24*B^2*e^7*e1^3*e2^7*h2^4 + 95*B^2*e^7*e1^5*e2^7*h2^2 + …
24*B^2*e^7*e1^7*e2^3*h3^4 + 95*B^2*e^7*e1^7*e2^5*h3^2 + 9*A^2*e^2*e1^7*h1^5*h3^7 + 9*A^2*e^2*e2^7*h1^5*h2^7 +…
9*A^2*e1^2*e2^7*h1^7*h2^5 + 9*A^2*e^7*e1^2*h2^5*h3^7 + 9*A^2*e^7*e2^2*h2^7*h3^5 + 9*A^2*e1^7*e2^2*h1^7*h3^5 -…
41*B^2*e^2*e1^7*h1^5*h3^7 – 41*B^2*e^2*e2^7*h1^5*h2^7 – 12*B^2*e^4*e1^7*h1^3*h3^7 – 12*B^2*e^4*e2^7*h1^3*h2^7 -….
41*B^2*e1^2*e2^7*h1^7*h2^5 – 12*B^2*e1^4*e2^7*h1^7*h2^3 – 41*B^2*e^7*e1^2*h2^5*h3^7 – 12*B^2*e^7*e1^4*h2^3*h3^7 – …
41*B^2*e^7*e2^2*h2^7*h3^5 – 12*B^2*e^7*e2^4*h2^7*h3^3 – 41*B^2*e1^7*e2^2*h1^7*h3^5 – 12*B^2*e1^7*e2^4*h1^7*h3^3 -…
504*A^2*e^3*h1^4*h2^7*h3^7 + 9*A^2*e^5*h1^2*h2^7*h3^7 – 504*A^2*e1^3*h1^7*h2^4*h3^7 + 9*A^2*e1^5*h1^7*h2^2*h3^7 -…
504*A^2*e2^3*h1^7*h2^7*h3^4 + 9*A^2*e2^5*h1^7*h2^7*h3^2 + 2860*B^2*e^3*h1^4*h2^7*h3^7 – 377*B^2*e^5*h1^2*h2^7*h3^7 +…
2860*B^2*e1^3*h1^7*h2^4*h3^7 – 377*B^2*e1^5*h1^7*h2^2*h3^7 + 2860*B^2*e2^3*h1^7*h2^7*h3^4 – 377*B^2*e2^5*h1^7*h2^7*h3^2 +…
162*A*B*e^7*e1^7*e2^7 – 6*A*B*e^7*h2^7*h3^7 – 6*A*B*e1^7*h1^7*h3^7 – 6*A*B*e2^7*h1^7*h2^7 + 1944*A^2*e*h1^6*h2^7*h3^7 + …
1944*A^2*e1*h1^7*h2^6*h3^7 + 1944*A^2*e2*h1^7*h2^7*h3^6 – 5400*B^2*e*h1^6*h2^7*h3^7 – 5400*B^2*e1*h1^7*h2^6*h3^7 -…
245*B^2*e^6*e1^7*e2^4*h1*h3^3 + 147*B^2*e^7*e1*e2^3*h2^6*h3^4 + 48*B^2*e^7*e1*e2^5*h2^6*h3^2 – 60*B^2*e^7*e1^2*e2^6*h2^5*h3 + …
147*B^2*e^7*e1^3*e2*h2^4*h3^6 – 245*B^2*e^7*e1^4*e2^6*h2^3*h3 + 48*B^2*e^7*e1^5*e2*h2^2*h3^6 – 60*B^2*e^7*e1^6*e2^2*h2*h3^5 -…
where e , e1, e2, h1, h2, h3, A, B are the symbolic variables. symbolic, expr, collect, simplify MATLAB Answers — New Questions
Rename TIF files in a folder
Hi. I have 21841 TIF format files (in a folder) with names like: Camera_6_100fps_20240403_0956560001, and so to Camera_6_100fps_20240403_09565621841. I want to rename them to the format Camera60001 so on to Camera621841. I have tried a for loop but did not succeed. Can someone please help me with this.
Thanks.Hi. I have 21841 TIF format files (in a folder) with names like: Camera_6_100fps_20240403_0956560001, and so to Camera_6_100fps_20240403_09565621841. I want to rename them to the format Camera60001 so on to Camera621841. I have tried a for loop but did not succeed. Can someone please help me with this.
Thanks. Hi. I have 21841 TIF format files (in a folder) with names like: Camera_6_100fps_20240403_0956560001, and so to Camera_6_100fps_20240403_09565621841. I want to rename them to the format Camera60001 so on to Camera621841. I have tried a for loop but did not succeed. Can someone please help me with this.
Thanks. rename, tif files, matlab MATLAB Answers — New Questions
Calling the code behind PushButton Pressed Event
Hello, Im using appdesigner and want to call the code thats behind a pushButtom pressed event:
function GetSingleSpectrumButtonPushed(app, event)
%my Code
How would I call this code without pushing the push buttonHello, Im using appdesigner and want to call the code thats behind a pushButtom pressed event:
function GetSingleSpectrumButtonPushed(app, event)
%my Code
How would I call this code without pushing the push button Hello, Im using appdesigner and want to call the code thats behind a pushButtom pressed event:
function GetSingleSpectrumButtonPushed(app, event)
%my Code
How would I call this code without pushing the push button pushbutton, event MATLAB Answers — New Questions
How to Create an Android App to Collect Accelerometer Data and Process with MATLAB Script?
Hi everyone,
I have a MATLAB script that processes data from a CSV file containing linear accelerometer data and generates a result. I need to develop an Android app that performs the following steps:
Press a button to start.
Wait for 10 seconds.
Collect linear accelerometer data for 30 seconds and save it to a CSV file.
Once the CSV file is created, apply the MATLAB script to the file and return specific results.
Is it possible to achieve this with any MATLAB add-ons, or is there a way to execute MATLAB scripts from Kotlin in Android Studio?
Thank you very much for your help!Hi everyone,
I have a MATLAB script that processes data from a CSV file containing linear accelerometer data and generates a result. I need to develop an Android app that performs the following steps:
Press a button to start.
Wait for 10 seconds.
Collect linear accelerometer data for 30 seconds and save it to a CSV file.
Once the CSV file is created, apply the MATLAB script to the file and return specific results.
Is it possible to achieve this with any MATLAB add-ons, or is there a way to execute MATLAB scripts from Kotlin in Android Studio?
Thank you very much for your help! Hi everyone,
I have a MATLAB script that processes data from a CSV file containing linear accelerometer data and generates a result. I need to develop an Android app that performs the following steps:
Press a button to start.
Wait for 10 seconds.
Collect linear accelerometer data for 30 seconds and save it to a CSV file.
Once the CSV file is created, apply the MATLAB script to the file and return specific results.
Is it possible to achieve this with any MATLAB add-ons, or is there a way to execute MATLAB scripts from Kotlin in Android Studio?
Thank you very much for your help! transferred MATLAB Answers — New Questions
How do I check if there is a function with the same name
In addition to the functions that come with matlab, I have added some additional toolboxes, so I want to make sure that there are more than one function with the same name in my directory, who can teach me.In addition to the functions that come with matlab, I have added some additional toolboxes, so I want to make sure that there are more than one function with the same name in my directory, who can teach me. In addition to the functions that come with matlab, I have added some additional toolboxes, so I want to make sure that there are more than one function with the same name in my directory, who can teach me. function MATLAB Answers — New Questions
How can I verify an isomorphism relation between two graphs that join cube and octahedron vertices?
I have two sets of nodes, corresponding to the vertices of the cube (S1 = {1,…,8}) and the octahedron (S2 = {1,…,6}), respectively. I construct each graph G joining vertices of S_1 to vertices of S_2. Having two graphs G_1 and G_2, how can I check if there is an isomorphism relation between these two graphs?I have two sets of nodes, corresponding to the vertices of the cube (S1 = {1,…,8}) and the octahedron (S2 = {1,…,6}), respectively. I construct each graph G joining vertices of S_1 to vertices of S_2. Having two graphs G_1 and G_2, how can I check if there is an isomorphism relation between these two graphs? I have two sets of nodes, corresponding to the vertices of the cube (S1 = {1,…,8}) and the octahedron (S2 = {1,…,6}), respectively. I construct each graph G joining vertices of S_1 to vertices of S_2. Having two graphs G_1 and G_2, how can I check if there is an isomorphism relation between these two graphs? isomorphism, graph, graph theory MATLAB Answers — New Questions
Why is the MATLAB Editor blank when opening files synced with Dropbox on Mac?
I am having trouble opening MATLAB files from a Dropbox folder. After launching MATLAB via the desktop icon, attempting to open a file within MATLAB by double-clicking or using Home > Open results in a blank/white MATLAB Editor. This issue only occurs with files previously synced with Dropbox and does not occur with new files saved to the Dropbox folder. Why does this issue occur with files previously synced with Dropbox?I am having trouble opening MATLAB files from a Dropbox folder. After launching MATLAB via the desktop icon, attempting to open a file within MATLAB by double-clicking or using Home > Open results in a blank/white MATLAB Editor. This issue only occurs with files previously synced with Dropbox and does not occur with new files saved to the Dropbox folder. Why does this issue occur with files previously synced with Dropbox? I am having trouble opening MATLAB files from a Dropbox folder. After launching MATLAB via the desktop icon, attempting to open a file within MATLAB by double-clicking or using Home > Open results in a blank/white MATLAB Editor. This issue only occurs with files previously synced with Dropbox and does not occur with new files saved to the Dropbox folder. Why does this issue occur with files previously synced with Dropbox? blank, editor, dropbox MATLAB Answers — New Questions
How to produce an array that displays the common data values in other arrays?
I am trying to find a way to make a resulting array that displays all of the common values (in the same row/colomn) that multiple arrays share. I attached an example photo to explain what I mean. So, as you can see in the photo, I am trying to produce the resulting array called "Total" by using the shared values from A, B, and C.I am trying to find a way to make a resulting array that displays all of the common values (in the same row/colomn) that multiple arrays share. I attached an example photo to explain what I mean. So, as you can see in the photo, I am trying to produce the resulting array called "Total" by using the shared values from A, B, and C. I am trying to find a way to make a resulting array that displays all of the common values (in the same row/colomn) that multiple arrays share. I attached an example photo to explain what I mean. So, as you can see in the photo, I am trying to produce the resulting array called "Total" by using the shared values from A, B, and C. arrays, shared values, common values MATLAB Answers — New Questions
Nearfield Focusing, propagating a field with a known spatial field phase
Hello,
There is a fantastic page demonstrating near field focusing using the Phased Array toolbox located here: https://www.mathworks.com/help/phased/ug/examine-the-response-of-a-focused-array.html
These example use an array of emitters to define the excitation that then solves into the near field focused field. If we have an already spatially-defined complex wave input field, is there a way to propagate the field in the same way to show it focusing? Or is it possible to ‘fake’ the field using an array of closely spaced emitters and weights?Hello,
There is a fantastic page demonstrating near field focusing using the Phased Array toolbox located here: https://www.mathworks.com/help/phased/ug/examine-the-response-of-a-focused-array.html
These example use an array of emitters to define the excitation that then solves into the near field focused field. If we have an already spatially-defined complex wave input field, is there a way to propagate the field in the same way to show it focusing? Or is it possible to ‘fake’ the field using an array of closely spaced emitters and weights? Hello,
There is a fantastic page demonstrating near field focusing using the Phased Array toolbox located here: https://www.mathworks.com/help/phased/ug/examine-the-response-of-a-focused-array.html
These example use an array of emitters to define the excitation that then solves into the near field focused field. If we have an already spatially-defined complex wave input field, is there a way to propagate the field in the same way to show it focusing? Or is it possible to ‘fake’ the field using an array of closely spaced emitters and weights? near-field focusing, near-field, field propagation MATLAB Answers — New Questions