Answered
Find index of a number in a 3d array
i = find(A(:) == 31.5814); [i1 i2 i3] = ind2sub([14610,146,220],i(1)); A(i1,i2,i3) But most probably, floating point inaccura...

4 years ago | 0

| accepted

Answered
How to plot a function for different values of input parameter in a function
Just define xi as a column vector of values, e.g. xi = [0.03 0.06].'; % activity parameter

4 years ago | 0

Answered
Solve implicit equation for isentropic flow
gamma = 1.4; [mach,T,P,rho,area] = flowisentropic(gamma,4,'sup') Aratio = 4.0; gamma = 1.4; fcn = @(M) (1/M)*(2/(gamma+1)*(1...

4 years ago | 0

Answered
How to fit my experimental data with using matlab code
integrand = @(r) sech((rm-r)/gama).* ... (1./(1-exp(-2*pi*sqrt(Eb./(r-Eg))))).* ... (1./(1-b*(r-Eg))); K = A*(1/rm)*(...

4 years ago | 0

| accepted

Answered
MATLAB CODE FOR ROOT MEAN SQUARED
This is not the standard definition for the root-mean-square value of a matrix. Are you sure about the formula ? Then use cal...

4 years ago | 0

| accepted

Answered
Internal heat source as a function of x,y and time in pde toolbox
Thank you for your answer. So i can’t define the function f with piecewise as i did? It’s wrong? Yes, it's wrong because it is ...

4 years ago | 0

Answered
stiff ode solver with non-negative properties
Do the negative solutions result from numerical inaccuracies or from the equations themselves ? If the latter is the case, no r...

4 years ago | 0

Answered
Match the series in the graph
a = 0.3217; x = linspace(-a*sqrt(2)+0.01,a*sqrt(2)-0.01,1000); y = 1./(x.^2/2 + a^2).^1.5; s = zeros(1,numel(x)); for n =...

4 years ago | 0

| accepted

Answered
Internal heat source as a function of x,y and time in pde toolbox
User's Guide, page 5-541, shows you how to define your time-dependent heat source: https://de.mathworks.com/help/pdf_doc/pde/pd...

4 years ago | 0

Answered
Store my for loop in single vector
CMR = inv((k/100).*C1R+(1-(k/100)).*C0R); instead of CMR = inv((x/100).*C1R+(1-(x/100)).*C0R);

4 years ago | 0

| accepted

Answered
Problem fitting with lsqcurvefit
M = [26 93 27 67.9 28 54.5 29 20.5 29.1 20.6 29.2 17.6 29.3 15.7 29.4 13 29.5 12 29...

4 years ago | 1

| accepted

Answered
what will be the multiplication of all c values in loop (in given example), i.e. c1*c2*c3*c4*c5?
a = [1 2 3 4 5]; b = [0 1 0 6 4]; c = eye(2); for i = 1:5 c = c*[1 2+a(i); 1*b(i) 5]; end c

4 years ago | 0

| accepted

Answered
How to plot multiple curves on the same screen for different values of "b" with bvp4c solver?
The solution will be Y1 = b, Y2 = Y3 = 0 Is it that what you want ?

4 years ago | 0

Answered
How to plot this implicit function? (It's one parameter also changes)
So you want several implicit plots in different colors for different values of phi ? Use "fimplicit" in a loop using "hold on"...

4 years ago | 0

Answered
Matlab help throws "Too many input arguments" when clicking on help tab
https://de.mathworks.com/matlabcentral/answers/1791920-how-do-i-fix-the-help-button-when-it-gives-an-error-reading-too-many-inpu...

4 years ago | 0

Answered
I am writing a program for lateral- direction motion of an airvraft using Runga Kutta 4th order method.
%%this is my program: %write the computer programme in Matlab to solve equations of motion of %lateral-directional motion of a...

4 years ago | 0

Answered
extracting rows with the highest value
A = [1 3 4 6 2 5 8 1]; [~,imax] = max(A(:)); [irow,~] = ind2sub(size(A),imax(1)) A(irow,:)

4 years ago | 0

| accepted

Answered
Minimum and Maximum after maximum value
The first element of v which is a maximum is taken. If the last element of v is the maximum, m will be empty. v = [1 5 7 3 2 6...

4 years ago | 0

| accepted

Answered
How to draw contour plot of given function?
x0 = -0.1:0.001:0.1; y0 = -0.1:0.001:0.1; omega = 30; w0 = 0.02; m = 2; [X0,Y0] = meshgrid(x0,y0); f = @(x0,y0)sinh(omega*...

4 years ago | 0

| accepted

Answered
Why am I getting "incompatible array size error" when I am using only scalars in a nested integration problem
i1= @(r,tau) integral(@(x) fc(r,x,tau),0,inf,'ArrayValued',true); i2= @(r,tau) integral(@(x) 1-CC(r,x,tau),0,inf,'ArrayValued',...

4 years ago | 0

| accepted

Answered
Can someone check my code ?
That's exactly what your code does in my opinion. Or give an example where it does not perform as you described it should. Fou...

4 years ago | 0

| accepted

Answered
Minimizing an equation to 0
A = [4 3; 6 2; 7 -3]; B = [1 -3; 2 2; 5 -pi]; C = [12 -0.5; 7 -3; 0 1]; fun = @(p)reshape(A-(p(1)*B+p(2)*C),[],1); sol = lsq...

4 years ago | 0

Answered
Checking multiple values in an equation in MATLAB
format long x = 1271; [y,z] = result(x) function [y,z] = result(x) if x <= 30 disp('Problem not solvable') y =...

4 years ago | 0

Answered
Stability boundaries - intersection with real and Imaginary axis
You can determine the roots analytically because the polynomials have order <= 4. Here is a numerical solution for imag(Z) = 0....

4 years ago | 1

| accepted

Answered
Why ''int'' and ''integral'' return different answers
Your function has singularities at x = 0 and x = 1. Integral doesn't manage to estimate the area under the curve (which goes t...

4 years ago | 0

Answered
Need help understanding where to use the . when writing equations.
Read https://de.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html to understand. Dots are set for element...

4 years ago | 0

| accepted

Answered
Solving for two variable.
I = [7.53*10^(-5) 3.17*10^(-4) 1.07*10^(-3) 3.75*10^(-3) 1.35*10^(-2) 4.45*10^(-2) 1.75*10^(-1) 5.86*10^(-1)]; U = [0.50 0.55 0...

4 years ago | 0

Answered
Newton's Method missing value
If n is the number of Newton steps, you must start with n = 0 instead of n = 1 in "Newtons_method". I counted the number of New...

4 years ago | 0

Answered
Solving system of two (non)-linear eqautions multiple times using a for loop
%% constants rho = 1.3; D = 0.126; %% choose W = 2600; RPM = 6000; Omega = RPM*((2*pi)/60); i = 1500:1000:4500; %Solutio...

4 years ago | 0

Answered
Don't get what is happening in matlab sin() function. need to know difference between sin(2*50*pi*t) and sin(2*1*pi*t)
t1 = 0:0.001:1; x = sin(2*50*pi*t1); t2 = 0:0.1:1; y = sin(2*1*pi*t2); subplot(2,1,1) plot(t1,x) subplot(2,1,2) plot(t2,y...

4 years ago | 3

| accepted

Load more