Answered
Fit custom equation with two datasets
help lsqcurvefit

4 years ago | 0

| accepted

Answered
Contour plot of a function
H = 0:0.01:3; XI = 0:0.01:2; for i=1:numel(H) h = H(i); for j=1:numel(XI) xi = XI(j); for k=1:m q = x +...

4 years ago | 0

Answered
Where is the wrong in this code??
f_b(1/z) = (0.1000 - 0.3000i)z^-1 + (0.2121 - 0.0008i)z^-2 + (0.9000 +0.0010i)z^-3 I wrote it several times already, but this f...

4 years ago | 0

| accepted

Answered
Bisection Method Code Help
I didn't check whether there is a programming error in bisection1. In comparison to fzero it's very inexact - that's for sure. ...

4 years ago | 0

Answered
While loop setting error calculation is not calculating properly.
betaIter_deg (and thus betaIter) need to be reset because they are incremented in the while-loop.

4 years ago | 1

Answered
can I generate random no. from 0 to 10E5, but the condition is ?
numbers = sort(100e3*rand(1,80),'ascend') or numbers(1) = 100e3*rand; for i = 2:80 numbers(i) = numbers(i-1) + (100e3 - ...

4 years ago | 0

Answered
Index exceeds the number of array elements. Index must not exceed 2.
dr = (r1 - r2)/Ang; implies r1 > r2 r = r1:dr:r2; implies r2 > r1 So what is correct ?

4 years ago | 0

Answered
How to calculate the center of the obtained Area in this case?
https://en.wikipedia.org/wiki/Centroid#Of_a_polygon https://de.mathworks.com/help/matlab/ref/polyshape.centroid.html

4 years ago | 0

Answered
How to find the index of the values which are bigger than zero the following case?
M = [ 0 0.5 0.7]; [~,indices] = find(M>0)

4 years ago | 0

Answered
"A matrix 'B' of 5x5 whose elements are all 5"
B = 5*ones(5)

4 years ago | 1

Answered
anonymous, piecewise-defined function that has NaN as response for a certain subdomain
g=@(x) (x) .* (x<=-1)+... (x+1) .* (x>-1 & x<1)+... (-x+4) .* (x>=1); x = [-2,0,1.5,2.5,5]; gx = g(x); gx(x>2 & x<=...

4 years ago | 0

Answered
For loop alternative method
SensorA_under_30_degrees = SensorA(Temperature<30)

4 years ago | 1

| accepted

Answered
Symbolic Integration Problem Using Symbolic Math Toolbox
syms par1 par2 par3 par4 par5 syms a q p s b mR nR r syms y yA yU K5 = cos(par1*y+par2)*sin(par3*y+par4)*cos(par5*y); K55 ...

4 years ago | 0

| accepted

Answered
4 graph in 1 figure
Choose what you need: https://de.mathworks.com/help/matlab/creating_plots/graph-with-multiple-x-axes-and-y-axes.html https://d...

4 years ago | 0

Answered
How can I specify a parameter to solve a system of equations symbolically?
syms v_0 t_1 v_1 p_1 eqns_1 = [ ... t_1 == 2.0, ... v_1 == v_0, ... p_1 == v_0 * t_1, ... ]; solve(eqns_1,...

4 years ago | 0

| accepted

Answered
Deterministic SEIR ODE model running slow
%Define model parameters as a structure (N.B. stick to days here for ease %later on) A = [10 0.1; 0.1 1]; J = 13000000+530000...

4 years ago | 0

| accepted

Answered
How to write an if-else statement for a function
n = 6; f = 2; for i = 2:n f = sqrt(1+f); end f finf = 0.5+sqrt(0.5^2+1)

4 years ago | 0

Answered
Which solver can solve this equation for V. Result should be around 59. I tested the to halfs of the equation on python. Thank you for your directions in the first place.
fun = @(V)((500-V)-((650.5/(((150.5-V*0.5)/(V*0.8660254037844386))+1.364))*1.364))/((((((((500*2-(500-V))/3.052050807569)*1.7320...

4 years ago | 0

| accepted

Answered
lsqcurvefit error: requires all values returned by functions to be of data type double
F3 = double(symsum(f,n,[0 Inf])); instead of F3 = symsum(f,n,[0 Inf]); Why do the elements in x0 repeat with very different a...

4 years ago | 1

Answered
How to fit data points to a known implicit function to get the parameters of the function
M = [68.8 110 68.1 178 66.75 241 64.36 297 61.04 343 57.3 380 53.26 407 49.6 430 46 445 ...

4 years ago | 0

| accepted

Answered
Creating a square matrix from 5 vectors
If the R's are row vectors: A = [R1;R2;R3;R4;R5] If they are column vectors: A = [R1,R2,R3,R4,R5]

4 years ago | 0

| accepted

Answered
where is the fault the code is not running as it has two delays with four variables?
sol = exam4() function sol = exam4 options = ddeset('Events',@exam4e); sol = dde23(@exam4f,[1, 10],[5; 0.1; 1; 7],[0, 40],opt...

4 years ago | 0

| accepted

Answered
Need help with code
Look up "Random Numbers within Specified Interval" under https://de.mathworks.com/help/matlab/ref/rand.html

4 years ago | 0

Answered
Finding Congruencing Matrix between two given matrices
https://de.mathworks.com/matlabcentral/answers/278877-how-to-findthe-permutation-matrices-that-produce-another-matrix

4 years ago | 0

Answered
How to summation using for loop with a vector
rng('default') n = 100; x = normrnd(10, 1, 1, n); y = 1 + 2 .* x + normrnd(0, 1, 1, n); xbar = mean(x) ybar = mean(y) sxy ...

4 years ago | 0

| accepted

Answered
Why do I get a size mismatch error when trying to fit a surface using an external function?
So you say function z = TestFit(x, y, n2) z = 2*x+3*y*n2; end works, but function z = TestFit(x, y, n2) % a meaningles...

4 years ago | 0

Answered
Fmincon finds no solution with break Points
The code below works. Do you have an example where it fails ? f1 =@(x) 10*(x(1)-2)^4+10*(x(1)-2)^3+10*(x(2)-2)^4+10*(x(2)-2)^...

4 years ago | 0

Answered
How to find '1' for the second time in a matrix by row wise
A = [ 0 0 1 0 0 0 0 0 1 1 0 0; 0 0 0 0 0 0 0 0 0 0 0 0; 0 0 0 0 0 0 0 0 1 0 1 0]; c = zeros(size(A,1),1); for i = 1:size(A,1) ...

4 years ago | 0

Answered
Fill up submatrix along third dimension with two dimensional matrix
x = NaN(3,3,4); x(1:2,1:2,:) = repmat([1 2; 3 4],1,1,4); x

4 years ago | 0

Answered
Build a Nonlinear Regression model
https://de.mathworks.com/help/stats/fitnlm.html https://de.mathworks.com/help/stats/nlinfit.html https://de.mathworks.com/help...

4 years ago | 0

Load more