Answered
Why the results are different when use different letters?
They are not the same. syms rs xs rp xp; [rp,xp] = solve( rs*rp^2+rs*xp^2 == xp^2*rp, xs*rp^2+xs*xp^2 == rp^2*xp) syms a b...

4 years ago | 0

Answered
How do I define the y axis of imagesc as integers and not fractions?
What Simon says is correct. If you only want the center ticks, you can specify them explicitly: A = rand(2,6); imagesc(A); y...

4 years ago | 0

| accepted

Answered
Skewed Data when Scaling axis with imagesc()
When setting x and y inputs to imagesc() or image(), the entire x,y vectors are not used. Imagesc considers only the first and ...

4 years ago | 0

| accepted

Answered
Concatenate strings and numbers
Strings and chars are different. Take care in how you combine them. MaxRows = 10; String1 = num2str(MaxRows) % a char vector ...

4 years ago | 0

| accepted

Answered
How do I resolve this error?
Which error? I see a number of errors in the function definition and console. This looks like you took a function you found so...

4 years ago | 0

Answered
How to extract positive, negative and fraction numbers from string?
Since it was never clarified, I'm going to ignore sci/eng notation: str = '+100 -100 100 100.1 100.001 1.001 .001 100.'; B = s...

4 years ago | 0

Answered
I want to run this code?
I can't test anything, since there are missing functions, but: % there is no linespace() %[X,Y] = meshgrid(linespace(0,1,N),li...

4 years ago | 0

Answered
Why am I not able to plot this?
Three things: How are you calling the function? This file contains code prior to the function header, so it's not a function f...

4 years ago | 0

Answered
what value should i give for hsize and sigma in fspecial (gaussian) function???
Unless you have other needs, just pick a sigma value and then calculate hsize like so: sigma = 20; % this depends on your needs...

4 years ago | 0

Answered
How to flip non-zero elements of an array and keep zero elements at initial position?
I'm sure there's something simpler, but this is what my sleeplessness created: A = [1:5 0; 11:14 0 0; 21:23 0 0 0; 31 0 32 0 33...

4 years ago | 0

Answered
logical operation on matrix
I'm going to assume that the text question is what you're after: A = randi([100 999],10,10) % a bunch of integers mk = A>=500 ...

4 years ago | 0

| accepted

Answered
problem with creating video from black and white images
What is class(image) and [min(image) max(image)] ? Because if the images are logical (or unit-scale floating point) the...

4 years ago | 0

| accepted

Answered
RGB to YUV conversion
If all you want is Y, then just lumapict = rgb2gray(rgbpict); This calculates the luma (Y) based on the constants specified in...

4 years ago | 0

Answered
Image contrast when using labeloverlay
Try putting your images on a common scale. im = mat2gray(im); C = mat2gray(C); This will put both images in the range [0 1]...

4 years ago | 1

| accepted

Answered
Returning an array of colors from a double image
Oh okay I totally misunderstood the question. Round 2: A = imread('patchchart.png'); patchmask = rgb2gray(A)>40; patchmask...

4 years ago | 0

Answered
how i can superpose (overlay) two images ?
You can use tools like imoverlay() or imfuse(), or you can combine the images by opacity blending. There are other ways "over...

4 years ago | 2

Answered
Connecting the dots in a binary image
It may be overkill for such a small image, but my answer to a previous question works well for largely convex closed paths like ...

4 years ago | 0

| accepted

Answered
Graphic color that changes according to data
These are both similar examples: https://www.mathworks.com/matlabcentral/answers/1654235-how-to-change-color-of-graph-after-a-c...

4 years ago | 0

Answered
How to construct a N x N window that moves about an array (R) to calculate the number of a certain element in the window.
You'd just create a simple square array of ones. Consider the test array: R = zeros(9); R(1:2:end) = 1 % make a filter N = ...

4 years ago | 1

Answered
cutting a smaller potion of an image
Consider the following simplified matrix: A = [1 1 1 4 4 4 7 7 7;1 1 1 4 4 4 7 7 7;1 1 1 4 4 4 7 7 7; ... 2 2 2 5 5 5 8 8 ...

4 years ago | 0

Answered
Returning an array of colors from a double image
You can leverage rgb2ind()'s minimum variance quantization to get a best-fit color table of specified length. A = imread('https...

4 years ago | 0

Answered
when blur is a low frequency component, how does a motion blurred image spectrum possess high frequency?
This isn't going to be a technical explanation, but consider the following: I don't know where the source image came from, but ...

4 years ago | 0

Answered
is it possible to define only the sigma value in the edge command?
Bear in mind that even if you were able to specify the arguments out of order, edge() will assume a default threshold value. Th...

4 years ago | 0

Answered
How do I use a plus and minus in a variable
If we're simply working with numeric variables, something like this may work: B = 5 + [4 -4] Or in cases where the +/- term is...

4 years ago | 1

Answered
How to extract odd values and even values from a 500x500 black image ?
Consider the matrix: A = randi([10 99],5,5) % get elements from odd linear indices oddelems = A(1:2:numel(A)) % get elements...

4 years ago | 0

Answered
Create a specific matrix (MATLAB)
This is one way: A = flipud(toeplitz([4 3 2 1]))

4 years ago | 0

Answered
add space column to matrix
See if this is more along the lines of what you need A = [1 2 3;4 5 6] b = {'a' 'b' 'c' 'd'} Ac = split(sprintf('%G\n',A'))...

4 years ago | 0

Answered
How does the colon operator work in a 4d object?
Your goal isn't to affect the values of a particular dimension. There are no values "of a dimension" it's just the whole array....

4 years ago | 0

Answered
How to overlay a mask on an image with zero transperancy?
You can still use basic masking methods. Note that in this case, the images as supplied are both uint8. If your working images...

4 years ago | 0

| accepted

Answered
How to draw a letter T ? the background is black and the letter itself white
FWIW, you can always just do A = ones(16,18); A([3:5 19 20 35 44 51:60 67:76 83 92 99 100 115:117 ... 150 166 180:187 195...

4 years ago | 0

Load more