Answered

Integration of a function.

Hello, You just need to remove "." in the formulation of I2, I3, fun2 and fun3. The code will run withour errors.

Integration of a function.

Hello, You just need to remove "." in the formulation of I2, I3, fun2 and fun3. The code will run withour errors.

11 months ago | 1

| accepted

Answered

Combination of sub-matrices generated within a for loop

Hello, There are various solutions for this question, one of the closet one to your current code could be clear; clc; clos...

Combination of sub-matrices generated within a for loop

Hello, There are various solutions for this question, one of the closet one to your current code could be clear; clc; clos...

11 months ago | 0

| accepted

Answered

Using different colours in a quiver plot

Hello, My suggestion is that you plot the first figure for the vectors that have magnitude less than 1.0 (using blue color) the...

Using different colours in a quiver plot

Hello, My suggestion is that you plot the first figure for the vectors that have magnitude less than 1.0 (using blue color) the...

11 months ago | 0

Answered

How to plot axial velocity profiles

Hello, You can refer this code z = [0,9.99999953400000e-05,0.000219999991200000,0.000363999986200000,0.000536799977600000,0....

How to plot axial velocity profiles

Hello, You can refer this code z = [0,9.99999953400000e-05,0.000219999991200000,0.000363999986200000,0.000536799977600000,0....

11 months ago | 1

Answered

Removing Points Along a Diagonal Line

Hello, I would suggest you a solution, Since you have known two points of slope, which are (40,35) and (74.4, 15), you can e...

Removing Points Along a Diagonal Line

Hello, I would suggest you a solution, Since you have known two points of slope, which are (40,35) and (74.4, 15), you can e...

11 months ago | 0

Answered

Legend label - differential dot above letter with a subscript

Hello, How about this name = legend('$\dot{X}_{Piston}$'); set(name,'Interpreter','latex');

Legend label - differential dot above letter with a subscript

Hello, How about this name = legend('$\dot{X}_{Piston}$'); set(name,'Interpreter','latex');

11 months ago | 0

| accepted

Answered

Exponential decay extrap to y=0

Hello, You could try this clear close all x0 = linspace(0,100,100); x = [0;10;20;30;40;50;60]; %time in minutes y = [12...

Exponential decay extrap to y=0

Hello, You could try this clear close all x0 = linspace(0,100,100); x = [0;10;20;30;40;50;60]; %time in minutes y = [12...

11 months ago | 0

| accepted

Answered

I am unable to store values for every iteration, values are overwritten in each iteration.

Hello, Try this fr{Fr} = frame(:);

I am unable to store values for every iteration, values are overwritten in each iteration.

Hello, Try this fr{Fr} = frame(:);

11 months ago | 0

Answered

Circle rotating and whirling

Hello, You can also refer this code, close all t = linspace(0,2*pi); x = cos(t); y = sin(t); r1 = 3; plot(r1*x,r1*y) ...

Circle rotating and whirling

Hello, You can also refer this code, close all t = linspace(0,2*pi); x = cos(t); y = sin(t); r1 = 3; plot(r1*x,r1*y) ...

11 months ago | 0

| accepted

Answered

Finding eigen vectors of a matrix

Thank for @Rik 's comment. I have moved my comment to this section. Since Matlab response with these lines Error using eigs...

Finding eigen vectors of a matrix

Thank for @Rik 's comment. I have moved my comment to this section. Since Matlab response with these lines Error using eigs...

11 months ago | 1

Answered

How do you update the legend of Figure 2 instead of Figure 1?

Hello, In the code of figure 2, you should change a bit like this figure Class1_Synthetic = scatter(SLClass1_Normalized,PWCl...

How do you update the legend of Figure 2 instead of Figure 1?

Hello, In the code of figure 2, you should change a bit like this figure Class1_Synthetic = scatter(SLClass1_Normalized,PWCl...

11 months ago | 1

| accepted

Answered

Interpreter latex label problem

Hello, The error come from the typing of latex syntax. You should change a bit in your latex, for example ylabel('$R_{{m}_...

Interpreter latex label problem

Hello, The error come from the typing of latex syntax. You should change a bit in your latex, for example ylabel('$R_{{m}_...

12 months ago | 0

| accepted

Answered

Splitting based on delimiter but only once

Hello, You can refer this idea to extend you the case of longer string clear input = 'Country ˈk ʌ n t r i'; [val,idx] =...

Splitting based on delimiter but only once

Hello, You can refer this idea to extend you the case of longer string clear input = 'Country ˈk ʌ n t r i'; [val,idx] =...

12 months ago | 0

Answered

Assembling global stiffness matrix

Hello, I have taken a look in your code, I relize that in each element there are four nodes and each node has two degree of fr...

Assembling global stiffness matrix

Hello, I have taken a look in your code, I relize that in each element there are four nodes and each node has two degree of fr...

12 months ago | 1

Answered

question about how to plot a for loop in matlab

Hello, Try to put plot inside the loop for Fn=0.1:0.01:10; Mg=abs((Ln*Fn*Fn)/(((Ln+1)*Fn*Fn-1)+((Fn^2-1)*Fn*Qe*Ln)*i)) plo...

question about how to plot a for loop in matlab

Hello, Try to put plot inside the loop for Fn=0.1:0.01:10; Mg=abs((Ln*Fn*Fn)/(((Ln+1)*Fn*Fn-1)+((Fn^2-1)*Fn*Qe*Ln)*i)) plo...

12 months ago | 0

Answered

polar plot to create circular shape with varying radius

Hello, How about if you change a bit like this clear close all % k = round(rand(1,50)*10)+10; k = round(rand(1,50)); Th ...

polar plot to create circular shape with varying radius

Hello, How about if you change a bit like this clear close all % k = round(rand(1,50)*10)+10; k = round(rand(1,50)); Th ...

12 months ago | 0

Answered

How to solve matrix equation for variable inside a summation? Analytical or numerical.

Hello, There are several ways that you can apply. Here, I just show you an example how to solve this problem by using solve fu...

How to solve matrix equation for variable inside a summation? Analytical or numerical.

Hello, There are several ways that you can apply. Here, I just show you an example how to solve this problem by using solve fu...

12 months ago | 1

| accepted

Answered

Regarding the matrix indexing,

Hello, How about if you modify your function like this function T = Euler_explicit(T_0, L, P,C, h) A = inv(C)*L; ...

Regarding the matrix indexing,

Hello, How about if you modify your function like this function T = Euler_explicit(T_0, L, P,C, h) A = inv(C)*L; ...

12 months ago | 0

| accepted

Answered

Finding the nonzero element in a specific row

Hello, Yes, there is. You can refer this simple example A = [1 2; 0 3] [rows,cols,vals] = find(A==0)

Finding the nonzero element in a specific row

Hello, Yes, there is. You can refer this simple example A = [1 2; 0 3] [rows,cols,vals] = find(A==0)

12 months ago | 0

Answered

How to select numbers?

Hello, You can simply type F = rand(3) M = rand(3) result = F(F<M)

How to select numbers?

Hello, You can simply type F = rand(3) M = rand(3) result = F(F<M)

12 months ago | 1

Answered

Result of FEA does not change, on changing the Material properties with same load

Hello, I have run your code, results were not constants when parameters had changed. For example, if you set "PR" (poisson r...

Result of FEA does not change, on changing the Material properties with same load

Hello, I have run your code, results were not constants when parameters had changed. For example, if you set "PR" (poisson r...

12 months ago | 0

| accepted

Answered

Calculating time duration of a signal

Hello, You also could refer this code to get the output clear signal=[0 0 0 1 1 1 1 0 1 1]; n = length(signal); a = diff(...

Calculating time duration of a signal

Hello, You also could refer this code to get the output clear signal=[0 0 0 1 1 1 1 0 1 1]; n = length(signal); a = diff(...

12 months ago | 0

| accepted

Answered

make the for loop run faster

Hello, How about if you try to use this time = 1:100; T0 = 0; sunrise = 10; Tmin = 1; Tmax = 100; Tmax_time = 50; suns...

make the for loop run faster

Hello, How about if you try to use this time = 1:100; T0 = 0; sunrise = 10; Tmin = 1; Tmax = 100; Tmax_time = 50; suns...

12 months ago | 0

| accepted

Answered

While solving boundary value problems (using bvp4c) the graph is plotted as the command ""plot (x,BS(1,:))"" but if I want the graph between x and y and not x and boundary solution (BS) what should I do ?

Hello, You might simply plot x and y like this plot(sol.x, sol.y, '-o') Several examples of how to use bvp4 and deval can b...

While solving boundary value problems (using bvp4c) the graph is plotted as the command ""plot (x,BS(1,:))"" but if I want the graph between x and y and not x and boundary solution (BS) what should I do ?

Hello, You might simply plot x and y like this plot(sol.x, sol.y, '-o') Several examples of how to use bvp4 and deval can b...

12 months ago | 0

| accepted

Answered

How to integral a composite function in yalmip?

Hello, You define z as a function of x1, x2, and u1. But, you apply the integral function to compute the integral of z over th...

How to integral a composite function in yalmip?

Hello, You define z as a function of x1, x2, and u1. But, you apply the integral function to compute the integral of z over th...

12 months ago | 0

| accepted

Answered

How to draw cumulative histogram?

Hello, You shoud do some tasks to approximate cumulative probability from your data. Then you just plot it. Below, will be a r...

How to draw cumulative histogram?

Hello, You shoud do some tasks to approximate cumulative probability from your data. Then you just plot it. Below, will be a r...

12 months ago | 0

Answered

Combining two sets of data into a singular array

Hello, How about if you can combine into matrix with many column like this for ii=1:5 time=randn(5,1); data1=randn(5,1); c...

Combining two sets of data into a singular array

Hello, How about if you can combine into matrix with many column like this for ii=1:5 time=randn(5,1); data1=randn(5,1); c...

12 months ago | 0

Answered

Calculate minimum distance between point and steady but NON differentiable function

Hello, There is two options that you can think Assume we have a point P(xp, yp) and a function f(x) that we may not have der...

Calculate minimum distance between point and steady but NON differentiable function

Hello, There is two options that you can think Assume we have a point P(xp, yp) and a function f(x) that we may not have der...

12 months ago | 0

| accepted

Answered

Go back to initializing values using for loop when condition is not met

Hello, There are several ways, one approach that you can use as follows clear n = 100; x = zeros(1,n); y = zeros(1,n); fo...

Go back to initializing values using for loop when condition is not met

Hello, There are several ways, one approach that you can use as follows clear n = 100; x = zeros(1,n); y = zeros(1,n); fo...

12 months ago | 1

| accepted

Answered

Plotting integral over an interval

Hello, The way you try to plot the integral may be not correct, for x0 you can compute the integral by using the integral fuct...

Plotting integral over an interval

Hello, The way you try to plot the integral may be not correct, for x0 you can compute the integral by using the integral fuct...

12 months ago | 0

| accepted