Answered

Creatig a matrix from variables in workspace

How did you get these variables? It is not good practice to handle workspace variables after their definition. Better saving...

Creatig a matrix from variables in workspace

How did you get these variables? It is not good practice to handle workspace variables after their definition. Better saving...

casi 5 años ago | 1

Answered

how to save values in variable from loop

Save vector |a| before printing: a = 1:10; for k=a fprintf('%d\n',k); end a Outputs: 1 2 .... ...

how to save values in variable from loop

Save vector |a| before printing: a = 1:10; for k=a fprintf('%d\n',k); end a Outputs: 1 2 .... ...

casi 5 años ago | 0

Answered

how can i solve this equation on matlab?

<https://it.mathworks.com/help/matlab/ref/ode45.html>

how can i solve this equation on matlab?

<https://it.mathworks.com/help/matlab/ref/ode45.html>

casi 5 años ago | 0

Answered

Legend horizontal orientation doesn't work when extracting icon handles

As far as I know the syntax |[lgd,icons,plots,txt] = legend(..)| is not reccomended. Notice in fact that by simply calling |icon...

Legend horizontal orientation doesn't work when extracting icon handles

As far as I know the syntax |[lgd,icons,plots,txt] = legend(..)| is not reccomended. Notice in fact that by simply calling |icon...

casi 5 años ago | 2

| accepted

Answered

How to make a road lane for a synthetic image in gray scale?

Here it is: %create one element Z = zeros(100,101); %lateral lanes Z(:,[11:15,87:91]) = 1; %mid lane (dashed) ...

How to make a road lane for a synthetic image in gray scale?

Here it is: %create one element Z = zeros(100,101); %lateral lanes Z(:,[11:15,87:91]) = 1; %mid lane (dashed) ...

casi 5 años ago | 1

| accepted

Answered

Finding real roots of a cubic equation

To force the |vpasolve| finding only real solutions you cannot use |assume|. If you know the real solution is only one a workaro...

Finding real roots of a cubic equation

To force the |vpasolve| finding only real solutions you cannot use |assume|. If you know the real solution is only one a workaro...

casi 5 años ago | 0

Answered

How do I remove/replace border pixels from my image?

You basically don't need your |interior_blackPixels|. Indeed, your expected image is obtained by simply setting |outer_blackPixe...

How do I remove/replace border pixels from my image?

You basically don't need your |interior_blackPixels|. Indeed, your expected image is obtained by simply setting |outer_blackPixe...

casi 5 años ago | 0

| accepted

Answered

Custom Dendrogram Ordering Implementation

Apparently, none of the available functionalities of |optimalleaforder| does the work. So here it is a function that runs throug...

Custom Dendrogram Ordering Implementation

Apparently, none of the available functionalities of |optimalleaforder| does the work. So here it is a function that runs throug...

casi 5 años ago | 0

| accepted

Answered

Find the x value from a specific iteration of fmincon

From the help page about Output Functions <https://it.mathworks.com/help/matlab/math/output-functions.html Output Functions> you...

Find the x value from a specific iteration of fmincon

From the help page about Output Functions <https://it.mathworks.com/help/matlab/math/output-functions.html Output Functions> you...

casi 5 años ago | 0

| accepted

Answered

Setting Viewpoint with Azimuth, Elevation, and distance

Hi Viet, in order to control visualization in the current axes, consider these parameters also: CameraPosition CameraPos...

Setting Viewpoint with Azimuth, Elevation, and distance

Hi Viet, in order to control visualization in the current axes, consider these parameters also: CameraPosition CameraPos...

casi 5 años ago | 1

| accepted

Answered

How to plot a function file

