Respondida
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 ...

más de 2 años hace | 0

| aceptada

Respondida
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...

más de 2 años hace | 2

Respondida
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?...

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 1

| aceptada

Respondida
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...

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 1

Respondida
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...

más de 2 años hace | 2

Respondida
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...

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 2

Respondida
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...

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 0

| aceptada

Respondida
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....

más de 2 años hace | 0

| aceptada

Respondida
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...

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 0

| aceptada

Respondida
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...

más de 2 años hace | 1

Respondida
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...

más de 2 años hace | 0

Respondida
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 ...

más de 2 años hace | 1

Respondida
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...

más de 2 años hace | 1

Respondida
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...

más de 2 años hace | 1

Respondida
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...

más de 2 años hace | 0

| aceptada

Respondida
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 ...

más de 2 años hace | 0

Respondida
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...

más de 2 años hace | 2

Respondida
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. ...

más de 2 años hace | 1

| aceptada

Respondida
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...

más de 2 años hace | 2

| aceptada

Respondida
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...

más de 2 años hace | 1

Respondida
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...

más de 2 años hace | 1

| aceptada

Respondida
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...

más de 2 años hace | 0

Respondida
How do i make an exponential curve graph from a vector?
You can't have a polynomial that will fit that curve shape. They simply do not have that characteristic form. So using polyfit (...

más de 2 años hace | 0

| aceptada

Respondida
How do I get normal numerical answers using solve or vpasolve?
vpa will turn those products involving pi into more normal looking numbers. For example... x = 17*sym(pi) So x has pi in it. ...

más de 2 años hace | 0

Cargar más