Question

How to convert a 2D matrix to a 3D matrix without for cycles?

Suppose we have a 2D matrix (M2) and we want to create 3D matrix (M3) from it with the following definition: M3(n,k,j) = M2((k-...

6 years ago | 1 answer | 0

Question

Is it possible to get axis size in px units if it is created in normalized units?

I have the following code: set(gcf,'units','normalized','position',[0 0 1 1]) axes('units','normalized','position',[0 0 1 1]) ...

6 years ago | 1 answer | 0

Question

How to extract indices with a condition?

For example I have Y = X(X==42), but I need the indices also!

6 years ago | 2 answers | 0

Question

Is it possible to do this without for cycle?

T = zeros(M,K); for k = 1:K T(Y==k,k) = 1; end

6 years ago | 2 answers | 0

Question

How to get the last character pressed on the keyboard?

I dont want to wait to anything, just need to read out the last pressed key. Is it possible?

6 years ago | 1 answer | 0

Question

How to pause waitbuttonpress or delete charaters in the stream?

I need to get a character with waitbuttonpress, than I have to do a pause(2), and after that I need another char, but I want to ...

6 years ago | 0 answers | 0

Question

How to exit a script but not from MATLAB?

If I am in a nested loop, how to break everything and quit from the script? I've tried exit and quit, but in these cases MATLAB...

6 years ago | 1 answer | 0

Question

How many different seed is possible for rng()?

I cannot find in the description, that what is the maximum value of a seed which differs from another. And can it be zero, negat...

6 years ago | 1 answer | 0

Question

Some questions about rbbox!

Is it possible to change the appearance of the box? For example choose line instead of dashed line? Or use filled box? Is it ...

6 years ago | 1 answer | 0

Question

How to find minimal distance between elements?

I have a vector, and I would like to find the minimal distance between element values. Any element distance from any element in ...

6 years ago | 6 answers | 0

Question

What is the clock function?

I've already seen the help page: https://www.mathworks.com/help/simulink/slref/clock.html, but I cannot understand anything from...

6 years ago | 2 answers | 0

Question

What is the difference between rnd(s) and rand('state',s)?

What is the difference, and why rand('state',sum(100*clock)) is used, and what does it mean exactly?

6 years ago | 1 answer | 0

Question

How to find first occurrences of a number in the beginning of blocks of that number?

For example I have x = [1 2 2 3! 0 0 0 3! 3 3 0 1 1 3! 3 4]; And I need indices of first threes associated its block. Signed wit...

6 years ago | 2 answers | 0

Question

How to extract lengths of sequences from a binary vector?

For example, I have x = [0 0 1 1 1 0 1 0 0 0 0 1 1 0]; and I need 2,3,1,1,4,2,1. Are there any simple way to get this?

6 years ago | 2 answers | 0

Question

How to get mouse coordinates as inputs?

I would like to get mouse coordinates on a plot when left click is made. Is it possible with MATLAB?

6 years ago | 1 answer | 0

Question

Is it possible to plot on fullscreen with MATLAB?

I would like to use the entire screen, without window frame, menu, etc. Just a fullscreen plot area. Is it possible?

6 years ago | 4 answers | 0

Question

How to put yticklabels (with ticks) on the other (right) side?

I simply tried ax.YAxisLocation = 'right'; but not working, why? And what if I want ticks on both sides, but yticklabels on the...

6 years ago | 1 answer | 1

Question

How to put more than 200000 line segments on a plot?

I realized that MATLAB cannot handle more than 200000 line segments. Is it possible to do somehow?

6 years ago | 1 answer | 0

Question

How to save high resolution plots without displaying it on the screen?

I haven't found solution to use retina display with MATLAB, because the highest figure window size in pixels is far smaller than...

6 years ago | 0 answers | 0

Question

How to take advantage of the retina resolution of a MacBook with MATLAB?

My retina resolution is 2880x1800 but I cannot use that with MATLAB plot. For example set(gcf,'unit','pixel','position',[0 0 144...

6 years ago | 0 answers | 0

Question

Is it possible to save a plot figure without plotting it on the screen?

Is it possible to save a plot figure without plotting it on the screen?

6 years ago | 0 answers | 0

Question

How to save a plot with colored background?

I use set(gcf,'color','blue'), but in the saved .png the blue background colour is not seen. Why? And how to solve this problem?...

6 years ago | 0 answers | 0

Question

How to reset plot ratio without blinking (replotted) plots?

I use axis square, but the figure first showed on a non-squared plot that blinks and the image is rescaled. Is it possible to av...

6 years ago | 0 answers | 0

Question

How to set sizes of the axis area exactly?

I need to set the axis area to be 1600x1200px exactly. How to do that?

6 years ago | 0 answers | 0

Question

How to convert integer vector with the 1-of-K coding sheme into a matrix?

I have Y = [2 2 1 3 2 4 1 4 4 3]; And I need 4 x 10 matrix in which all values are zeros, except 2nd element in the 1st column,...

6 years ago | 2 answers | 0

Question

How to search a substring in a list of strings?

I have {'xx', 'abc1', 'abc2', 'yy', 'abc100'} and I would like to search 'abc' and get back {'abc1', 'abc2', 'abc100'}. Is it po...

6 years ago | 4 answers | 2

Question

Is it possible to extract numbers from formated strings without a for cycle?

I have {'abc12', 'abc23', 'abc24', 'abc99'} and I need the vector [12,23,24,99]. How to do this without a for cycle?

6 years ago | 4 answers | 1

Question

How to collect data into a vector from this data structure?

I have A.B(i,j).C(k).D(n).E.F, and i,j,k are fixed, but n runs from 1 to N. How to collect data into a vector? I know that it is...

6 years ago | 1 answer | 0

Question

MATLAB does not offer multinomial logistic regression with incremental methods instead of batch learning?

MATLAB does not offer multinomial logistic regression with incremental methods instead of batch learning? As I see mnrfit uses ...

6 years ago | 0 answers | 0