Beantwortet
How to give a condition based on the following situation
Why does it matter? Just pick one of them. Or choose randomly between them. Or on odd numbered days, choose the first, on even n...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to replace the non zero values of a matrix with another value?
A(A ~= 0) == 0.1; One line of code. That applies to ANY release of MATLAB. As far back as I have been using MATLAB, so only bac...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
how to script rectangular function in MATLAB
Define what a rect function is, since I find it difficult to read your mind. I'll guess it might be a unit rectangular pulse of ...

etwa 3 Jahre vor | 0

Beantwortet
How can I 3d interpolate a function f: R^3 --> R^3 ?
This is a common problem, at least in the world of color modeling as I worked for many years. You will want to build 3 interpola...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Positive definite and LQR
R = 1; C = [0 0 1]; Q1 = 25*C'*C; N = zeros(3,1); matrix = [Q1 N;N' R]; The matrix Q1 has rank 1. You formed it from a vect...

etwa 3 Jahre vor | 1

Beantwortet
How do I simplify polynomial coefficients with symbolic variables to the least possible forms?
The simplest form in your eyes is not always what a computer sees as the simplest form. It may require factoring the polynomial ...

etwa 3 Jahre vor | 0

Beantwortet
Smoothing a distribution curve
The distributions you show are not at all unsmooth. And they don't look at all uncommon for problems of that kind. So I'm not su...

etwa 3 Jahre vor | 2

| akzeptiert

Beantwortet
how can i see the steps in ref and rref.
You can't really. But you could, sort of. For example, you could use the debugger, and trace through the code as it runs on your...

etwa 3 Jahre vor | 0

Beantwortet
How to solve a singular matrix problem?
Probable user error. How can you solve it? Almost always with a FEM problem, a singularity arises when you have made a mistake....

etwa 3 Jahre vor | 0

Beantwortet
How to find max value for a function between 2 specified values
Use fminbnd. fun = @(x) sin(x); [xloc,fval] = fminbnd(@(x) -fun(x),0,pi); xloc maxval = -fval So the maximum arises at x==p...

etwa 3 Jahre vor | 0

Beantwortet
Find combination of 12 matrix rows, fulfilling certain criterion, from matrix of size 3432 *7
Finding all possible computations there are would be a computationally hard problem, certainly if you used brute force. It would...

etwa 3 Jahre vor | 0

Beantwortet
Find (local?) maxima when two maxima are adjacent to each other (maybe using islocalmax or findpeaks?)
help islocalmax Now, look carefully at the elements of that array. freq = [37 37 23 1 1 1]; m = islocalmax(freq) Is element ...

etwa 3 Jahre vor | 0

Beantwortet
How to use lsqnonlin with multiple constraints?
These are not so much constraints, as bounds. They are simpler things. lsqnonlin allows bounds, but not equality or inequality c...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Count all pairwise interactions in a matrix
If you have only one row, then it is trivial. Just use nchoosek. Row = [2 3 5 7]; Row(nchoosek(1:4,2)) But you have multiple ...

etwa 3 Jahre vor | 0

| akzeptiert

Beantwortet
Can anyone please help me with PSAT 1.34 software
What is the problem? You can download it. http://faraday1.ucd.ie/psat.html It appears the documentation is not available for ...

etwa 3 Jahre vor | 0

Beantwortet
Different ways to solve a problem based , non linear function (sum(K.^2) -K is a 20*1 matrix) problem with linear equality constrains and having binary, continuous variables
None of the optimizers in the optimization toolbox (except for intlinprog, which handles only linear problems, so it does not ap...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to create a surface plot having 3 vectors?
Without knowing what your data looks like, it is difficult to help. And we don't see any data. For example, do you think that s...

mehr als 3 Jahre vor | 0

Beantwortet
How to calculate the volume of trisurf?
If the points are on a sphere, thus a convex object, then a convex hull is what you want, not Crust anyway. Crust will allow the...

mehr als 3 Jahre vor | 0

Beantwortet
Asymmetric intervals built-in vectorisation
You can decide that some syntax is what you want to have work, but there are limits. And I would no be surprised if someone else...

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 1

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

mehr als 3 Jahre vor | 2

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

mehr als 3 Jahre vor | 1

| akzeptiert

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

mehr als 3 Jahre vor | 0

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

mehr als 3 Jahre vor | 0

| akzeptiert

Mehr laden