I am Application Support Engineer at MathWorks.

Disclaimer: Any arlticles/ ideas/ opinions here are my own and in no way reflect that of MathWorks.

Answered

Fit a function with respect to a cost function

Hi, Since you are not trying to minimise or maximise anything here, you do not need to use fmincon function. You want to find v...

Fit a function with respect to a cost function

Hi, Since you are not trying to minimise or maximise anything here, you do not need to use fmincon function. You want to find v...

alrededor de 1 mes ago | 0

Answered

Repeated values in matrix

Hi, You can define a variable called freq, to store the frequency of the a number. Frequency of number is stored in index. Yo...

Repeated values in matrix

Hi, You can define a variable called freq, to store the frequency of the a number. Frequency of number is stored in index. Yo...

alrededor de 1 mes ago | 1

| accepted

Answered

inputparser mistakes option for value

Hi, Adding to what ARK has said, You can see the difference between functions like addRequired , addOptional and addParameter i...

inputparser mistakes option for value

Hi, Adding to what ARK has said, You can see the difference between functions like addRequired , addOptional and addParameter i...

alrededor de 1 mes ago | 0

| accepted

Answered

I want to mirror my signal over the y axis and make 4 repetitions of it

Hi, After calling the fft function, you are removing half of the values from variable X. That is the reason you are not seeing ...

I want to mirror my signal over the y axis and make 4 repetitions of it

Hi, After calling the fft function, you are removing half of the values from variable X. That is the reason you are not seeing ...

alrededor de 1 mes ago | 0

| accepted

Answered

Index exceeds the number of array elements (30093)

Hi, In the 19th line that contains the below line in your code, field_data_stim = field_data(stim_start(i):stim_start(i)+499);...

Index exceeds the number of array elements (30093)

Hi, In the 19th line that contains the below line in your code, field_data_stim = field_data(stim_start(i):stim_start(i)+499);...

alrededor de 1 mes ago | 1

| accepted

Answered

Dimensional Problem with simple coefficient equation

Hi, For two summations, you will need two for loops. Also , you are not accumulating the sum. Variable gini is getting new valu...

Dimensional Problem with simple coefficient equation

Hi, For two summations, you will need two for loops. Also , you are not accumulating the sum. Variable gini is getting new valu...

alrededor de 2 meses ago | 0

| accepted

Answered

Change plot interaction mode on the fly

Hi, when you click on the mouse, you are selecting pan mode. So you have to click again for the callback function in the pan to...

Change plot interaction mode on the fly

Hi, when you click on the mouse, you are selecting pan mode. So you have to click again for the callback function in the pan to...

alrededor de 2 meses ago | 0

Answered

How can I sepearte these two spehrical Objects - Earth and Moon - to get one Moon and one Earth? So far I get two Moon's or either two Earth

Hi, When you are executing the below line, It is returning both the Earth's surface plot and Moon's surface plot. So you are ed...

How can I sepearte these two spehrical Objects - Earth and Moon - to get one Moon and one Earth? So far I get two Moon's or either two Earth

Hi, When you are executing the below line, It is returning both the Earth's surface plot and Moon's surface plot. So you are ed...

alrededor de 2 meses ago | 1

| accepted

Answered

Using parfor to parallelyze finite difference scheme

Hi, parfor doesn't always speeds up the execution time. Sometimes the parallel overhead will be so big that it outweighs the ad...

Using parfor to parallelyze finite difference scheme

Hi, parfor doesn't always speeds up the execution time. Sometimes the parallel overhead will be so big that it outweighs the ad...

alrededor de 2 meses ago | 0

Answered

I would like to draw a graph with the import of the date in abscisse

Hi, You can use import tool to import the data. Import it as a table. You can set the column names while importing. You can ex...

I would like to draw a graph with the import of the date in abscisse

Hi, You can use import tool to import the data. Import it as a table. You can set the column names while importing. You can ex...

alrededor de 2 meses ago | 0

Answered

Integration of Known Dataset to specific value

Hi, You can use cumtrapz function for this. You can find the documentation for this function here. It basically gives you the ...

Integration of Known Dataset to specific value

Hi, You can use cumtrapz function for this. You can find the documentation for this function here. It basically gives you the ...

alrededor de 2 meses ago | 0

Answered

Buttons in App Designer and User Prompt Input

Hi, You need to add buttons with appropriate labels and use the callback functionality of the buttons to take the input. Here...

Buttons in App Designer and User Prompt Input

Hi, You need to add buttons with appropriate labels and use the callback functionality of the buttons to take the input. Here...

3 meses ago | 0

Answered

How to drop small terms in symbolic expression?

Hi, You can use conditional indexing this a={1; 2; 3; 4; 5}; a(cell2mat(a)>3)={0} Hope this helps.

How to drop small terms in symbolic expression?

Hi, You can use conditional indexing this a={1; 2; 3; 4; 5}; a(cell2mat(a)>3)={0} Hope this helps.

3 meses ago | 0

Answered

How to upload new values from Workspace to simulink in real time?

Hi, You can use from workspace block to do this. You need to build a variable with first column with time values and use other ...

How to upload new values from Workspace to simulink in real time?

Hi, You can use from workspace block to do this. You need to build a variable with first column with time values and use other ...

3 meses ago | 0

Answered

How to reduce the Run time and improve the performance of my code

Hi, Instead of the last for-loop, you can do this: maxDev0_0=max(maxDev(RotSpeed(j) > 0.1 && RotSpeed(j)<= 1)); %this is for t...

How to reduce the Run time and improve the performance of my code

