I am Application Support Engineer at Mathworks.

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

Answered

Need help using contourfm in Map plotting

Hi Leon, The syntax for using the 'contourfm' function is different from that of the 'contourf' function. This is why you are g...

Need help using contourfm in Map plotting

Hi Leon, The syntax for using the 'contourfm' function is different from that of the 'contourf' function. This is why you are g...

9 días ago | 0

Answered

mpsread - fixed variables

Hi Lucrezia, The following syntax will read data for LP and MILP problems from the MPS file 'file.mps' and return the data in a...

mpsread - fixed variables

Hi Lucrezia, The following syntax will read data for LP and MILP problems from the MPS file 'file.mps' and return the data in a...

9 días ago | 0

Answered

How can I correct this error?

Hi Kangmin, Have a look at the following snapshot of your code: The matrix above the blue line and the matrix above the red ...

How can I correct this error?

Hi Kangmin, Have a look at the following snapshot of your code: The matrix above the blue line and the matrix above the red ...

10 días ago | 0

Answered

How to solve the Error: Warning: Failure at t=6.081492e-07. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (2.160580e-21) at time t. > In ode23s (line 401)

Hi Drishya, This error can occur due to several reasons: Your function might be creating a singularity or any other discontinu...

How to solve the Error: Warning: Failure at t=6.081492e-07. Unable to meet integration tolerances without reducing the step size below the smallest value allowed (2.160580e-21) at time t. > In ode23s (line 401)

Hi Drishya, This error can occur due to several reasons: Your function might be creating a singularity or any other discontinu...

11 días ago | 0

Answered

how to plot the functions

Hi Harsh, One way of plotting the functions is by using the "isosurface" function. Have a look at the following example code: ...

how to plot the functions

Hi Harsh, One way of plotting the functions is by using the "isosurface" function. Have a look at the following example code: ...

11 días ago | 0

Answered

Define function for a transfer function

Hi Vinit, From my understanding, 'X' is a vector containing 'a', 'b', 'c', 'd' which are scalars. As these are scalars, you do ...

Define function for a transfer function

Hi Vinit, From my understanding, 'X' is a vector containing 'a', 'b', 'c', 'd' which are scalars. As these are scalars, you do ...

13 días ago | 0

Answered

Getting this error - Index exceeds the number of array elements (0). quant(keymat(Nm*(ii-1)+jj))=bitset(quant(keymat(Nm*(ii-1)+jj)),1,str2double(tempcipher(ii,jj))); for DCT steganography

Hi Talha, As I do not have the images you have used, I am unable to run your code. But I can tell you the meaning of the error....

Getting this error - Index exceeds the number of array elements (0). quant(keymat(Nm*(ii-1)+jj))=bitset(quant(keymat(Nm*(ii-1)+jj)),1,str2double(tempcipher(ii,jj))); for DCT steganography

Hi Talha, As I do not have the images you have used, I am unable to run your code. But I can tell you the meaning of the error....

16 días ago | 0

Answered

Solving a system of ODE with BCs

Hi Elia, The following link gives an example of how to solve a system of two first-order differential equations with boundary c...

Solving a system of ODE with BCs

Hi Elia, The following link gives an example of how to solve a system of two first-order differential equations with boundary c...

16 días ago | 0

| accepted

Answered

Normalise data set in 2d plot

Hi Tiernan, After you finish plotting, you can specify the limits of y-axis by adding the following line of code: ylim([-1 1])...

Normalise data set in 2d plot

Hi Tiernan, After you finish plotting, you can specify the limits of y-axis by adding the following line of code: ylim([-1 1])...

16 días ago | 0

Answered

Difference between plotting 3D Graphs (Curve vs Area)

Hi Niklas, Firstly, the difference in the two surf plots is because the matrix 'y' is different in both the cases. To understa...

Difference between plotting 3D Graphs (Curve vs Area)

Hi Niklas, Firstly, the difference in the two surf plots is because the matrix 'y' is different in both the cases. To understa...

17 días ago | 1

| accepted

Answered

Product of one-dimensional integrals, numerical integration

Hi Dimitris, Have a look at the following example code. I have assumed different functions for 'f' and 'g' and integrated their...

Product of one-dimensional integrals, numerical integration

Hi Dimitris, Have a look at the following example code. I have assumed different functions for 'f' and 'g' and integrated their...

17 días ago | 0

| accepted

Answered

First Order solving ODE and simulink

Hi Hassan, Firstly, as you are defining all the variables inside the function, you do not need to pass them as the function's a...

First Order solving ODE and simulink

Hi Hassan, Firstly, as you are defining all the variables inside the function, you do not need to pass them as the function's a...

17 días ago | 0

| accepted

Answered

Symbolic Linear system returns wrong solution.

Hi Tiago, I understand that you are getting wrong solutions but there is nothing wrong with the working of the code. I suggest ...

Symbolic Linear system returns wrong solution.

Hi Tiago, I understand that you are getting wrong solutions but there is nothing wrong with the working of the code. I suggest ...

18 días ago | 0

| accepted

Answered

Symbolic integration, numerical integration, singularity

Hi Pengpeng, The "int" function cannot solve all integrals since symbolic integration is such a complicated task. It is also po...

Symbolic integration, numerical integration, singularity

Hi Pengpeng, The "int" function cannot solve all integrals since symbolic integration is such a complicated task. It is also po...

18 días ago | 0

Answered

Push Button help!

Hi Priyana, There is a slight change in syntax that you need to make for the ButtonPushedFcn. Assuming that when Button 1 is p...

Push Button help!

Hi Priyana, There is a slight change in syntax that you need to make for the ButtonPushedFcn. Assuming that when Button 1 is p...

