Answered
How to call a function from another file?
Hi, change your function to: function x = mychaos(Initial_Value) x=Initial_Value; a=3.9; x=a*x*(1-x...

7 years ago | 1

| accepted

Answered
Solving one equation with one unknown and get all possible solutions
Hi, getting all possible soultions is a hard job, because you have an infinite bunch of real solutions: You find them for e...

7 years ago | 0

| accepted

Answered
Combining 2 matrices every other row
Hi, try: A = [-1; -3; -5; -7; -9] B = [2; 4; 6; 8; 10] result = reshape(([A B])',[],1) gives: A = -1 -3 -...

7 years ago | 2

| accepted

Answered
convert matrix from hexadecimal to decimal
Hi, you could use hex2dec - depending on your input format / input data type this will work or not. I think this is why Jan ask...

7 years ago | 0

| accepted

Answered
Problem with my code- trying to iterate through a matrix
i think this is correct: [x0]=rand_values(index,1); [y0]=rand_values(index,2);

7 years ago | 0

Answered
After solving and plotting a set of ODEs in 3d, how can I label a specific point (e.g (2,9,5))?
hold on scatter3(2,9,5, 'ro', 'lineWidth', 2, 'MarkerFaceColor', 'r') hold off

7 years ago | 1

| accepted

Answered
Take lines from array
A = repmat([1 1 1 1; 2 2 2 2; 3 3 3 3; 4 4 4 4],16,1); % Example matrix B = zeros(32,4); % Preallocate B B(1:2:end) = A(1:4:en...

7 years ago | 0

| accepted

Submitted


linalgSubstitute
Replace parts of matrices by other matrices starting at given row and column

7 years ago | 2 downloads |

0.0 / 5

Answered
How to write to make a computation grid with random numbers?
Hi, if your function that uses the randomized values is vectorized, you can use this code: x = -9:0.2:9; y = -8:0.2:8; id_x ...

7 years ago | 0

| accepted

Answered
Plotting error: I am trying to plot the equations and the output should be as shown but its not
Hi, try: % Constants beta=5; alfa = 2.*beta/(beta+1); tau1=2; tau2=2.4; gamma=alfa.*(2-exp(-tau1)); % Time frames t1=...

7 years ago | 0

| accepted

Answered
What's function does replace LINALG::SUBSTITUTE (A,B,m,n)?
Hi, you can use this function: function result = linalg_substitute(A,B,m,n) [mA, nA] = size(A); [mB, nB] = size(B); ...

7 years ago | 1

Answered
Bar in different colors for histfit
Hi, see the section "control individual bar colors" in the documentation: https://de.mathworks.com/help/matlab/ref/bar.html#d1...

7 years ago | 1

| accepted

Answered
Solving equation with bessel function
Hi, define the area you are interested in and loop through: syms x eqn = besselj(0,0.5*x)*bessely(0,4.5*x) - besselj(0,4.5*x)...

7 years ago | 1

| accepted

Answered
Plot instantaneous speed of the vehicle
Hi, the definition of speed is: v=ds/dt How do you want to calculate speed if you only have information about ds, but without...

7 years ago | 0

Answered
Ode45 I get wrong results.
Hi, ode45 integrates your second order ode two times. So the result of ode45 will be angle and velocity over time. To get acce...

7 years ago | 1

| accepted

Answered
how to detect empty rows and columns from 3-D matrix and crop them?
Hi, two lines of code do the job: Frames = zeros(5,5,10); Frames(:,:,1 ) = [0 0 90 0 0; 0 0 90 0 0; 90 90 90 0 0;0 0 0 0 0;0 ...

7 years ago | 0

Answered
How to solve this equations?
Hi, as Madhan already said in his comment, we need to see some code to help. Otherwise we would do your work, what is not the w...

7 years ago | 0

| accepted

Answered
I don't understand what is going wrong with my code!!, I get error of a matrix singular
Hi, you do a divide by zero at the initial point - use another x0 for y(1) - for example try: [t,y]=ode45(@rocketequat,[0 160]...

7 years ago | 1

Answered
Genetic algorithm problem in matrix index
Hi, you are using the simple_fitness function, which is an implementation of the Rosenbrock function. This function is a built ...

7 years ago | 0

| accepted

Answered
i Checked calculation and found The solution does not accord with the equation
Hi, this version works fine for me: fun = @root2d; x0 = [1,1,1,1,1,1]; x = fsolve(fun,x0) result = fun(x) function F = r...

7 years ago | 0

Answered
Does particleswarm solver exist in R2013a or not?
No, particleswarm was introduced in R2014b. Best regards Stephan

7 years ago | 0

| accepted

Answered
Area between two points and a curve
Hi, the whole area of your figure is a rectangle with area: (3-1)*(0-(-0.5). If you calculate the integral of your curve in th...

7 years ago | 0

| accepted

Answered
Add some months into a Column of Single Years
Hi, you can use this function: function result = years_with_months(start_year, end_year) % Build years years = start_year:en...

7 years ago | 0

| accepted

Answered
Variation of initial values and slope calculation
Hi, it appears that there are at least 2 problems in your code. Due to this (and the fact that i do have to understand fully ho...

7 years ago | 1

| accepted

Answered
Number of ACF lags must be a scalar
Hi, try: Table=readtable('rGDP.csv'); gdpacf = autocorr(Table.GDP,10); Best regards Stephan

7 years ago | 1

| accepted

Answered
Why doesn't symprod recognize indexed variables?
Hi, try: syms k(n) symprod(k(n),n,1,4) this should give you the expected result. Best regards Stephan

7 years ago | 0

| accepted

Answered
Why can't I set populationsize of GA to vector?
Hi, have a read here, it is directly linked from the section of the documentation that is quoted in your question. I think this...

7 years ago | 0

| accepted

Answered
Minimum least square fitting with multiple variable
Hi, you could use the resnorm to compare the quality of different approaches: [x, resnorm] = lsqnonlin(...) But the question ...

7 years ago | 0

Answered
How to use ga in matlab as a binary genetic algorithm?
Hi, use IntCon and set lower and upper bounds to zero respectively ones. Best regards Stephan

7 years ago | 0

Answered
How can I turn off the automatic plotting when using bayesopt
Hi, see this link to change the behavior of plot. For your purpose: 'PlotFcn', [] should work. See also the Verbose option t...

7 years ago | 0

| accepted

Load more