Hi, Instead of the last for-loop, you can do this: maxDev0_0=max(maxDev(RotSpeed(j) > 0.1 && RotSpeed(j)<= 1)); %this is for t...

3 meses ago | 0

Answered

Balloon Ascent and Descent

Hi, You can introduce another variable for denoting time. let's say t is such variable. You can use while loop and increment ...

Balloon Ascent and Descent

Hi, You can introduce another variable for denoting time. let's say t is such variable. You can use while loop and increment ...

3 meses ago | 0

Answered

Simulation of Dynamic Response (Aircraft)

Hi, You need to use state-space block and give the A and B matrices as the parameters for the block. Hope this helps.

Simulation of Dynamic Response (Aircraft)

Hi, You need to use state-space block and give the A and B matrices as the parameters for the block. Hope this helps.

4 meses ago | 0

Answered

Difference between lines coding

Hi, In the HW2W1.m file, you have (W1X,W1Y) and (W1xCI,WlyCL) variables(from HW2_P1_W1.txt). so you want to find the difference...

Difference between lines coding

Hi, In the HW2W1.m file, you have (W1X,W1Y) and (W1xCI,WlyCL) variables(from HW2_P1_W1.txt). so you want to find the difference...

4 meses ago | 0

Answered

Skipping data of an ECG signal

Hi, as from my understanding, you have a matrix of data and you want to select some rows based on some conditions. you can do t...

Skipping data of an ECG signal

Hi, as from my understanding, you have a matrix of data and you want to select some rows based on some conditions. you can do t...

4 meses ago | 0

| accepted

Answered

How do I isolate certain portions of my data in a time series?

Hi, there is a way to extract elements from the matrix based on some predefined conditions. please refer this answer for the s...

How do I isolate certain portions of my data in a time series?

Hi, there is a way to extract elements from the matrix based on some predefined conditions. please refer this answer for the s...

4 meses ago | 0

Answered

"Index exceeds array dimensions. Index value 2 exceeds valid range [1-1] for array" --How to solve this?

Hi, The error you mentioned occurs when you try to access an array element which is out of it's length. If you are trying to u...

"Index exceeds array dimensions. Index value 2 exceeds valid range [1-1] for array" --How to solve this?

Hi, The error you mentioned occurs when you try to access an array element which is out of it's length. If you are trying to u...

4 meses ago | 1

Answered

How to convert waveform in the binary raw format ?

Hi, you can export the waveform data raw binary format like this: fid = fopen('YourOutputFile.raw', 'w'); fwrite(fid, x, clas...

How to convert waveform in the binary raw format ?

Hi, you can export the waveform data raw binary format like this: fid = fopen('YourOutputFile.raw', 'w'); fwrite(fid, x, clas...

4 meses ago | 1

| accepted

Answered

Fill 2d array with serial data from an arduino.

Hi, you can assign the array data you are getting from arduino to a 16X1 array and use reshape function to change it to 4X4 mat...

Fill 2d array with serial data from an arduino.

Hi, you can assign the array data you are getting from arduino to a 16X1 array and use reshape function to change it to 4X4 mat...

4 meses ago | 0

Answered

How to segment/timestamp time series data based on GMT unix epoch values

Hi, let A= [ 1 10; 2 20; 3 30; 4 40;] if you want to select data values(2nd column) for time whic...

How to segment/timestamp time series data based on GMT unix epoch values

Hi, let A= [ 1 10; 2 20; 3 30; 4 40;] if you want to select data values(2nd column) for time whic...

4 meses ago | 0

Answered

Converting values in eigenvector to rational forms that include square roots

Hi, you need to use sym command to convert matrix A to a symbolic variable. you can find the examples of sym command usage and ...

Converting values in eigenvector to rational forms that include square roots

Hi, you need to use sym command to convert matrix A to a symbolic variable. you can find the examples of sym command usage and ...

4 meses ago | 1

| accepted

Answered

Algorithm to solve a system of two equations and a set of constraints

Hi, you can use solve function to do this. the documentation for this function and the examples can be found here. Hope this h...

Algorithm to solve a system of two equations and a set of constraints

Hi, you can use solve function to do this. the documentation for this function and the examples can be found here. Hope this h...

4 meses ago | 0

Answered

Difference Between Ackermann Kinematic Model and Bicycle Kinematic Model

Hi, There will be difference in the outputs of Ackermann Kinematic Model block and Bicycle Kinematic block. The working of ...

Difference Between Ackermann Kinematic Model and Bicycle Kinematic Model

Hi, There will be difference in the outputs of Ackermann Kinematic Model block and Bicycle Kinematic block. The working of ...

5 meses ago | 0

| accepted

Answered

Solve inequation not working with sqrt

Hi, It seems that you did not enable ReturnConditions parameter. So the function is returning only one solution solve...

Solve inequation not working with sqrt

Hi, It seems that you did not enable ReturnConditions parameter. So the function is returning only one solution solve...

5 meses ago | 1

| accepted

Answered

Different size error bar caps

Hi Lorcan, You can set the linewidth for both bar and error bar to 1. So that you won’t see the thickness on the bars that ...

Different size error bar caps

Hi Lorcan, You can set the linewidth for both bar and error bar to 1. So that you won’t see the thickness on the bars that ...

5 meses ago | 1

| accepted

Answered

How do I plot time intervals in weekdays?

Hi Asrorkhuja Ortikov, You can use T=readtable(filename) function to read the xlsx file into MATLAB. Then you can ret...

How do I plot time intervals in weekdays?

Hi Asrorkhuja Ortikov, You can use T=readtable(filename) function to read the xlsx file into MATLAB. Then you can ret...

5 meses ago | 0

| accepted