Community Profile

Trung VO DUY

58 total contributions since 2019

View details...

Contributions in
View by

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

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

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

How to select numbers?
Hello, You can simply type F = rand(3) M = rand(3) result = F(F<M)

2 jours ago | 1

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

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

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

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

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

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

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

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

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

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

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

Convert Column Vector to arrey matrix

11 jours ago | 0

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

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

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

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

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

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

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

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

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

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

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

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

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