Given a vector |y| of dice outcomes, plot the stairwise graph like this: y = [0,3,5,9,2]; X = [0,repelem(1:length(y)-1,2...

How to plot a function file

Given a vector |y| of dice outcomes, plot the stairwise graph like this: y = [0,3,5,9,2]; X = [0,repelem(1:length(y)-1,2...

casi 5 años ago | 0

Answered

Boundary function fails, R2016b

Hi Jukka, if you look at the plot of the boundary without superimposing it to the circles you can see (see first image below) th...

Boundary function fails, R2016b

Hi Jukka, if you look at the plot of the boundary without superimposing it to the circles you can see (see first image below) th...

casi 5 años ago | 1

| accepted

Answered

FFT Convolution on Wav File

Is your audio file |x| (loaded with |[x Fs]=audioread('drums.wav');| ) stereo? Because in this case the line X = fft( [x ; ...

FFT Convolution on Wav File

Is your audio file |x| (loaded with |[x Fs]=audioread('drums.wav');| ) stereo? Because in this case the line X = fft( [x ; ...

casi 5 años ago | 0

Answered

obtain cluster label on data

If you applied |kmeans| function like this: idx = kmeans(X,k) then |idx| is the vector containing the labels.

obtain cluster label on data

If you applied |kmeans| function like this: idx = kmeans(X,k) then |idx| is the vector containing the labels.

casi 5 años ago | 0

| accepted

Answered

K-means: see the initial centroids

Yes it is possible. |kmeans| allows you to set option parameters via the |statset| function. In the help page <https://it.m...

K-means: see the initial centroids

Yes it is possible. |kmeans| allows you to set option parameters via the |statset| function. In the help page <https://it.m...

casi 5 años ago | 1

| accepted

Answered

Problem Fitting data to 3 Gaussians

More efficient using built-in code to fit Guassian distributions. Try look at this function which allows you to choose the numbe...

Problem Fitting data to 3 Gaussians

More efficient using built-in code to fit Guassian distributions. Try look at this function which allows you to choose the numbe...

casi 5 años ago | 0

Answered

How do I put minor ticklabel on and ticklabel off ?

One solution can be to set y-limits to larger values, and then force the labels to be the original ones. This way, the labels wi...

How do I put minor ticklabel on and ticklabel off ?

One solution can be to set y-limits to larger values, and then force the labels to be the original ones. This way, the labels wi...

casi 5 años ago | 0

Answered

How to map the values from 0-320 to 0-29

Just multiply your values by 29/320; k = 29/320; %generate some random numbers between 0 and 320 x = 320*rand(5); ...

How to map the values from 0-320 to 0-29

Just multiply your values by 29/320; k = 29/320; %generate some random numbers between 0 and 320 x = 320*rand(5); ...

casi 5 años ago | 0

Answered

Normal Distribution Probability Finder

pp = makedist('Normal','mu',0,'sigma',1); yourP = 1-cdf(pp,-2.125)

Normal Distribution Probability Finder

pp = makedist('Normal','mu',0,'sigma',1); yourP = 1-cdf(pp,-2.125)

casi 5 años ago | 3

| accepted

Answered

Matrix multiplication with logical values error

For logical matrices matrix multiplication doesn't apply (because it is not logical operation). To get your Dyadic product, cas...

Matrix multiplication with logical values error

For logical matrices matrix multiplication doesn't apply (because it is not logical operation). To get your Dyadic product, cas...

casi 5 años ago | 0

| accepted

Answered

How do i fill a matrix from smaller matrices?

It seems from you code that your blocks are stored in a cell array of size 32x32 called |dcts|. If it is so, and each block is 8...

How do i fill a matrix from smaller matrices?

It seems from you code that your blocks are stored in a cell array of size 32x32 called |dcts|. If it is so, and each block is 8...

casi 5 años ago | 0

Answered

Is it possible getting x coördinates from an accelerometer measurement?

It seems you need to threshold the values of XYZ (that I think is a vector). Fore example, fix a thereshold to T=1 (or some that...

Is it possible getting x coördinates from an accelerometer measurement?

It seems you need to threshold the values of XYZ (that I think is a vector). Fore example, fix a thereshold to T=1 (or some that...

casi 5 años ago | 0

| accepted

Answered

How to remove the horizontal streamline when plotting contour using atan2? Streamline plotting help

Why they shouldn't be there? They SHOULD be there. This is the plot of the atan2 function: <</matlabcentral/answers/uploaded_...

How to remove the horizontal streamline when plotting contour using atan2? Streamline plotting help

Why they shouldn't be there? They SHOULD be there. This is the plot of the atan2 function: <</matlabcentral/answers/uploaded_...

casi 5 años ago | 0

Answered

How do I create bin widths using a simple algebra function?

*IMPORTANT: there is no need to use find!!!* *EXPLOIT MATLAB LOGICAL INDEXING* To replace "time<5" with "5<time<10" just u...

How do I create bin widths using a simple algebra function?

*IMPORTANT: there is no need to use find!!!* *EXPLOIT MATLAB LOGICAL INDEXING* To replace "time<5" with "5<time<10" just u...

casi 5 años ago | 1

| accepted

Answered

How to transpose a block matrix

Use cells, transpose them. C={[1,1;1,1],[2,2;2,2];[3,3;3,3],[5,5;5,5]}; D=C'; %to get matrices out of cells cell2m...

How to transpose a block matrix

Use cells, transpose them. C={[1,1;1,1],[2,2;2,2];[3,3;3,3],[5,5;5,5]}; D=C'; %to get matrices out of cells cell2m...

casi 5 años ago | 0

| accepted

Answered

how to change cursor to hour glass

For hour glass see this post: <https://it.mathworks.com/matlabcentral/newsreader/view_thread/32972> Otherwise, consider al...

how to change cursor to hour glass

For hour glass see this post: <https://it.mathworks.com/matlabcentral/newsreader/view_thread/32972> Otherwise, consider al...

casi 5 años ago | 0

| accepted

Answered

Playing sound one after another, according to number inputed

Just compute the time T (secs) the file lasts by using sample rate information and number of samples. Then, pause the for loop f...

Playing sound one after another, according to number inputed

Just compute the time T (secs) the file lasts by using sample rate information and number of samples. Then, pause the for loop f...

casi 5 años ago | 1

Answered

Determinant and inverse of a 3 X 3 matrix Issue

You are getting this error because in your function invanddet3by3(A) there is NO CALL to function invanddet2by2sol(...

Determinant and inverse of a 3 X 3 matrix Issue

You are getting this error because in your function invanddet3by3(A) there is NO CALL to function invanddet2by2sol(...

casi 5 años ago | 0

Answered

How to differentiate one list with respect to another?

Explain better what do you mean by "differentiate one list w.r.t. one another". If for a=[1,2,3,4,5] b=[10,11,12,13,...

How to differentiate one list with respect to another?

Explain better what do you mean by "differentiate one list w.r.t. one another". If for a=[1,2,3,4,5] b=[10,11,12,13,...

casi 5 años ago | 0

Answered

If I select an element in a matrix, say MAT(2,2), how to find how many elements of the same value of MAT(2,2) in the matrix are "connected" to it.

You need bwconncomp <https://it.mathworks.com/help/images/ref/bwconncomp.html> For example: Mat=[1 2 3 4 2;2 2 2 2 0;...

If I select an element in a matrix, say MAT(2,2), how to find how many elements of the same value of MAT(2,2) in the matrix are "connected" to it.

You need bwconncomp <https://it.mathworks.com/help/images/ref/bwconncomp.html> For example: Mat=[1 2 3 4 2;2 2 2 2 0;...

casi 5 años ago | 2