Answered
How to evaluate sym using certain known multiple values?
Easy peasy, though using matlabFunction here is not my recommendation. syms('x',[1,3]) So x is a vector, with elements [x1,x2,...

2 years ago | 2

Answered
Trying to Solve quadratic inequalities
syms x ineq = x^2-2*x+7>12; sol = solve(ineq, x,'returnconditions',true) sol.x sol.conditions The result is two half-infini...

2 years ago | 1

Answered
Compute linear interpolant in pp form and find derivative
n = 10; x_grid = linspace(-5,5,n)'; f_grid = x_grid.^2; % A simple quadratic polynomial fn = spapi(2,x_grid,f_grid) Convert ...

2 years ago | 0

| accepted

Answered
How can I create randomly scattered points between two circles?
Let me explain it differently than the rest, with a simple, intuiitive derivation. Again, the problem is perfectly symmetric in...

2 years ago | 2

Answered
Hi, everyone! I have a question about generating random meshgrid.
Any better way? Sorry, but no. You want to generate a "randomly" perturbed mesh, but one where each cell has exactly equal area?...

2 years ago | 0

Answered
Determine if 3d point belongs to polyhedron
Since I'm going to show how to do it using a triangulation anyway, I might as well post it as an answer instead of a comment. x...

2 years ago | 1

| accepted

Answered
Coefficent of determination in a nonlinear system
R^2 is not always a meaningful thing to compute for nonlinear regression models. On some problems (those with no constant coeffi...

2 years ago | 0

Answered
How to find the slope of a linear area
There is NO linear region in such a curve. Only a region which is moderately close to linear. It is a CURVE. Not a straight line...

2 years ago | 1

Answered
How to locate the answer in the given code?
Let me expand on what @Dyuman Joshi has said. Suppose you use any function in MATLAB. We will see what happens here, if it is us...

2 years ago | 2

Answered
Record n values and once finished start replacing the oldest values with new ones
There are many ways to solve such a problem. A simple one is to just do a shift at each step, shuffling all of the elements in t...

2 years ago | 0

Answered
Matlab giving incorrect matrix multiplication :/
This is a common error I see novices to programming make. They do something strange, get something stranger yet, and immediately...

2 years ago | 2

Answered
Thomas algorithm tri diagonal matrix
DON'T WRITE YOUR OWN CODE FOR A PROBLEM LIKE THIS. Instead, just create the tridiagonal matrix, as a sparse matrix. Then use b...

2 years ago | 0

Answered
Help with the equation
So why not try it? First, use valid variable names, not greek letters for the variables. rho = 1.025; L = 130.2608788; B = 2...

2 years ago | 0

| accepted

Answered
Solving the arising equation with preconditioned iteration method.
I'm not sure what you are talking about. BOTH PCG and GMRES are written in MATLAB itself. So the source code is provided to you....

2 years ago | 0

| accepted

Answered
Optimization involving complex variable.
If you just need to find a new matrx B, then there is ABSOLUTELY NO reason to use optimization techniques! A is assumed to be a...

2 years ago | 0

Answered
Finding coefficients and bias term for equation y = (x-B)*A
As my comment stated, this question is impossible to answer in any meaningful way. That is, given 1x3 vectors X and Y, can you f...

2 years ago | 0

Answered
how can i create a smooth curve through data points
It VERY much depends on what you define as "smooth". A smooth curve would generally not have a derivative singularity in it, yet...

2 years ago | 0

| accepted

Answered
Is it possible to use polyfit in a way that it takes into account the errorbars?
Different people mean different things when they say error bars. But you also use the word weights, which is a bit more standard...

2 years ago | 1

Answered
I am looking for advice on the best way to learn matlab. I am a second year PhD student trying to familiarize myself with problems or projects. Any advice?
There is no "best" way to learn. It surely depends on you and your own learning style. Ok, probably the best way would be to hir...

2 years ago | 0

Answered
Derivative of spline with respect to y-values
Bruno is correct. Anyway, is there a good reason why he would lie? Just because something is more complicated, does not make it ...

2 years ago | 1

Answered
How can obtain the probability density function for a random discreate set of data and fit a custom distribution function ??
Can you write custom code to fit a PDF to data? Yes. It is not that truly difficult, if you know what you are doing. HOWEVER, SH...

2 years ago | 1

Answered
How to solve equation with several unknown variables for a specific variable?
When you pose it as you did to solve, solve assumes you are trying to solve TWO equations, one of which is the equation cos...

2 years ago | 1

Answered
How can I plot the innermost contour?
As an aside, since @Cris LaPierre has already suggested the use of LevelList to do the job. And that arguably is the correct ans...

2 years ago | 0

| accepted

Answered
why I get the error message like "Attempt to execute SCRIPT bar as a function"?
Don't use existing function names as the names of your own scripts. If you do, then eventually you will get strange errors like ...

2 years ago | 0

Answered
Element wise multiplication of a 4D Matrix
A confusing question. MAYBE you are asking how to take the product of the elements along the 4th dimension? That is consistent w...

2 years ago | 2

Answered
round() function does not work as expected
Sorry, but it is often the case that your vector X is not what you thought it was, or you have written a function named round. ...

2 years ago | 1

| accepted

Answered
How can I cut four numbers after the decimal number without rounding using MATLAB ?
You want to truncate after the 4th decimal place? Easy peasy. You shift where the decimal place lies, then use floor. format l...

2 years ago | 2

| accepted

Answered
Why isn't vectorization faster than repeating loop comparing 6 about years ago.
Things change. Vectorization OFTEN is faster. But nothing says it MUST ALWAYS be faster. Remember that vectorization often trade...

2 years ago | 1

Answered
Matlab solver for unconstrained convex optimization
Everybody wants things to be incredibly fast. Large problems can take large time. Nothing stops you from writing a simple gradi...

2 years ago | 1

| accepted

Answered
Non-square matrix inverse
You CANNOT do so. That is, you cannot learn the original values. You cannot go backwards. A simple example is: Choose any two n...

2 years ago | 0

Load more