Answered
How do I leave the answer in real number form instead of natural exponents
That appears to be a symbolic vector. You should just be able to do double(gradientdescent) and get a plain numeric result

5 years ago | 1

| accepted

Answered
Reverse calculation for weighted average
Let's say we're trying to back calculate x= [a b c d e] that were used to generate the mean and sum. Is there a way to solve fo...

5 years ago | 1

| accepted

Answered
program that reads the color value in the CIE xyz color space and represents it on 3d space coordinates
Maybe this is of use. % generate two clusters of color points lab1 = randn(100,3).*[40 10 20] + [40 -40 40]; lab2 = randn(1...

5 years ago | 0

Answered
not enough input arguments
The error is occurring because you're not providing the function odDetect with any arguments. A function will throw the error o...

5 years ago | 0

Answered
How to run a for loop with two functions (nested for loop?)
Pretty sure that you're just intending to process alpha one element at a time, so just do that. Of course, you're overwriting a...

5 years ago | 0

| accepted

Answered
how can I plot the intersection of two cylinders?
Like everything, there are probably better ways, especially to get the edges closed. The simple way is to just plot the surface...

5 years ago | 0

| accepted

Answered
It can't read an image, it says the path does not exist even though the path does exist
Nobody here can guess the contents of the index file you're reading or the actual filenames on your disk. You can start by gene...

5 years ago | 0

Answered
Subtraction of cell values with a fixed value
You could use cellfun() if you wanted. s = [1 39]; A = randi([1 20],s(1),s(2)); k = 100; % the number to subtract blocksiz...

5 years ago | 0

| accepted

Answered
For loop to create a new matrix taking a cluster of columns from existing matrix
Blockwise sum along dim 2 using a cell array s = [1300 36]; % set the array size FR_mat = randi([1 20],s(1),s(2)); C = mat2...

5 years ago | 1

| accepted

Answered
how to shift decimals ? !!
It all depends on the number format you specify: mynumber = 3.023155942378474e+42; title(sprintf('My Number is %.4e',mynumber)...

5 years ago | 0

| accepted

Answered
Creating rgb vector based on Z data for standard colorbar
This is an old method. I kind of wonder if there's anything newer that makes this simple... % make a custom colormap n = 256;...

5 years ago | 1

| accepted

Answered
fourier image of angled shape, and changes when cropping
Because the results of fft2() are scaled to match the geometry of the image it operates on, the shape of objects in the fft imag...

5 years ago | 0

Answered
I am converting a 3D image to a set of 2D images(slices), but the images I receive are not of good quality, so there is a loss of information. Is there a solution? please help
Well here goes. I'm pretty sure the main problems were in the normalization, but there were other issues that could be simplifi...

5 years ago | 0

| accepted

Answered
segmentation of rice grains and sub plotting individual grains
You don't need the inner plot loop, and some other stuff can be simplified. I just removed the figure and imshow previews for b...

5 years ago | 0

| accepted

Answered
why the image processing usually use this eqution?
This example code implements a type of sliding filter. In this case, the filter size is defined by the filter kernel w (3x3). ...

5 years ago | 0

Answered
Get mean and stdev from all values
If column 1 is sorted: % build test array idx = repelem(1:10,randi(6,10,1)); idx = idx(1:20); D = [idx.' rand(20,1)]; % the ...

5 years ago | 0

| accepted

Answered
How to get the max orthogonal (perpendicular) distances from a set of coordinates
I'm sure this can be done much more efficiently, and I hope someone is motivated to prove that point. I'm cheating by using pol...

5 years ago | 1

| accepted

Answered
How to convert specific GrayScale into coloured pixel
I forgot you were doing masking in RGB. You're right. The union of the masks won't span the image. You could find the set dif...

5 years ago | 1

| accepted

Answered
How can I combine if statement inside for loop?
I don't know what this is trying to do, so here goes. t = [-0.095; -3.953; -7.52; 7.59; 37.66]; m6 = 1.4544e+06; m5 = -5.7624...

5 years ago | 0

| accepted

Answered
How can I change the 1_D array to the 2_D in specific case?
It would probably be easier to build the array without starting from the vector, but I imagine it's a requirement. It could be ...

5 years ago | 1

| accepted

Answered
Create Matrix Please Help Me
This is one way n = 6; A = diag(1:n) [bx by] = meshgrid(n:-1:1); B = triu(by) + tril(bx,-1)

5 years ago | 0

Answered
How do I put it in?
This isn't quite what you describe, since you're describing a series of 1x2 vectors, but: x1 = [-4.2 -2.6 -1 0.6 2.2 3.8 5.4 7 ...

5 years ago | 0

| accepted

Answered
What does the input image must be of class logical mean in Image region analyzer?
It means what it says. It requires that the images are binary images (all pixels are either black or white) and of class 'logic...

5 years ago | 0

Answered
concatenate repeating digit to the end of a column in numeric matrix
Are you sure the data is being truncated, or is it rounded? Guessing the wrong answer means your alignment of additional digits...

5 years ago | 0

Answered
contour map for stress distribution
I don't know what you're doing, but this at least runs: X = linspace(-4.5,4.5); R = linspace(-4.5,4.5); [X,Y] = meshgrid(X,R)...

5 years ago | 0

Answered
How can I color the area under a histfit curve?
I have no familiarity with violin plots or your data, and I don't know which violin plot tools you chose to use. If you're tryi...

5 years ago | 0

Answered
how to average the specific pixel value over a window
If the majority of pixels are white, the result is white, but otherwise average the nonwhite pixels. Such a filter can be made ...

5 years ago | 0

Answered
sum of array by specific index value
This is one way. It's probably not the most efficient way, but it does the job. idx = [4 2 4]; H = [3.6881 0.8506 0.0132 0.85...

5 years ago | 0

| accepted

Answered
Problem with drawing a hyperboloid
You get a simple bicone because Z = R; and the colormapping looks random because C = (X.^2 + Y.^2 - Z.^2).^m; is essential...

5 years ago | 0

Load more