Réponse apportée
Solve 2nd order ODE using Euler Method
Hi Matt - a second order ODE can be decomposed into two first order ODEs. The secret is to set 2 variables y as The you have...

plus de 3 ans il y a | 0

Réponse apportée
convert char to double
var = '0'; out = str2double(var) whos out No need to use regular expressions at all, at least in Matlab.

plus de 3 ans il y a | 0

Réponse apportée
How to plot implicit ODE?
You need to solve it first. The ODE can be easily made explicit Then you can use any Matlab ODE solver (see this documentati...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to plot this feather using a mathematical equation
There: clear,clc [x,y] = meshgrid(linspace(-0.4,0.9,1000),linspace(-1.5,1.1,1000)); xy = x-y/8-(1/8)*(y+1).^2; A = 1+1/...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to solve systems of non linear equation of dimensions 100 using ode45 matalb.
If I were you, I would proceed substantially differently. Since you need to solve 100 equations, it is unthinkable to cde them ...

plus de 3 ans il y a | 2

| A accepté

Réponse apportée
I would like to plot row 1 and row 3 of B as (x vs y plot graph).
I suspect you want something like this syms x y z for i=1:10 eqn1 = 2.*x + 2.*i.*y + z == 2; eqn2 = -x + y - i.*z ==...

plus de 3 ans il y a | 0

Réponse apportée
Force a starting point on exponential graph
See if this can help counts = [2423970,2171372,2065862,1830553,1100899,1037972,914015,752138,684123,606126]; normalized_counts...

plus de 3 ans il y a | 0

Réponse apportée
Sum groups of columns
Example M = rand(10,4600); n = 50; for idx = 1:size(M,2)/n S(idx) = sum(M(:,n*(idx-1)+1:n*idx),'all'); end size(S) ...

plus de 3 ans il y a | 0

Réponse apportée
I'm new in using Matlab and I'm very confused of how I would solve a derivative problem. Here is the equations and problem
I think what you have in your snapshot is already ok. You just need to save the functions in y1, y2 and y3. There are also some ...

plus de 3 ans il y a | 0

Réponse apportée
How to terminate the MATLAB code?
n = 100000000; a = 3.8; x(1) = 0.5; tic Time = 0; for i=1:n if Time > 5 fprintf('You run out of time') ...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
Creating a matrix from one column
A = rand(1,1000)' M = repmat(A,[1 length(A)]) writematrix(M,'yourfile.csv')

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How I can add an exponential fit to my cdfplot?
I guess you could do something like this load z x = linspace(0,1,length(z)); fitfunc = fittype(@(A,B,C,x) A*exp(B*x.^C)); ...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Use of 'ArrayValued' in Matlab numerical integration
Let's take a look at the error message f = @(x) 5; integral(f,0,2) The important line here is "Output of the function must be...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
How to display only few values in a plot rather than for whole points in a big array?
n = 10; plot(x,T(:,1:n:end)); By increasing the value of n you decrease the number of lines shown in your plot.

plus de 3 ans il y a | 1

Réponse apportée
how to calculate biokinetic parameters?
You can use MatLab's fit function. Let me give you an example. Let us assume you have the following set of 50 experimental valu...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Expanding Array as following;
Try this A = [1 0 0 1]; B = repelem(A,3) For more info see the documentation for repelem.

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
Determine the magic sum from a magic square
I think you are inputting the magic square itself to your function, rather than its order. I believe the relation between a mag...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
remove indent in command window
I do not know you can change the way the editor looks, but you can print the result so that it looks the way you want. b = -3; ...

plus de 3 ans il y a | 0

Réponse apportée
SIR model with recovered individuals may lose their immunity and become reinfected with the disease. But came with a failure about integration tolerances
I guess the problem is in this three lines S = beta*S*I + delta*R; I = beta*S*I - gamma*I; R = gamma*I - delta*I; where you ...

plus de 3 ans il y a | 1

Réponse apportée
Find Index of Max Value in One Matrix and find value of that index in another
You can do it this way force = rand(1,10); length = rand(1,10); [max_force,idx] = max(force); max_length = length(id...

plus de 3 ans il y a | 0

| A accepté

Réponse apportée
max value in each row with its index
inputmatrix= [8.0000 0 7.3398 0 8.0000;... 1.6635 0.7103 3.2000 3.2000 3.2...

plus de 3 ans il y a | 0

Réponse apportée
Save for loop outputs into structure
Does allBIN(n).corr work?

plus de 3 ans il y a | 0

Réponse apportée
How to replace non consecutive value on a vector?
You could write a function that scans your array in search of the pattern you specify and replaces it with another. clear clc ...

plus de 3 ans il y a | 0

Réponse apportée
How to solve coupled partial differential equations with method of lines?
Hi @Ari Dillep Sai, take a look at the code below. The breakthrough now is found to be sometimes after 4000 s (or ~67 mins), so...

plus de 3 ans il y a | 1

| A accepté

Réponse apportée
How to import multiple text files from multiple folders and take maximum from each text file
Hey @Nazanin Farsi, based on your replies, maybe the following code will work. n1 = 1:22; n2 = 0.1:0.1:1.3; max_value = zer...

presque 4 ans il y a | 0

Réponse apportée
How to import multiple text files from multiple folders and take maximum from each text file
clear,clc n = 0.1:0.1:1.3; for k = 1:length(n) filename = [num2str(n(k)),'pga/AllMaxDrift.out']; data = read...

presque 4 ans il y a | 0

Réponse apportée
Newtonian interpolation polynomial that interpolates f twice (value and 1st derivative)
If the problem is the error appearing in your question, i.e. Function definitions in a script must appear at the end of the fil...

presque 4 ans il y a | 0

Réponse apportée
how to get x value of findpeaks
If X is your array of x-values, do [peaks,locs] = findpeaks(smoothed{i},'MinPeakHeight',0.5,'MinPeakDistance',200); x_peaks =...

presque 4 ans il y a | 0

Réponse apportée
vector that displays [0 5 10 15]
Just be aware of the fact that you do not need to use a loop to do this A = 0:5:15 That said, if you really must use a loop, t...

presque 4 ans il y a | 0

| A accepté

Réponse apportée
Finding indices of a vector within a matrix
Let me propse the following example clear,clc A = rand(100); A = A > 0.5 B = cell(1,100); for col = 1:size(A,2) idxs...

presque 4 ans il y a | 0

Charger plus