Answered
What is the decimal RGB scale used in Matlab called?
As Rik Wisselink mentioned, RGB values are scaled to 0-255 (8 bit means 2^8 which equal 256). Matlab normalizes each RGB value ...

7 years ago | 2

| accepted

Answered
Extract only numbers from a cell array.
Here's a solution that first converts all elements that do not have a 'j' and then converts all elements that do have a 'j'. % ...

7 years ago | 0

Answered
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
When you call rand(100), you are creating a matrix of random numbers with 100 rows and 100 columns. size(rand(100)) ans = ...

7 years ago | 0

Answered
Extract values from double with for loop and calculate sum
There's no need for loops. I'll walk you through my solution. I have a double, called 'file' here, consisting of two columns ...

7 years ago | 1

| accepted

Answered
how i plot specified point from signal ?
If your data were plotted with plot(x,y) and you want to only plot data where y~=0, then first find the indices where y~=0 an...

7 years ago | 0

| accepted

Answered
Number of peaks within window
Here's a solution that uses findpeaks() (<- link) and applies it to a moving window through your data. You might need to play a...

7 years ago | 0

| accepted

Answered
out = Matched(double(im1)+1);
Short answer Not enough information to know what's going on. Longer, speculative answer im1 is a variable, probably numeric,...

7 years ago | 0

Answered
If function, Index exceeds matrix dimensions.
When evaluating your anonymous function, the error is caused by "z(2)". In your code, size(z) = [1, 1] and you're trying to ind...

7 years ago | 0

| accepted

Answered
How can I calculate the mean square error (MSE) for SVM in Matlab?
You haven't shared the part of the code that produces mdl but I'm assuming mdl is a ClassificationECOC model produced by your sv...

7 years ago | 0

Answered
Im having trouble with unit step functions
As the error indicates 'u' is not defined. Assuming it's a variable, it has no value and is not defined. If it's a function, ...

7 years ago | 0

Answered
datetime function vertical line
You're probably not using datetime formated variables. This works: dt = datetime({'15-Aug-2017 17:58:58' '15-Aug-2017 18:00:5...

7 years ago | 0

Answered
Updating surface colors when new data is assigned
Nathan, The color data are stored in h.CData. When the plot is created it automatically assigns color based on the coordinate...

7 years ago | 1

| accepted

Answered
Can you have 4 subplots directly underneath one another?
subplot(4,1,1) subplot(4,1,2) subplot(4,1,3) subplot(4,1,4) The first number is how many rows of subplots. The second numb...

7 years ago | 0

Answered
Remove points from a mesh
If you know the parameters of the circle that encompasses the area you'd like to remove (ie, the center coordinates and the radi...

7 years ago | 0

| accepted

Answered
Guassian Function, for loop only runs once???
You're probably indexing incorrectly and instead of using the variable 'i', you're accidentally using a hard-coded value (maybe ...

7 years ago | 0

| accepted

Answered
pliz help me to run a for loop for a specific run time for each iteration
In this example, your code is executed on each iteration and the while-loop waits for the remaining time to pass before entering...

7 years ago | 2

| accepted

Answered
Matrix dimension must agree
The error message is telling you the problem. In the line below, you're multiplying two matrices I0f and 10.^(-a1). If you loo...

7 years ago | 0

Answered
help creating plot of type in attached example
(comment moved here so that the question is answered) To vertically offset on a linear axis, you just have to add a constant to...

7 years ago | 1

| accepted

Answered
Normalize a histogram to a different datasets, Normalize two histograms to their sum
Idea 1 This is a little bit of a hack but you could add NaN values to each histogram input so that it has 115 elements. Then th...

7 years ago | 2

| accepted

Answered
How to plot the contour polar map in matlab
Hmmmm, I'm not sure if it's possible to directly draw contour lines in polar coordinates with Matlab (I'd love to know otherwise...

7 years ago | 0

| accepted

Answered
How to group values based on week number
The solution below lists the unique week numbers in unqWeekNum. It then loops through each unique week number and stores all Ve...

7 years ago | 1

| accepted

Answered
hello i want to search for ( * .inf ) files in a folder
Here's a function that searches for files with a given extension. It searches through a chosen parent directory and all of its ...

7 years ago | 1

| accepted

Answered
what is the meaning of following code?
s_box_in is a matrix, presumably of positive, non-zero integers such as [5 2 99 43 100, ...] s_box_table is a hard-coded list o...

7 years ago | 0

Answered
How to evaluate all the functions that I have in a directory automatically?
" I know I can use a function handler, but still I am not sure how can I read all the files in the given directory, and the pass...

8 years ago | 1

| accepted

Answered
Repeated user input for even numbers
The while loop will continually ask for a non-zero even integer until one is entered. prompt= 'Input a value: ' z = 1; whil...

8 years ago | 0

| accepted

Answered
How can I use a while loop to check if user input is an integer?
The while loop will continually ask for a non-zero even integer until one is entered. prompt= 'enter non zero even integer ' ...

8 years ago | 0

| accepted

Answered
1X1500 cell array to matrix
Since each matrix is the same size, here's an easy solution: If your cell array is named 'ca', 'm' will be your 3D array. m ...

8 years ago | 1

Answered
How to fit time series to the curve-linear trend
Since your data look approximately normally distributed, you can measure the standard deviation of your data and use that to pro...

8 years ago | 1

Answered
get 2 set of random coordinates
In this demo, I create a grid of coordinates identical to the plot in your question. Then I randomly select a subsection of the...

8 years ago | 1

| accepted

Answered
How to add a legend in a fig, without showing all lines
After you open the figure, before adding additional objects to the plot, turn off auto-updating like this: legend('AutoUpdate'...

8 years ago | 0

Load more