fsolve doesn't give correct answer even with close initial guess
A serious issue is that you use many numbers accurate to only 2 decimal digits. So even though you may think the answer is corre...

| 採用済み

nonlinear curve fitting a function on data
sin(theta) is not a variable name. beta = 1.135e-4; sintheta = [-0.81704 -0.67649 -0.83137 -0.73468 -0.66744 -0.43602 0.45368 ...

| 採用済み

I have 30x30 matrix and need to extrapolate lower triangle numbers
You just want to extract the lower triangle, whatever is in it? The result going into a vector? A = magic(5) - 10 A = 7 ...

| 採用済み

Solve for a system of equations
This is not actually a question about MATLAB. Why would you assume that every set of complicated nonlinear equations has an exp...

Matrix Division: Different sized matrices
Is there a reason why you have not read the getting started tutorials? The manual is always a good thing to read. C = A./B; ...

How do I find what y equals from an equation?
First, when you have a question about an error, report the entire error, that which is written in red in the command window. Wh...

| 採用済み

Why does this code output all values as 1?
A significant problem with your code is in your assumption that this line does what you rthink it does: elseif r1<=r(i)<=r2 I...

If first and last rows of an orthogonal matrix is known, is it possible to determine remaining orthogonal rows?
If this is homework, and you need to do this using tools other than null, sorry, you are out of luck. I won't do your homework. ...

| 採用済み

Calculating Percentile from a pdf
Pretty simple actually, though it is far easier as I can give you an example, than if you posted your actual data rather than a ...

how to work with symmetric image
Sorry, but this is completely underdetermined. You can never recover A1, from the composite C. Consider any arbitrary array A1....

How can I make a Spinal Cord using matlab 2013?
Yes, surely so. Anything can be done. For that to happen, you will need to learn MATLAB, and then learn enough about how to mode...

| 採用済み

how to find the maximum symbolic value of a function with matlab
Almost certainly not gonna happen. As long as you keep all the coefficients symbolic, the result will be a fairly high order mes...

Simulation of irrational numbers
Perhaps now I am starting to understand what your question comes down to. The ratio of x1 and x2, if they are doubles, will nev...

| 採用済み

How to cut a 3D object using a plane and deleting the part above the plane, but creating new faces/vertices based on the points to ensure that the geometry below the cut is maintained?
Pretty simple really. Just the execution that takes some effort. Identify any simplex that has all vertices above or below the ...

| 採用済み

how to select a set of numbers randomly which meets a condition
Lol. Ok. I'll give a new answer since the old was was on a different set of constraints. Lets see. With the new set of constrain...

| 採用済み

how to select a set of numbers randomly which meets a condition
Its actually a bit difficult to find even ONE solution to the problem, even ignoring the question of them being integer. Lets p...

Problem with cubic spline
THINK! What is n? x = [0, 1, 2, 3]; % x coordinates of the data points n = length(x); n is 4. Then what do you do? h(1:5) =...

Crop a normal distribution to a predefined uniform distribution
This does not make sense. You have a data that lives in a roughly normal distribution, although it seems corrupted, if I look at...

Why is MATLAB not giving me the correct Maclaurin polynomial?
Lets look at what you did. If you view this as the exponential function, applied to x^2, thus exp(x^2), we can use the standard...

| 採用済み

How do I solve this System of equations
You are trying to do this with paper and pencil? syms Qs Qcond ms hcond E(1) = Qs-Qcond == 7500; E(2) = Qs-(2777*ms)/3.6 == 0...

solving a multi variables function equal to zero uzing fzero
As much as you want it to do so, fzero is not designed to solve multi-variable problems. Software cannot be made to do what it w...

| 採用済み

Integration of numerical data
Multiply the two vectors. Then call trapz.

Fastest way to replace values in an array if they equal a certain value?
Since the numbers are all integers, just do it as a lookup table. That makes the replacement a simple index into a vector. Done ...

| 採用済み

The length of the intersection curve between a sphere and a cylinder
I won't do your homework. I'll get you off to a good start, in fact, probably more than you deserve, since you appear to have ma...

| 採用済み

How to calculate the euclidean distance in matlab?
Actually, that is simply NOT the formula for Euclidean distance. You need to take the square root to get the distance. So, you s...

Error using command integral
Simplest is to just use cumtrapz. All you want is a plot anyway. u = linspace(0,4,1000); fun = @(x)exp(-x.^2); plot(u,cumtrap...

| 採用済み

estimating the parameter of an equation
Um, don't use fminsearch? In fact, I'm not sure why you would want to do it that way. d = 17; n = 10000; kk=randn(n,1); u=...

| 採用済み

Regarding Increase Resolution?
I'll take a stab at it. There are many tmes when we see in the movies, on TV, the idea that you can get almost anything out of ...

| 採用済み

How to perform mathematical operation between all elements of arrays with unequal numbers
A = rand(2,3); B = rand(4,5); C = A + reshape(B,[1,1,size(B)]); % Addition C = A - reshape(B,[1,1,size(B)]); % subtraction ...

| 採用済み

Difference Between Curve Fitting and Surface Fitting
A curve, thus y=f(x), is a function of ONE independent variable. A surface, thus z=f(x,y), is a function of TWO independent var...