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...

environ 3 heures 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; ...

environ 3 heures 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)

environ 17 heures 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)

2 jours 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...

3 jours 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(...

5 jours 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...

5 jours 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...

5 jours 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...

6 jours 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...

6 jours 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...

6 jours 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...

7 jours 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...

9 jours 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...

10 jours ago | 0

| accepted

Answered

How to index matrices inside a loop?

Hello, You can change your code a bit like this %% Quantum Control format long clear all clc %% Variables time = -20000...

How to index matrices inside a loop?

Hello, You can change your code a bit like this %% Quantum Control format long clear all clc %% Variables time = -20000...

10 jours ago | 1

| accepted

Answered

Convert Column Vector to arrey matrix

Hello, You may see this function, it will help you https://www.mathworks.com/help/matlab/ref/reshape.html

Convert Column Vector to arrey matrix

Hello, You may see this function, it will help you https://www.mathworks.com/help/matlab/ref/reshape.html

11 jours ago | 0

Answered

solve not returning two answers

Hello, Maybe you could try with another approach, for example, eq = @(y)2*log((((N-y)./(q*N)).^(N-y)).*((y./((1-q)*N)).^y)) ...

solve not returning two answers

Hello, Maybe you could try with another approach, for example, eq = @(y)2*log((((N-y)./(q*N)).^(N-y)).*((y./((1-q)*N)).^y)) ...

12 jours ago | 1

| accepted

Answered

Index in position 1 exceeds array bounds (must not exceed 1).

Hello, There are several approaches that you can try to eleminate the point inside the circle. Here, I can show you a solution...

Index in position 1 exceeds array bounds (must not exceed 1).

Hello, There are several approaches that you can try to eleminate the point inside the circle. Here, I can show you a solution...

12 jours ago | 0

| accepted

Answered

How can i average a 1-D array every n elements?

Hello, I think this function is exactly what you want https://www.mathworks.com/help/matlab/ref/movmean.html

How can i average a 1-D array every n elements?

Hello, I think this function is exactly what you want https://www.mathworks.com/help/matlab/ref/movmean.html

12 jours ago | 0

Answered

Solve out a symbol

Hello, If you write solve(k,s) the solve function will solve another equation k == 0, i.e, w*sqrt(e*m/2)*sqrt(sqrt(1+(s/(...

Solve out a symbol

Hello, If you write solve(k,s) the solve function will solve another equation k == 0, i.e, w*sqrt(e*m/2)*sqrt(sqrt(1+(s/(...

12 jours ago | 1

| accepted

Answered

Not able to get plot

Hello, You used the linespace function with wrong parameter. Here is instruction of linespace function: linspace(X1, X2, N) ...

Not able to get plot

Hello, You used the linespace function with wrong parameter. Here is instruction of linespace function: linspace(X1, X2, N) ...

12 jours ago | 1

| accepted

Answered

How can I define the time steps of an x-y plot?

Hello, To get the same figure, you should refine the time step and then you should store value of X and Y with respect to t be...

How can I define the time steps of an x-y plot?

Hello, To get the same figure, you should refine the time step and then you should store value of X and Y with respect to t be...

13 jours ago | 1

Answered

Counting the Same Occurance of a row string

Here is a possible solution that you can refer clear pj1 = { 'AVX', '0601' 'AVX', '0603' 'AVX', '0603' 'EPC', '0603' '...

Counting the Same Occurance of a row string

Here is a possible solution that you can refer clear pj1 = { 'AVX', '0601' 'AVX', '0603' 'AVX', '0603' 'EPC', '0603' '...

15 jours ago | 1

Answered

Access multiple folders and extract specific files

Hello, If I understood you well, the code below could help you clear root_folder = 1:12; fig_number = [4 8]; for i = 1:...

Access multiple folders and extract specific files

Hello, If I understood you well, the code below could help you clear root_folder = 1:12; fig_number = [4 8]; for i = 1:...

16 jours ago | 0

Answered

How to extract specific rows from a text file?

Hello, Here is an solution that you can refer, clear FileName = 'HP1_ordered.txt'; NewFile = 'HP1_ordered_skip10.txt'; ...

How to extract specific rows from a text file?

Hello, Here is an solution that you can refer, clear FileName = 'HP1_ordered.txt'; NewFile = 'HP1_ordered_skip10.txt'; ...

16 jours ago | 1

| accepted

Answered

i wanna improve my function

Hello, As guided by @Geoff Hayes, I could give an example code here. function [res] =contain(v,u) res=true; idx = find(u ==...

i wanna improve my function

Hello, As guided by @Geoff Hayes, I could give an example code here. function [res] =contain(v,u) res=true; idx = find(u ==...

17 jours ago | 0

Answered

Write to file inside a loop

Hello, You can refer a simple solution as follows saveb1 = []; for (your loop) your code to compute b1; ...

Write to file inside a loop

Hello, You can refer a simple solution as follows saveb1 = []; for (your loop) your code to compute b1; ...

17 jours ago | 1

Answered

Calculate volume below a 3D points

Hello, There is a problem with the interpolation function which is not good to give us a smooth fuction. If you plot the "inte...

Calculate volume below a 3D points

Hello, There is a problem with the interpolation function which is not good to give us a smooth fuction. If you plot the "inte...

22 jours ago | 0

Answered

Taylor Series of e^x on point 1

Hello, At least, I found a mistake in your program. Let see the line T = symsum((F(o,1)*(x-p)^N)/factorial(N), N, 0, o); Th...

Taylor Series of e^x on point 1

Hello, At least, I found a mistake in your program. Let see the line T = symsum((F(o,1)*(x-p)^N)/factorial(N), N, 0, o); Th...

22 jours ago | 0

Answered

Minimization of two variables

Hello, Here is an example for your problem, which you can refer clear xiyi = [0,1; 1,3; -1 2]; x0 ...

Minimization of two variables

Hello, Here is an example for your problem, which you can refer clear xiyi = [0,1; 1,3; -1 2]; x0 ...

22 jours ago | 0

| accepted