Question

extract mth and m+1st largest element from a vector

maxk find the largest elements of an array. Then, is there a function that allows to extract a general mth and m+1st highest ele...

ungefär 3 timmar ago | 1 answer | 0

Question

Matlab livescript copy and paste

I want to move, let me say, 200 lines of code in Livescript (in one section) to the end of the script (say). Is there any way be...

ungefär 6 timmar ago | 0 answers | 0

Question

fminbnd got stock in local minimum: can global search deal with the problem defined by cases?

I plot the value of a function over the possible values and also run fminbnd. I find out that fminbud got stuck in a local minim...

ungefär 8 timmar ago | 2 answers | 0

Question

How can one write a program to do this? (fminbnd)

I define a function function out = test(x) y=x^2; z=y+1; out=z end Then I run fminbnd(@(x) test(x),0,1) ...

ungefär 11 timmar ago | 1 answer | 0

Question

Why is it that the breakpoint does not work?

I define some function. I set a breakpoint in the first line after the function definition statement. But when I run the program...

ungefär 12 timmar ago | 2 answers | 0

Question

"Matlab has disabled some advanced graphic rendering features"

I got the following. What is the next step? t = tiledlayout(1,1,'Padding','none'); Warning: MATLAB has disabled some advanced...

ungefär 12 timmar ago | 0 answers | 0

Question

How can one install some font for Matlab on Ubuntu?

How can one know some fonts are available for Matlab on Ubuntu? How can one install some fonts on Ubuntu using https://wiki.ubu...

en dag ago | 0 answers | 0

Question

"unable to classify the variable in the body of the parfor-loop"

I tried X=ones(b*n,5) parfor (a=1:n, 12) Y=X((a-1)*b+1:1:a*b,3:4); sorted=sort(Y(:)); Z=sorted(en...

en dag ago | 1 answer | 0

Question

mlx file in Ubuntu

I create a mlx file on Ubuntu and try to save it. Then it is saved actually as a folder with matlab, metadata, and _rels folders...

2 dagar ago | 1 answer | 0

Question

fminbnd loop leads to same optimizer

I have a matrix of parameter A that is 2*2 matrix and other matrix B. The solution matrix C that is 2*1 Then I run for i=1:1:2...

2 dagar ago | 1 answer | 1

Question

Current function value: NaN

I use options = optimset('PlotFcns',@optimplotfval); [x,fval,exitflag,output] = fminbnd(fun,x1,x2,options) to get informati...

2 dagar ago | 0 answers | 0

Question

parfor: unable to classify

I got the following error message for parfor. Please advise. Error: Unable to classify the variable 'x' in the body of the p...

2 dagar ago | 1 answer | 0

Question

Put data into bins with pre-specified intervals

I have data distributed over [0,1]. I want to put data into pre-specified bins such as 0:.1:1. How can one do this?

2 dagar ago | 1 answer | 0

Question

Put data into bins with the equal number of elements

I have https://www.mathworks.com/matlabcentral/answers/182552-binning-data-in-equally-spaced-intervals that puts data into eq...

2 dagar ago | 1 answer | 0

Question

How can one generate a matrix that the first column is larger than the second column?

In a previous question I have learned that, given a matrix, how to pick the rows that the first column entry is larger than the ...

2 dagar ago | 1 answer | 0

Question

Choose rows that the first column is larger than the second column

I have an n*2 matrix A. I only want to have rows that the first column is larger than the second column. What is a simple way to...

3 dagar ago | 1 answer | 0

Question

Error message of fminsearchbnd

I go the error message Exiting: Maximum number of function Evaluatoion has been exceeded Increase MaxFun Evals Option Current...

3 dagar ago | 1 answer | 0

Question

How can one extract this vector from a matrix?

First, suppose I have a matrix M of 60 rows and 3 columns. Suppose each row is a month like January, February, ... so that every...

3 dagar ago | 2 answers | 0

Question

How can one make this program work? (fmin question)

In Part 1, I have learned that x_optimal = fminbnd(@fun,0,2) function out=fun(x) if x<=1 out=x; else out=sqrt(x); end ...

4 dagar ago | 1 answer | 0

Question

Can one set up initial values for fminbnd?

Can one set intial values for iteration for fminbnd? I do not find an option on the documenation: https://www.mathworks.com/hel...

4 dagar ago | 1 answer | 0

Question

Can one use courier new in the text part of Livescript?

I want to use courier new or similar to denote a function in a text part of Livescript. Is it possible?

5 dagar ago | 1 answer | 0

Question

Livescript: equation number

I edit Livescript and I write equations on Livescript using latex. Is it possible to number these equations like https://tex.s...

5 dagar ago | 1 answer | 0

Question

How can one "summarize a matrix with the first four columns"?

First, I have a matrix like 1 2 3 4 1.1 1 2 3 4 3 1 2 3 5 4 2 3 4 1 6 ... Second, what I would like to do is to summ...

7 dagar ago | 1 answer | 0

Question

Is there a simpler way to count the number of elements of a vector that is equal to a given number?

I have a vector v and a number a. I want to count the number of elements in v that is equal to a. What is a simpler way to do th...

7 dagar ago | 1 answer | 0

Question

Can one run fminsearch on grids?

I understand that fminsearch does the search on the real line. Can one run fminsearch on grids like 0:0.01:1?

7 dagar ago | 1 answer | 0

Question

How fast is fminsearch over brute force? or How fminsearch deal with a local/global min?

How does fminsearch prevents getting stuck with the local min?

8 dagar ago | 1 answer | 0

Question

What is the largest number of rows of a matrix that Matlab can handle?

What is the largest number of rows of a matrix that Matlab can handle? How can one know that limit in my PC?

8 dagar ago | 2 answers | 0

Question

Use the output of a previous calculation as an initial value for the next calculation?

First, I want to calculate the minimum of f(x:a) over x /in X for each value of a=0,0.1,0.2,... Second, what I do now is to c...

8 dagar ago | 0 answers | 0

Question

Can one run fminsearch for a function defined by cases?

First, I have a function defined by cases like if x<1 f(x)=x if x>1 f(x)=sqrt(x) Second, suppose I want to calculate the m...

8 dagar ago | 2 answers | 0

Question

How can one create frequency table of two dimensional data?

First, I have multidimensional data that look like 0 1 0 2 1 1 1 2 0 2 Second, I want to create a frequency table that co...

9 dagar ago | 1 answer | 0