18 días ago | 0

Answered

Resume from latest Randstream

Hi Sebastian, Setting the seed of "rng" to 'shuffle' helps getting different sequence of random numbers after each call to rng,...

Resume from latest Randstream

Hi Sebastian, Setting the seed of "rng" to 'shuffle' helps getting different sequence of random numbers after each call to rng,...

18 días ago | 0

| accepted

Answered

Solving symbolic equation using vpasolve

Hi Alessandro, The "int" function cannot solve all integrals since symbolic integration is such a complicated task. It is also ...

Solving symbolic equation using vpasolve

Hi Alessandro, The "int" function cannot solve all integrals since symbolic integration is such a complicated task. It is also ...

18 días ago | 0

Answered

Plotting Implicit Function in Polar Coordinate

Hi Teerapong, Have a look at the following links: https://www.mathworks.com/help/matlab/ref/cart2pol.html https://www.mathwor...

Plotting Implicit Function in Polar Coordinate

Hi Teerapong, Have a look at the following links: https://www.mathworks.com/help/matlab/ref/cart2pol.html https://www.mathwor...

3 meses ago | 0

Answered

Changing CData values for a surf plot.

Hi Ali, Have a look at the following link: https://www.mathworks.com/help/matlab/creating_plots/how-surface-plot-data-relates-...

Changing CData values for a surf plot.

Hi Ali, Have a look at the following link: https://www.mathworks.com/help/matlab/creating_plots/how-surface-plot-data-relates-...

3 meses ago | 0

Answered

Error in port widths or dimensions using simulink -PS converter block

Hi Anupam, Have a look at the following link: https://www.mathworks.com/matlabcentral/answers/248904-error-in-port-widths-or-d...

Error in port widths or dimensions using simulink -PS converter block

Hi Anupam, Have a look at the following link: https://www.mathworks.com/matlabcentral/answers/248904-error-in-port-widths-or-d...

3 meses ago | 0

Answered

How to formulate elegantly and performant functions that depend on a lot of input variables

Hi Ferdinand, Have a look at the Accepted Answer (and the comment under it) for the question posed in the following link: Pass...

How to formulate elegantly and performant functions that depend on a lot of input variables

Hi Ferdinand, Have a look at the Accepted Answer (and the comment under it) for the question posed in the following link: Pass...

3 meses ago | 0

Answered

Please help to solve the following equations by the Newton–Raphson method

Hi, Have a look at the following code which solves the above mentioned equations by Newton-Raphson Method : clc;clear;close a...

Please help to solve the following equations by the Newton–Raphson method

Hi, Have a look at the following code which solves the above mentioned equations by Newton-Raphson Method : clc;clear;close a...

3 meses ago | 0

Answered

Radius and centre of curvature

Hi Nagaraj, You will have to first change your equation to the form of y = f(x) and then use the formulae to find the radius an...

Radius and centre of curvature

Hi Nagaraj, You will have to first change your equation to the form of y = f(x) and then use the formulae to find the radius an...

3 meses ago | 0

| accepted

Answered

Function 'subs' different output for a (similar?) input

Hi Bobby, syms F(t) The above command implies that 'F' is a symbolic function. Hence, the command invF0=subs(invF(t)) does...

Function 'subs' different output for a (similar?) input

Hi Bobby, syms F(t) The above command implies that 'F' is a symbolic function. Hence, the command invF0=subs(invF(t)) does...

3 meses ago | 0

| accepted

Answered

Adding Legend to Subplot

Hi Ollie, I understand that you want to be able to copy the legends of the figures, along with their plots, into the subplot bu...

Adding Legend to Subplot

Hi Ollie, I understand that you want to be able to copy the legends of the figures, along with their plots, into the subplot bu...

4 meses ago | 0

Answered

how to plot them together and get their equations and make a legend for them ?

Hi Tomer, I understand that you want to plot both the models in one figure and get the equations for both of them. I have bro...

how to plot them together and get their equations and make a legend for them ?

Hi Tomer, I understand that you want to plot both the models in one figure and get the equations for both of them. I have bro...

4 meses ago | 0

Answered

How to Solve Second Order ODE with 2 dependent variables

Hi Yanuar, Two second order ODE's can directly be solved by using 'dsolve'. Have a look at the following code: syms x(t) y(t) ...

How to Solve Second Order ODE with 2 dependent variables

Hi Yanuar, Two second order ODE's can directly be solved by using 'dsolve'. Have a look at the following code: syms x(t) y(t) ...

4 meses ago | 0

Answered

Check for missing argument or incorrect argument data type in call to function 'bode'

Hi Alejandro, As both ARK and Adam mentioned, do check out the documentation for 'bode' function to know the valid syntax. As...

Check for missing argument or incorrect argument data type in call to function 'bode'

Hi Alejandro, As both ARK and Adam mentioned, do check out the documentation for 'bode' function to know the valid syntax. As...

4 meses ago | 0

Answered

Discretization method used in MPC

Hi Hossam, The following link gives information on the discretization method used by a non-linear MPC Controller: Specify Pred...

Discretization method used in MPC

Hi Hossam, The following link gives information on the discretization method used by a non-linear MPC Controller: Specify Pred...

4 meses ago | 0

Answered

In the editor, my "run" icon shows "pause"

Hi David, Adding to ARK's comment, whenever the code takes a long time to run, the 'run' icon changes to the 'pause' icon. This...

In the editor, my "run" icon shows "pause"

Hi David, Adding to ARK's comment, whenever the code takes a long time to run, the 'run' icon changes to the 'pause' icon. This...

4 meses ago | 1

| accepted