Question

How can one extract a column based on a value of another column?

I have a two column matrix A. The first column takes a value of 0 or 1. I want to extract the elements of the second column acco...

1 month ago | 1 answer | 0

Question

How can one specify where the plot will be shown in Livescript?

I have livescript and have plot and various plot specifications. I choose "Output inline." Currently the plot is displayed after...

1 month ago | 1 answer | 0

Question

Multiple histograms and what will be the best way to put mean and std of data into a plot?

I will have three histograms in one plot histogram(A) hold on histogram(B) hold on histogram(C) I now want to get mean ...

1 month ago | 1 answer | 0

Question

create a vector of 0 and 1s that takes 1 at a fixed interval

I would like to create a vector of 0s that takes 1 at a given (m) interval. For example, if m=2, the vector will be like 0,0,1,...

1 month ago | 3 answers | 0

Question

can calculate mean but not std

I have a vector A. I can myavg=mean(A) myavg=0,3 but stDev=std(A) will give "Array indices must be postiive integers or...

1 month ago | 1 answer | 0

Question

How can one put mean and std of the data into histogram using annotation?

https://www.mathworks.com/matlabcentral/answers/303281-i-am-new-to-matlab-i-want-to-display-the-standard-deviation-and-the-mean-...

1 month ago | 2 answers | 0

Question

A function that outputs multiple plots? Part 2

In a previous question, one learned a function without output and output plots. https://www.mathworks.com/matlabcentral/answer...

1 month ago | 1 answer | 0

Question

opengl and liveeditor error

After I followed https://www.mathworks.com/matlabcentral/answers/575557-matlab-has-disabled-some-advanced-graphic-rendering-fe...

1 month ago | 0 answers | 0

Question

A function that outputs multiple plots?

Can one write a function that outputs multiple plots? https://www.mathworks.com/matlabcentral/answers/116996-how-to-write-a-fu...

1 month ago | 1 answer | 0

Question

how can one create a new color?

I create a new color (that is, a new RGB setting). How can one save it as a new color so that I do not need to type RGB each tim...

1 month ago | 1 answer | 0

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

2 months 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...

2 months 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...

2 months 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) ...

2 months 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...

2 months 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...

2 months ago | 1 answer | 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...

2 months ago | 1 answer | 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...

2 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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...

2 months 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...

2 months 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...

2 months 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 ...

2 months 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...

2 months ago | 1 answer | 0