Answered
Is it possible to store the intermediate values of fmincon?
The problem is that people using fmincon often have problems with many dimensions. So the display option for fmincon cannot logi...

6 years ago | 5

Answered
Hey guys could you help me to convert this function into a 3D one ?
Why do you need 3-d? The fact is, you cannot plot this in 3-d. You can plot it in either 2-d, or in 4-d, but not in 3-d. And you...

6 years ago | 0

| accepted

Answered
produce all combinations of n choose k in binary
This is easier than you may think, as long as you think outside of the box just a bit. n = 5; k = 3; dec2bin(sum(nchoosek(2...

6 years ago | 4

| accepted

Answered
How can I hide all variables in work space to display ?
Um, then don't make it a script? Scripts are something worth learning to avoid as you progrees further into MATLAB anyway. But i...

6 years ago | 1

Answered
How to select figure by name?
My approach would be to create the figure names when you create the corresponding figure. fred = figure; barney = figure; Now...

6 years ago | 2

Answered
Noise in Handel’s Messiah adding noises with random number generator
Well, you did make some effort, sadly an unusual thing from many students. So a start. ;-( clear load handel whos Name ...

6 years ago | 0

Answered
Determine point of interception
It looks like you have made an error in the mathematics. Without deriving your equations from scratch, I note that you use a v...

6 years ago | 0

Answered
Save error R² of an interpolation curve in variable
You misunderstand the idea of interpolation, confusing it with approximation. R^2 is identically 1 for an interpolation, since ...

6 years ago | 1

| accepted

Answered
Can heavisides be incorporated into ODE solvers by reducing max step size?
I would guess that step discontinuities could be a mildly dangerous idea for solvers, as that could create a stiff problem. But...

6 years ago | 0

Answered
System of Equations: linsolve warning re: rank-deficient system, but null function & A\B aren't helping to fix the problem.
I'm more awake now to look at your equations, although I see that use of null is still essentially meaningless here. They are al...

6 years ago | 0

| accepted

Answered
Xor operation on two numbers
Use the 2 argument form of dec2bin, comverting to binary. This allows you to insure the two binary equivalents are stored with t...

6 years ago | 1

Answered
video in a figure
Usually the trick is to use the command: axis tight to force a set of axes to fit tightly to what is plotted inside them, mini...

6 years ago | 0

Answered
% symbol at the start of a line
That turns the line into a comment. It is no longer used as code. A % can also appear later in the line. When something is seen...

6 years ago | 0

Answered
How to get clean and high resolution images for figures
While it is true that a .jpg will not be what you want to achieve, there are better ways to save a file when your target is a hi...

6 years ago | 1

| accepted

Answered
Question about using randperm in a loop
So, you want to sample 5 sets of 5 numbers, all from the same set, but you want them to be unique? (The technical description wo...

6 years ago | 1

| accepted

Answered
How to write this matlab code?
By the way, learn to use semi-colons. What happens here in MATLAB? A=(B-mean(B))*P; In B, MATLAB sees a matrix of size 8760X3...

6 years ago | 0

| accepted

Answered
What is wrong with my nonlinear equality?
When you have a problem, the first thing you should do is to try to run your function, alone from the commandline. In fact, I of...

6 years ago | 0

Answered
Find divisors for a given number
If you are allowed to use factor to determine the prime factors, then it is pretty easy. You also never need to get stuck in the...

6 years ago | 10

Answered
Continue next statement on cd command
Use cd as a FUNCTION call. cd(['D:\Onedrive\OneDrive -xxx\bbb\ccc\ddd\3. Simulation\3. Fluent Case\40um - 9'... '\Equivale...

6 years ago | 0

| accepted

Answered
Finding Multiple Roots In Matlab (Equivalent of R rootSolve/multiroot)
First, when you do this: objective([9.818820 9.771408],A,B,T,Ve,r,D) you are using a 7 digit approximation to the solution. 9....

6 years ago | 0

| accepted

Answered
Multivariatecurve resolution-alternating least squares (MCR-ALS ) code for Voltammetric data
Start by learning MATLAB. Read the getting started tutorials. You can do nothing if you have no clue how to use the tool. If you...

6 years ago | 2

Answered
How do i denormalize the data after i have used the "normalize" function?
You can't. Well, you can, but only if you do what you need in advance. X = 1:5 X = 1 2 3 4 5 nor...

6 years ago | 2

| accepted

Answered
How to find volume of intersected part when two spheres are intersected using Matlab?
You can use my spheresegmentvolume utility to solve this. It is on the file exchange. https://www.mathworks.com/matlabcentral/f...

6 years ago | 0

| accepted

Answered
How to initialize a new matrix of the same type as an existing variable?
Simplest is to use zeroes!!!!!! Ones will also work. For example, suppose that X is an array of some generic numeric class. It m...

6 years ago | 2

| accepted

Answered
How to impose that the solution takes zeros values in some elements using fmincon?
To me, it means the constraints written don't correctly encapsulate the stated goals. One of those stated goals is there must be...

6 years ago | 1

Answered
Summing An infinite Series
I might start by using the correct function. In MATLAB, that is symsum, not syssum. :) These dumb computers, they refuse to read...

6 years ago | 0

| accepted

Answered
how to generate a random vector with fixed sum and bounded elements
If your bounds are the same for all elements, then use randfixedsum. It is amazingly efficient, even for high dimensional proble...

6 years ago | 2

Answered
Number of cores, by default
As Andrea has suggested, read the other thread. This is usually a question of hyper-threading. Your computer makes it look as i...

6 years ago | 2

Answered
I was wondering how to create a function that orders an array from smallest to largest. this is what i currently have, im not allowed to use any sort, max, or min fucntions
Why not just do some reading online? For example, if I do a search online for the words "sort wiki" then scan down, I see a link...

6 years ago | 0

| accepted

Answered
Perpendicular line to equation of motion
Basic math will suffice. No need for anything sophisticated. You have an initial location in space, in the form of a vector. I...

6 years ago | 0

Load more