Answered
Summation in MATLAB in 4 dimenstion
for t = 1:T s(t) = 0; for i=1:i <---- for i=1:i does not make sense for j=97:176 if w(i,j,15,t)<0 ...

3 years ago | 0

| accepted

Answered
ind2sub with arbitrary martix
You mean A = rand(5,6); s = size(A) ?

3 years ago | 0

Answered
Multi functions multi variables optimization
Use fmincon. Define the constraints 1<a<2; 2<b<3; 3<c<4; 4<d<5; 5<e<6 in lb and ub, define the constraints 0<F(a,b,c,d,e)<...

3 years ago | 0

| accepted

Answered
solve system by converting a matrix to vector
n = 4; A = rand(2*(n-1),2*(n-1)); b = rand(2*(n-1),n-1); x = A\b u = x(1:n-1,:) v = x(n:2*(n-1),:)

3 years ago | 1

Answered
Optimize the construction of a function for quadrature purposes
MyInt = integral(@myfun, 0, 2*pi) function Output = myfun(t) p = (1:20).'; Output = sum(1./p.*cos(p.*t) + 1./(2*p).*sin...

3 years ago | 1

| accepted

Answered
bvp4c or bvp5c code needed for 2nd order BVP having unknown parameters.
syms u(y) y syms M P h k real eqn = diff(u,y,2)-M^2*u==P; conds = [u(h)==1,u(k)==1]; dsolve(eqn,conds)

3 years ago | 0

| accepted

Answered
How to calculate R^2 using 1 - (SSR/SST)? For normal fit distribution.
In my opinion, it does not make sense to fit a linear function to the value pairs (cdf(normalfit, actual_values),Table.nonExceed...

3 years ago | 0

| accepted

Answered
How to generate Pareto front for an external function ?
Use "gamultiobj".

3 years ago | 1

| accepted

Answered
3d implicit function plot with the sign function
MATLAB assumes that the function f you provide is continuous. For x+y+z =1, the function returns -0.1, for all other triples for...

3 years ago | 0

Answered
Array indices must be positive integers or logical values. - specific to EEG data
Rename this variable - it conflicts with MATLAB's "fft" function. fft = 2^nextpow2(57001);

3 years ago | 0

Answered
How to integrate over the entire bounds of a solution to a PDE at a given time step using PDEPE
How can I integrate over the entire geometry to find the total concentration at each time step? Do I have use PDEPE for small st...

3 years ago | 0

| accepted

Answered
Loop for 1:100
A_cont is a matrix of size 101 x 201. In row i of A_cont, the array AH(1:101) is stored in columns i to i+100 (thus in the part...

3 years ago | 1

| accepted

Answered
Using trapz to obtain the AUC over a fixed bin
If the x-values are 1,2,3,... dff = rand(115305,1); for i = 1:floor(numel(dff)/600) AUC(i) = trapz(dff((i-1)*600+1:i*600)...

3 years ago | 0

| accepted

Answered
Empty Sym: 0-by-1
f = @(y) cosh(y).*sinh(y)-5/3*y ; y = 0:0.01:1 ; plot(y,f(y)) syms x y assume (x,'real') eqn = cosh(y).*sinh(y)-5/3*y==0; ...

3 years ago | 0

| accepted

Answered
How do you make the diagonal and certain off-diagonal elements of a matrix zero?
n = 9; A = rand(n) for i=1:n-1 A(i,i+1) = 0.0; A(i+1,i) = 0.0; end A

3 years ago | 0

Answered
Retrieving numbers present within an array by knowing the coordinates
image_DEF_numero_pixel = importdata('image_DEF_numero_pixel.mat') union = importdata('union.mat') vector = arrayfun(@(x,y)imag...

3 years ago | 0

Answered
Having trouble solving two second order ODEs simultaneously
According to your equations in the graphics, these terms in the MATLAB code are wrong: - (1/Dij)*(2*diff(Rj,t)*diff(Rj,t,2)^2+ ...

3 years ago | 0

| accepted

Answered
Problem with calculating the negative are enclosed between a curve and the x-axis
Try idx = y<=0; jdx = y>=0; xn = x(idx); yn = y(idx); xp = x(jdx); yp = y(jdx); [xn,I] = sort(xn); yn = yn(I) [xp,J] = ...

3 years ago | 0

| accepted

Answered
Optimization of a simple composite structure
Why not varying the angle between -90 and 90 in steps of delta_theta and choosing the value of minimum deflection ? Do the fin...

3 years ago | 1

Answered
Why do I keep getting a zero for x(9) for Backward subsitution?
Don't generate random numbers that can become 0 on the diagonal. Or use your code to check if all U(i,i) are not equal 0. Furth...

3 years ago | 1

| accepted

Answered
Solving for the parameters of a distribution
The formula for the quantiles of the lognormal distribution as a function of p, mu and sigma is given here: https://en.wikipedi...

3 years ago | 0

Answered
How to solve an equation with arrays
syms b k_eff % reflector Dr=0.088; Sa_r=0.0033; %core Dc=1.45; Sa_c=0.0044; nu=2.5; Sf=0.0032; a=30; eqn = Dc*sqrt(-(2...

3 years ago | 0

| accepted

Answered
How to plot empirical cdf and fitted distributions cdfs?
Table = readtable("practice3.xlsx"); a = Table.values; a = sort(a); hold on cdfplot(a); % Make a plot of the empirical CDF ...

3 years ago | 0

| accepted

Answered
Not sure why I am getting errors for my anonymous functions.
This would work: k = randn(1); % random variable % define all of your variables below f = @(x) (sin(x)+4*x)./x.^2; A = f(5);...

3 years ago | 0

Answered
lsqcurvefit question - ydata has two dimension (Function value and YDATA sizes are not equal)
Your function "fun" must return a matrix of size (60x2) like the ydata you provide. This is not the case - thus the error messag...

3 years ago | 1

Answered
Is there a function to determine the non-exceedance probability of each value in the table?
You will first have to tell us the type of distribution the values are supposed to follow (e.g. log-normal distribution). After...

3 years ago | 0

Answered
How to have a function return a coordinate point?
[x,y] = unitCircle(pi/4) function [x y] = unitCircle(theta) z = [cos(theta),sin(theta)]; x = z(1); y = z(2); end

3 years ago | 0

| accepted

Answered
Is there something wrong with my anonymous function definition?
Fmincon expects fun1 to have one vector of length n of parameter values as input, not n scalar values as for your function fun1....

3 years ago | 0

| accepted

Answered
Numerical method of solving three unkown parameters
As far as I understand the article, the left-hand side of equation(18) is 0 at I = I_mpp, V = V_mpp according to equation (6). B...

3 years ago | 1

Answered
How can I overcome from this problem? any another method to solve this.
As long as you don't know the reason for the integration problem, you won't be able to overcome it. We can only refer to the di...

3 years ago | 0

| accepted

Load more