Answered
How to get a line from two points collected using ginput
You aparently know how to use polyfit. But it seems you do not understand what it returns. x = 1:5; y = [2 3 5 7 11]; P1 = po...

3 years ago | 0

| accepted

Answered
how to use ones to make an array with size determined from a large number listed in scientific notation?
9.4500e+4 is not even remotely a very large number. Relatively small really. And that means you should verify it is an integer. ...

3 years ago | 0

| accepted

Answered
What does this operation do in matlab?
var2 is used as an index. It extracts the corresponding element of var1, thus creating var3.

3 years ago | 0

Answered
How do I solve for the value of a constant to make a system consistent?
syms w Q = [0, 3; 1, 5; 0, 4; 1, -2] c = [3; 6; 4; w] So you have a matrix Q, and a vector c. Can you find w, such that the p...

3 years ago | 1

Answered
Calculate the temperature distr
Little to say about the code. Does it compute the correct result? If it does, then it is code, code that works. Why do you need ...

3 years ago | 0

Answered
Modify code of straight circular cone to get a slate one
Assuming you mean a skewed cone, this is simple to do. You already know how to use the cylinder function. help cylinder A cone...

3 years ago | 1

Answered
I want to calculate pi^2 to 22 decimal places
As a strong suggestion, you want to do some reading here: https://en.wikipedia.org/wiki/Approximations_of_π Again, you CANNOT ...

3 years ago | 1

Answered
How to fit a biexponential decay function
First, NEVER set up a solver to fit exponential models with the SAME initial rate parameters for both terms!!!!!!!! So this is f...

3 years ago | 2

Answered
Constraining fit via function value instead of coefficient values
No. You cannot use fit to perform such a fit, where you place a constraint on the function values. And, yes, a polynomial is a ...

3 years ago | 1

| accepted

Answered
Meaning of square bracket
You probably need to do the basic MATLAB onramp tutorial, as this should be covered there. And it is free. But this is how you ...

3 years ago | 0

Answered
how to speed up symbolic integration or turn this to numerical integration
As a suggestion, it is not at all uncommon to use a Gauss-Legendre quadrature for these things. Why? The kernel should be polyn...

3 years ago | 0

| accepted

Answered
How to obtain argument value of an equation
I wrote an allcrossings tool, that I posted on the file exchange. I've attached it here. https://www.mathworks.com/matlabcentra...

3 years ago | 0

| accepted

Answered
Why does cumtrapz give lower magnitude for very thin Gaussian?
As @the cyclist tells you. I would suggest you accept his answer as the correct one. I'm posting an answer here, as opposed to a...

3 years ago | 0

Answered
Trapezoidal quadrature weights from nodes
Hmm. Why not just call trapz? (A suspicious mind here, as this is too easy a question, and there are few good reasons why you ne...

3 years ago | 0

| accepted

Answered
Find distance between a circle and a polygon?
This is clearly homework, of some sort, if you NEED to find those speciific parameters. As such, you need to make an effort. Bu...

3 years ago | 0

Answered
I am supposed to write a cod to show a given numebr in two elements ; power of 2 and muliple of 5 i.e: nu=2^x+5*y or nu=2*x-5*y
Since you have written some code, at least tried to show an effort, I will give you a couple of hints. First, you will not be a...

3 years ago | 1

Answered
Can anyone duplicate my matlab crash?
No problem encountered on two machines, but I don't have that release on my machine, and I think it is probably too old to run o...

3 years ago | 1

Answered
systems of equations, with constraints
This is a question more about understanding the mathematics of the problem, than of understanding how to solve it in MATLAB. Unt...

3 years ago | 1

| accepted

Answered
How to describe a function with a sum of discrete values?
Just use cumtrapz to perform the cumulative integral. help cumtrapz

3 years ago | 0

| accepted

Answered
change class syms to double
If your sym variable still contains ANY symbolic parameters, then nothing can change it to a number. A double connot store a sym...

3 years ago | 0

| accepted

Answered
Generating random points between two n-dimensional boxes
In 2-dimensions, I posted a solution on the FEX that would work. But 2-d is trivial. You triangulate the domain, then generate r...

3 years ago | 0

| accepted

Answered
Adjust the parameter of the Uniform Random Number Module
rand ALWAYS generates numbers in the interval (0,1). ALWAYS. You cannot change that. However, if you bother to read the docs for...

3 years ago | 0

Answered
how to convert a real number/or integer into fixed number of bits?
I'm confused, by a confusing question. You want to convert a real number into a representation as a fixed number of bits, so co...

3 years ago | 1

| accepted

Answered
find maximum distance between a point (outside of polygon) and a polygon?
You DON'T need QUADPROG!!!!!!! There is no need to quadratic programming to solve the maximum distance to polygonal region. Al...

3 years ago | 1

| accepted

Answered
Why some points do not satisfy the condition?
So often this mistake is made. Are those the EXACT values of those coefficients? To me, that would seem a surprise, that they we...

3 years ago | 0

Answered
How to repeat a vector over and over?
So write a function that does it for you. vec = 1:4; repvec(vec,7) vec = [0;1]; repvec(vec,8) function newvec = repvec(vec,...

3 years ago | 1

| accepted

Answered
Pentadiagonal matrix to solve for Pressure variable
WHY? Don't write code to do what was already written well by world class experts in linear algebra. You are using MATLAB. So use...

3 years ago | 1

Answered
I cannot the error in the bisection method...
Get used to using the dotted operators for some things. That allows MATLAB to use vectorization in tools like fplot. f = @(x) x...

3 years ago | 0

| accepted

Answered
Hello! How to define on which plane lies a given point with coordinates? I have coordinates of plane and normal
Does a point lie in a plane? This is quite easy to do. The equation of a plane is a simple one. In fact, it works in any number...

3 years ago | 0

| accepted

Question


Should equationsToMatrix handle inequalities?
equationsToMatrix is a very nice tool. It works great to unpack an equality relation, like this: syms x y EQ = x + 2*y == 3 [...

3 years ago | 1 answer | 0

1

answer

Load more